refactor: centralize all physical constants in constants.py, fix unit naming
- Add EULER_GAMMA, ME_KEV, R0_FM to constants.py - Replace hardcoded 0.511, 0.5772..., 1.2 with imports from constants - Fix T_to_W parameter name: T_kev -> T_MeV (it takes MeV, not keV) - Remove duplicate ME_ME from spectrum.py (import ME_MEV from constants) - Remove hardcoded r_0 from detector_response.py and radiative.py - Update CONVENTIONS.md to reference correct constant names
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
# constants.py
|
||||
ALPHA = 1 / 137.035999084 # fine-structure constant
|
||||
EULER_GAMMA = 0.57721566490153286 # Euler-Mascheroni constant
|
||||
HBAR_C_MEV_FM = 197.3269804 # MeV * fm
|
||||
ME_MEV = 0.510998950 # MeV / c^2
|
||||
MP_MEV = 938.272088816 # MeV / c^2
|
||||
ME_MEV = 0.510998950 # electron rest mass in MeV / c^2
|
||||
ME_KEV = ME_MEV * 1000.0 # electron rest mass in keV
|
||||
MP_MEV = 938.272088816 # proton rest mass in MeV / c^2
|
||||
R0_FM = 1.2 # nuclear radius parameter in fm
|
||||
|
||||
Reference in New Issue
Block a user