Skip to content

Commit

Permalink
Merge pull request #114 from lincc-frameworks/snia_rates
Browse files Browse the repository at this point in the history
fix snia test
  • Loading branch information
mi-dai committed Sep 18, 2024
2 parents e733776 + c3b6c3c commit 412ced7
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tests/tdastro/sources/test_snia.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,15 @@ def draw_single_random_sn(
Draw a single random SN realiztion
"""

res = {"wavelengths_rest": wavelengths_rest, "phase_rest": phase_rest}

state = source.sample_parameters()

z = source.get_param(state, "redshift")
wave_obs = wavelengths_rest * (1.0 + z)
wave_obs = passbands.waves
wavelengths_rest = wave_obs / (1.0 + z)
phase_obs = phase_rest * (1.0 + z)

res = {"wavelengths_rest": wavelengths_rest, "phase_rest": phase_rest}

t0 = source.get_param(state, "t0")
times = t0 + phase_obs

Expand Down Expand Up @@ -145,7 +146,6 @@ def test_snia_end2end(
],
delta_wave=1,
)
wavelengths_rest = passbands.waves

res_list = []

Expand Down Expand Up @@ -178,7 +178,7 @@ def test_snia_end2end(
model = sncosmo.Model(sncosmo_modelname)
model.update(saltpars)
z = p["redshift"]
wave = wavelengths_rest * (1 + z)
wave = passbands.waves
if opsim is None:
time = phase_rest * (1 + z) + p["t0"]
assert np.allclose(res["times"], time)
Expand Down

0 comments on commit 412ced7

Please sign in to comment.