From bae04188aff4e74c47a8d71aa56c8378d341e384 Mon Sep 17 00:00:00 2001 From: Mihai Cara Date: Mon, 16 Dec 2024 17:13:01 -0500 Subject: [PATCH 1/2] Fix issues in outlier det. due to GWCS.inverse enforcing bbox --- src/stcal/outlier_detection/utils.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/stcal/outlier_detection/utils.py b/src/stcal/outlier_detection/utils.py index 00b577ace..8717bc211 100644 --- a/src/stcal/outlier_detection/utils.py +++ b/src/stcal/outlier_detection/utils.py @@ -284,7 +284,18 @@ def calc_gwcs_pixmap(in_wcs, out_wcs, in_shape): log.debug("Bounding box from data shape: {}".format(bb)) grid = gwcs.wcstools.grid_from_bounding_box(bb) - return np.dstack(reproject(in_wcs, out_wcs)(grid[0], grid[1])) + + # temporarily disable the bounding box: + orig_bbox = out_wcs.bounding_box + out_wcs.bounding_box = None + try: + pixmap = np.dstack(reproject(in_wcs, out_wcs)(grid[0], grid[1])) + finally: + # restore bounding box: + if orig_bbox is not None: + out_wcs.bounding_box = orig_bbox + + return pixmap def reproject(wcs1, wcs2): From 8838fb7a8fad5779fc74e2134b8b2595be238992 Mon Sep 17 00:00:00 2001 From: Mihai Cara Date: Mon, 16 Dec 2024 17:31:55 -0500 Subject: [PATCH 2/2] add changelog --- changes/324.bugfix.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 changes/324.bugfix.rst diff --git a/changes/324.bugfix.rst b/changes/324.bugfix.rst new file mode 100644 index 000000000..e0462c23d --- /dev/null +++ b/changes/324.bugfix.rst @@ -0,0 +1 @@ +Updated ``outlier_detection`` to work with the upcoming GWCS release that by default enables filtering of world coordinates by footprint of the bounding box on the sky for inverse transformations (world->detector). \ No newline at end of file