Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Salt2 ColorLaw function correction #389

Merged
merged 2 commits into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion sncosmo/salt2utils.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,6 @@ cdef class SALT2ColorLaw(object):
# reconstruct input wavelengths
wave_lo = self.l_lo * SALT2CL_V_MINUS_B + SALT2CL_B
wave_hi = self.l_hi * SALT2CL_V_MINUS_B + SALT2CL_B
coeffs = [self.coeffs[i+1] for i in range(self.ncoeffs)]
coeffs = [self.coeffs[i+1] for i in range(self.ncoeffs - 1)]

return (wave_lo, wave_hi), coeffs
2 changes: 1 addition & 1 deletion sncosmo/tests/test_salt2utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def colorlaw_python(wave):

def test_salt2colorlaw_pickle():

colorlaw_coeffs = [-0.504294, 0.787691, -0.461715, 0.0815619]
colorlaw_coeffs = [-0.504294, 0.787691, -0.461715, 0.0815619, 0.0, 0.0]
colorlaw_range = (2800., 7000.)
colorlaw = SALT2ColorLaw(colorlaw_range, colorlaw_coeffs)

Expand Down