Skip to content

Commit

Permalink
Fix GWCS failures due to the API spring cleaning PR
Browse files Browse the repository at this point in the history
  • Loading branch information
WilliamJamieson committed Dec 11, 2024
1 parent 8def73e commit f74bb79
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion jwst/assign_wcs/tests/test_wcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from astropy import units as u
from astropy import wcs
from astropy.io import fits
from astropy.coordinates import SkyCoord, SpectralCoord
from astropy.modeling.models import RotationSequence3D

from gwcs.wcstools import grid_from_bounding_box
Expand Down Expand Up @@ -148,7 +149,10 @@ def test_frame_from_model_3d(tmp_path, create_model_3d):
# Test CompositeFrame initialization (celestial and spectral)
im = create_model_3d
frame = pointing.frame_from_model(im)
radec, lam = frame.coordinates(1, 2, 3)

# This "fix" is subject to change, API maybe added to gwcs to handle this sort of thing.
radec = SkyCoord(1, 2, unit=frame.frames[0].unit, frame=frame.frames[0].reference_frame)
lam = SpectralCoord(3, frame.frames[1].unit[0])

assert_allclose(radec.spherical.lon.value, 1)
assert_allclose(radec.spherical.lat.value, 2)
Expand Down
4 changes: 2 additions & 2 deletions jwst/tweakreg/tests/test_multichip_jwst.py
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ def test_multichip_alignment_step_rel(monkeypatch):
format='ascii.ecsv', delimiter=' ',
names=['RA', 'DEC']
)
x, y = wr.world_to_pixel(refcat['RA'], refcat['DEC'])
x, y = wr.world_to_pixel_values(refcat['RA'], refcat['DEC'])
refcat['x'] = x
refcat['y'] = y
mr.tweakreg_catalog = refcat
Expand Down Expand Up @@ -459,7 +459,7 @@ def test_multichip_alignment_step_abs(monkeypatch):
format='ascii.ecsv', delimiter=' ',
names=['RA', 'DEC']
)
x, y = wr.world_to_pixel(refcat['RA'], refcat['DEC'])
x, y = wr.world_to_pixel_values(refcat['RA'], refcat['DEC'])
refcat['x'] = x
refcat['y'] = y
mr.tweakreg_catalog = refcat
Expand Down

0 comments on commit f74bb79

Please sign in to comment.