Skip to content

Commit

Permalink
DEBUG: unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
mcara committed Oct 15, 2024
1 parent 1cddef3 commit e416d18
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions drizzle/tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Expand Down

0 comments on commit e416d18

Please sign in to comment.