diff --git a/changes/314.bugfix.rst b/changes/314.bugfix.rst deleted file mode 100644 index 589d75d8..00000000 --- a/changes/314.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Do not evaluate the inverse WCS transform within the bounding box in cases where a resampled WCS is computed. Do not pass table columns to the WCS Shared API. diff --git a/pyproject.toml b/pyproject.toml index 1b2c79e9..7469834d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -20,7 +20,7 @@ dependencies = [ "numpy >=1.21.2", "opencv-python-headless >=4.6.0.66", "asdf >=2.15.0", - "gwcs @ git+https://github.com/spacetelescope/gwcs.git@master", + "gwcs >= 0.18.1", "tweakwcs >=0.8.8", "requests >=2.22", ] diff --git a/src/stcal/alignment/util.py b/src/stcal/alignment/util.py index 4c61ff97..90eb9420 100644 --- a/src/stcal/alignment/util.py +++ b/src/stcal/alignment/util.py @@ -394,7 +394,7 @@ def compute_scale( msg = "If input WCS is spectral, a disp_axis must be given" raise ValueError(msg) - crpix = np.array(wcs.invert(*fiducial, with_bounding_box=False)) + crpix = np.array(wcs.invert(*fiducial)) delta = np.zeros_like(crpix) spatial_idx = np.where(np.array(wcs.output_frame.axes_type) == "SPATIAL")[0] @@ -441,7 +441,7 @@ def compute_fiducial(wcslist: list, (low, high) values. The bounding_box is in the order of the axes, axes_order. For two inputs and axes_order(0, 1) the bounding box can be either ((xlow, xhigh), (ylow, yhigh)) or [[xlow, xhigh], [ylow, yhigh]]. - + Returns ------- fiducial : np.ndarray @@ -704,7 +704,7 @@ def wcs_from_sregions( footprints : list of np.ndarray or list of str If list elements are numpy arrays, each should have shape (N, 2) and contain (RA, Dec) vertices demarcating the footprint of the input WCSs. - If list elements are strings, each should be the S_REGION header keyword + If list elements are strings, each should be the S_REGION header keyword containing (RA, Dec) vertices demarcating the footprint of the input WCSs. ref_wcs : @@ -756,8 +756,8 @@ def wcs_from_sregions( The WCS object corresponding to the combined input footprints. """ - footprints = [_sregion_to_footprint(s_region) - if isinstance(s_region, str) else s_region + footprints = [_sregion_to_footprint(s_region) + if isinstance(s_region, str) else s_region for s_region in footprints] fiducial = _calculate_fiducial(footprints, crval=crval) diff --git a/tests/test_tweakreg.py b/tests/test_tweakreg.py index de6fdabb..335c62c6 100644 --- a/tests/test_tweakreg.py +++ b/tests/test_tweakreg.py @@ -244,7 +244,7 @@ def input_catalog(datamodel): cat = amutils.get_catalog(fiducial[0], fiducial[1], search_radius=radius, catalog=TEST_CATALOG) - x, y = w.world_to_pixel(cat["ra"].value, cat["dec"].value) + x, y = w.world_to_pixel(cat["ra"], cat["dec"]) return Table({"x": x, "y": y})