diff --git a/jwst/resample/resample_utils.py b/jwst/resample/resample_utils.py index da917d7e41..61b8c38720 100644 --- a/jwst/resample/resample_utils.py +++ b/jwst/resample/resample_utils.py @@ -137,7 +137,17 @@ def calc_gwcs_pixmap(in_wcs, out_wcs, shape=None): log.debug("Bounding box from WCS: {}".format(in_wcs.bounding_box)) grid = gwcs.wcstools.grid_from_bounding_box(bb) - pixmap = np.dstack(reproject(in_wcs, out_wcs)(grid[0], grid[1])) + + if hasattr(out_wcs, "bounding_box"): + orig_bbox = getattr(out_wcs, "bounding_box", None) + out_wcs.bounding_box = None + else: + orig_bbox = None + try: + pixmap = np.dstack(reproject(in_wcs, out_wcs)(grid[0], grid[1])) + finally: + if orig_bbox is not None: + out_wcs.bounding_box = orig_bbox return pixmap diff --git a/jwst/skymatch/skymatch_step.py b/jwst/skymatch/skymatch_step.py index 9762a72048..2ab0fa0af3 100644 --- a/jwst/skymatch/skymatch_step.py +++ b/jwst/skymatch/skymatch_step.py @@ -169,6 +169,7 @@ def _imodel2skyim(self, image_model, index): .format(image_model.meta.filename)) wcs = deepcopy(image_model.meta.wcs) + wcs.bounding_box = None sky_im = SkyImage( image=image_model.data,