diff --git a/drizzle/tests/test_utils.py b/drizzle/tests/test_utils.py index f4c598f..a961cb1 100644 --- a/drizzle/tests/test_utils.py +++ b/drizzle/tests/test_utils.py @@ -111,7 +111,26 @@ def test_estimate_pixel_scale_ratio(): input_file = os.path.join(DATA_DIR, 'j8bt06nyq_flt.fits') with fits.open(input_file) as h: + hdr = h[1].header + assert abs(hdr['CRPIX1'] / 512 - 1) < 1e-14 + assert abs(hdr['CRPIX2'] / 512 - 1) < 1e-14 + assert abs(hdr['CRVAL1'] / 6.027148333333000000000 - 1) < 1e-14 + assert abs(hdr['CRPIX2'] / 72.08351111111000000000 + 1) < 1e-14 + assert abs(hdr['CD1_1'] / 7.360500000000000000000E-06 + 1) < 1e-14 + assert abs(hdr['CD1_2'] / 1.845600000000000000000E-06 - 1) < 1e-14 + assert abs(hdr['CD2_1'] / 2.868580000000000000000E-06 - 1) < 1e-14 + assert abs(hdr['CD2_2'] / 6.649460000000000000000E-06 - 1) < 1e-14 w = wcs.WCS(h[1].header) + assert np.allclose(w.wcs.crval, [6.027148333333000000000, -72.08351111111000000000], rtol=1e-14) + assert np.allclose(w.wcs.crpix, [512.0, 512.0], rtol=1e-14) + assert np.allclose( + w.wcs.cd, + [ + [-7.360500000000000000000E-06, 1.845600000000000000000E-06], + [2.868580000000000000000E-06, 6.649460000000000000000E-06] + ], + rtol=1e-14 + ) pscale = estimate_pixel_scale_ratio(w, w, w.wcs.crpix, (0, 0))