Skip to content

Commit

Permalink
Fix issues in outlier det. due to GWCS.inverse enforcing bbox
Browse files Browse the repository at this point in the history
  • Loading branch information
mcara committed Dec 16, 2024
1 parent 4953380 commit bae0418
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/stcal/outlier_detection/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Check warning on line 296 in src/stcal/outlier_detection/utils.py

View check run for this annotation

Codecov / codecov/patch

src/stcal/outlier_detection/utils.py#L296

Added line #L296 was not covered by tests

return pixmap


def reproject(wcs1, wcs2):
Expand Down

0 comments on commit bae0418

Please sign in to comment.