Skip to content

Commit

Permalink
regression test only looks at wavelength solution in range 300-1200nm
Browse files Browse the repository at this point in the history
  • Loading branch information
chris-simpson committed Mar 23, 2021
1 parent db508ce commit 0e396e3
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,12 @@ def test_regression_determine_wavelength_solution(
slit_size_in_px = slit_size_in_arcsec / pixel_scale
dispersion = abs(wcalibrated_ad[0].dispersion(asNanometers=True)) # nm / px

# We don't care about what the wavelength solution is doing at
# wavelengths where there's no data
indices = np.where(np.logical_and(ref_wavelength > 300, ref_wavelength < 1200))
tolerance = 0.5 * (slit_size_in_px * dispersion)
np.testing.assert_allclose(wavelength, ref_wavelength, rtol=tolerance)
np.testing.assert_allclose(wavelength[indices], ref_wavelength[indices],
rtol=tolerance)

if request.config.getoption("--do-plots"):
do_plots(wcalibrated_ad)
Expand Down

0 comments on commit 0e396e3

Please sign in to comment.