Add massive neutrino support and improve CSV/CLI output

- Add neutrino mass parameter to SpectrumConfig and CLI interface
- Update PhaseSpace component to handle neutrino mass effects properly
- Update CSV headers to show basic endpoint and all transition types
- Add --csv-verbosity option to CLI with 'full' and 'concise' options
- Fix comparison plots to properly show linear scale variations
- Add comprehensive tests for neutrino mass functionality
This commit is contained in:
2026-07-02 10:33:28 +03:00
parent 406fd57bcd
commit 876e1e3ab8
48 changed files with 5213 additions and 97 deletions
+8
View File
@@ -470,6 +470,7 @@ def decay_info_to_config(
info: DecayInfo,
e_step_MeV: float = 0.001,
intensity_cutoff: float = 0.0,
neutrino_mass_MeV: float = 0.0,
) -> SpectrumConfig:
"""
Convert DecayInfo to a SpectrumConfig.
@@ -482,6 +483,8 @@ def decay_info_to_config(
Energy step size in MeV.
intensity_cutoff : float
Minimum branch intensity fraction to include.
neutrino_mass_MeV : float
Neutrino mass in MeV.
Returns
-------
@@ -510,6 +513,7 @@ def decay_info_to_config(
endpoint_MeV=info.endpoint_MeV,
transition_type=info.transition_type,
e_step_MeV=e_step_MeV,
neutrino_mass_MeV=neutrino_mass_MeV,
branches=branches,
intensity_cutoff=intensity_cutoff,
)
@@ -529,6 +533,7 @@ DEFAULT_JSON_SCHEMA = {
"A_number": 99,
"transition_type": "F2",
"e_step_MeV": 0.001,
"neutrino_mass_MeV": 0.0,
"detector_model": "gaussian",
"detector_sigma_a_keV": 1.0,
"detector_sigma_b": 0.0,
@@ -638,6 +643,7 @@ def json_to_config(data: Dict[str, Any]) -> SpectrumConfig:
endpoint_MeV=float(data["endpoint_MeV"]),
transition_type=str(data.get("transition_type", "A")),
e_step_MeV=float(data.get("e_step_MeV", 0.001)),
neutrino_mass_MeV=float(data.get("neutrino_mass_MeV", 0.0)),
)
@@ -683,11 +689,13 @@ def create_config_from_source(
decay_index = kwargs.get("decay_index", None)
e_step = kwargs.get("e_step_MeV", 0.001)
intensity_cutoff = kwargs.get("intensity_cutoff", 0.0)
neutrino_mass = kwargs.get("neutrino_mass_MeV", 0.0)
info = get_decay_info_from_paceENSDF(nuclide, decay_type, decay_index)
return decay_info_to_config(
info,
e_step_MeV=e_step,
intensity_cutoff=intensity_cutoff,
neutrino_mass_MeV=neutrino_mass,
)
elif source == "json":
if not json_path: