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
+6 -8
View File
@@ -74,15 +74,15 @@ class TestPhaseSpaceNeutrinoMass:
val_massive = ps_massive(W_near_endpoint)[0]
assert not np.isnan(val_massive), "Should produce finite value"
assert (
val_massive < val_zero
), "Massive neutrino must suppress spectrum near endpoint"
assert val_massive < val_zero, (
"Massive neutrino must suppress spectrum near endpoint"
)
@pytest.mark.physics
def test_massive_neutrino_below_threshold(self):
"""With m_nu > 0, below the effective threshold (W₀−W < m_nu), sqrt gives NaN.
"""With m_nu > 0, below the effective threshold (W₀−W < m_nu), the spectrum should be 0.
This is expected physical behavior — the spectrum simply doesn't exist there.
This is the correct physical behavior — the spectrum doesn't exist below the kinematic threshold.
"""
ps = PhaseSpace(W0=5.0, m_nu=0.1)
@@ -94,6 +94,4 @@ class TestPhaseSpaceNeutrinoMass:
W_deep_below = np.array([4.95]) # W₀ − W = 0.05 < m_nu=0.1 — below threshold
result_below = ps(W_deep_below)
assert np.isnan(
result_below[0]
), "Below kinematic threshold, spectrum should be NaN"
assert result_below[0] == 0.0, "Below kinematic threshold, spectrum should be 0"