From f74bb79a1adc20e2af10278f4f75ad24fe728386 Mon Sep 17 00:00:00 2001 From: William Jamieson Date: Mon, 18 Nov 2024 13:43:41 -0500 Subject: [PATCH] Fix GWCS failures due to the API spring cleaning PR --- jwst/assign_wcs/tests/test_wcs.py | 6 +++++- jwst/tweakreg/tests/test_multichip_jwst.py | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/jwst/assign_wcs/tests/test_wcs.py b/jwst/assign_wcs/tests/test_wcs.py index cd1b4e9912..245480558d 100644 --- a/jwst/assign_wcs/tests/test_wcs.py +++ b/jwst/assign_wcs/tests/test_wcs.py @@ -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 @@ -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) diff --git a/jwst/tweakreg/tests/test_multichip_jwst.py b/jwst/tweakreg/tests/test_multichip_jwst.py index 4402f7b897..e608cee309 100644 --- a/jwst/tweakreg/tests/test_multichip_jwst.py +++ b/jwst/tweakreg/tests/test_multichip_jwst.py @@ -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 @@ -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