From 7232a45ec49957dfff073f350610a969779905a8 Mon Sep 17 00:00:00 2001 From: Mihai Cara Date: Wed, 18 Dec 2024 03:41:54 -0500 Subject: [PATCH] also fix shape from bbox computation --- src/stcal/alignment/util.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/stcal/alignment/util.py b/src/stcal/alignment/util.py index 24d0c1ef9..21357c2f9 100644 --- a/src/stcal/alignment/util.py +++ b/src/stcal/alignment/util.py @@ -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]] wcs_new.pixel_shape = shape[::-1] wcs_new.array_shape = shape