Skip to content

Commit

Permalink
also fix shape from bbox computation
Browse files Browse the repository at this point in the history
  • Loading branch information
mcara committed Dec 18, 2024
1 parent 9fb2953 commit 7232a45
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/stcal/alignment/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,12 @@ def _calculate_new_wcs(wcs: gwcs.wcs.WCS,
wcs_new.bounding_box = output_bounding_box

if shape is None:
shape = [int(axs[1] - axs[0] + 0.5) for axs in output_bounding_box[::-1]]
if crpix is None:
shape = [
int(axs[1] - axs[0] + 0.5) for axs in output_bounding_box[::-1]
]
else:
shape = [int(axs[1] + 1.5) for axs in output_bounding_box[::-1]]

Check warning on line 340 in src/stcal/alignment/util.py

View check run for this annotation

Codecov / codecov/patch

src/stcal/alignment/util.py#L340

Added line #L340 was not covered by tests

wcs_new.pixel_shape = shape[::-1]
wcs_new.array_shape = shape
Expand Down

0 comments on commit 7232a45

Please sign in to comment.