diff --git a/sncosmo/salt2utils.pyx b/sncosmo/salt2utils.pyx index ff95327..e6316a5 100644 --- a/sncosmo/salt2utils.pyx +++ b/sncosmo/salt2utils.pyx @@ -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 diff --git a/sncosmo/tests/test_salt2utils.py b/sncosmo/tests/test_salt2utils.py index 2204df6..41f7e4b 100644 --- a/sncosmo/tests/test_salt2utils.py +++ b/sncosmo/tests/test_salt2utils.py @@ -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)