From 7ada41c57bd30ac82f530dfd5b2e0b959fad95e4 Mon Sep 17 00:00:00 2001 From: Ned Molter Date: Fri, 20 Dec 2024 10:29:38 -0500 Subject: [PATCH 1/2] revert removal of bbox in computing reverse transform --- jwst/resample/resample_utils.py | 8 +------- pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/jwst/resample/resample_utils.py b/jwst/resample/resample_utils.py index da917d7e41..71706d3358 100644 --- a/jwst/resample/resample_utils.py +++ b/jwst/resample/resample_utils.py @@ -163,14 +163,8 @@ def reproject(wcs1, wcs2): """ try: - # Here we want to use the WCS API functions so that a Sliced WCS - # will work as well. However, the API functions do not accept - # keyword arguments and `with_bounding_box=False` cannot be passsed. - # We delete the bounding box on a copy of the WCS - yes, inefficient. forward_transform = wcs1.pixel_to_world_values - wcs_no_bbox = deepcopy(wcs2) - wcs_no_bbox.bounding_box = None - backward_transform = wcs_no_bbox.world_to_pixel_values + backward_transform = wcs1.world_to_pixel_values except AttributeError as err: raise TypeError("Input should be a WCS") from err diff --git a/pyproject.toml b/pyproject.toml index 2d7907ed2d..d70d693d83 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -33,7 +33,7 @@ dependencies = [ "scikit-image>=0.19", "scipy>=1.14.1", "spherical-geometry>=1.2.22", - "stcal @ git+https://github.com/spacetelescope/stcal.git@main", + "stcal @ git+https://github.com/mcara/stcal.git@fix-bbox-shift-make-wcs", "stdatamodels @ git+https://github.com/spacetelescope/stdatamodels.git@main", "stpipe @ git+https://github.com/spacetelescope/stpipe.git@main", "stsci.imagestats>=1.6.3", From 6c68e6116431e23ff4a82ed43599bfdaa765700c Mon Sep 17 00:00:00 2001 From: Ned Molter Date: Fri, 20 Dec 2024 14:33:35 -0500 Subject: [PATCH 2/2] fix typo wcs1 should have been wcs2 --- jwst/resample/resample_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jwst/resample/resample_utils.py b/jwst/resample/resample_utils.py index 71706d3358..ded0229789 100644 --- a/jwst/resample/resample_utils.py +++ b/jwst/resample/resample_utils.py @@ -164,7 +164,7 @@ def reproject(wcs1, wcs2): try: forward_transform = wcs1.pixel_to_world_values - backward_transform = wcs1.world_to_pixel_values + backward_transform = wcs2.world_to_pixel_values except AttributeError as err: raise TypeError("Input should be a WCS") from err