From d1bc4cb50e6f0aa7eb3ffed8a4ed0f0d81656987 Mon Sep 17 00:00:00 2001 From: Sam Van Kooten Date: Tue, 26 Nov 2024 17:01:51 -0600 Subject: [PATCH] Fully implement previous change to bounding boxes --- punchbowl/level2/resample.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/punchbowl/level2/resample.py b/punchbowl/level2/resample.py index 176ac5f6..f5491998 100644 --- a/punchbowl/level2/resample.py +++ b/punchbowl/level2/resample.py @@ -55,8 +55,14 @@ def reproject_cube(input_cube: NDCube, output_wcs: WCS, output_shape: tuple[int, # To start, here we make a grid of points along the edges of the input image. xs = np.linspace(-1, input_cube.data.shape[-1], 60) ys = np.linspace(-1, input_cube.data.shape[-2], 60) - edgex = np.concatenate((xs, np.full(len(ys), xs[-1]), xs, np.zeros(len(ys)))) - edgey = np.concatenate((np.zeros(len(xs)), ys, np.full(len(xs), ys[-1]), ys)) + edgex = np.concatenate((xs, # bottom edge + np.full(len(ys), xs[-1]), # right edge + xs, # top edge + np.full(len(ys), xs[0]))) # left edge + edgey = np.concatenate((np.full(len(xs),ys[0]), # bottom edge + ys, # right edge + np.full(len(xs), ys[-1]), # top edge + ys)) # left edge # Now we transform them to the output frame xs, ys = astropy.wcs.utils.pixel_to_pixel(celestial_source, celestial_target, edgex, edgey)