From 2d5e30499ef2f95225671bd483bc3ef7852d9c2f Mon Sep 17 00:00:00 2001 From: Eddie Schlafly Date: Mon, 8 Jul 2024 12:31:33 -0400 Subject: [PATCH 1/3] Fix issue in constructing skycell WCS. --- romancal/pipeline/mosaic_pipeline.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/romancal/pipeline/mosaic_pipeline.py b/romancal/pipeline/mosaic_pipeline.py index 93b71923e..091501ac9 100644 --- a/romancal/pipeline/mosaic_pipeline.py +++ b/romancal/pipeline/mosaic_pipeline.py @@ -148,19 +148,19 @@ def process(self, input): return result -def generate_tan_wcs(skycell_record, shiftx=0, shifty=0): +def generate_tan_wcs(skycell_record): # extract the wcs info from the record for generate_tan_wcs # we need the scale, ra, dec, bounding_box scale = float(skycell_record["pixel_scale"]) - ra_center = float(skycell_record["ra_center"]) - dec_center = float(skycell_record["dec_center"]) + ra_center = float(skycell_record["ra_projection_center"]) + dec_center = float(skycell_record["dec_projection_center"]) + shiftx = float(skycell_record["x0_projection"]) + shifty = float(skycell_record["y0_projection"]) bounding_box = ( - (-0.5, float(skycell_record["x_center"]) + 0.5), - (-0.5, float(skycell_record["y_center"]) + 0.5), + (-0.5, -0.5 + skycell_record['nx']), + (-0.5, -0.5 + skycell_record['ny']), ) - shiftx = bounding_box[0][1] - shifty = bounding_box[1][1] # components of the model # shift = models.Shift(shiftx) & models.Shift(shifty) From 4af7193c15c1b4524a0ea8e9f56c8794c3a59ebe Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 8 Jul 2024 17:00:20 +0000 Subject: [PATCH 2/3] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- romancal/pipeline/mosaic_pipeline.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/romancal/pipeline/mosaic_pipeline.py b/romancal/pipeline/mosaic_pipeline.py index 091501ac9..ebd55114d 100644 --- a/romancal/pipeline/mosaic_pipeline.py +++ b/romancal/pipeline/mosaic_pipeline.py @@ -158,8 +158,8 @@ def generate_tan_wcs(skycell_record): shiftx = float(skycell_record["x0_projection"]) shifty = float(skycell_record["y0_projection"]) bounding_box = ( - (-0.5, -0.5 + skycell_record['nx']), - (-0.5, -0.5 + skycell_record['ny']), + (-0.5, -0.5 + skycell_record["nx"]), + (-0.5, -0.5 + skycell_record["ny"]), ) # components of the model From 840ff03612463b29314ae0c72b063bd5e1221502 Mon Sep 17 00:00:00 2001 From: Eddie Schlafly Date: Mon, 8 Jul 2024 13:13:57 -0400 Subject: [PATCH 3/3] Add changelog entry. --- CHANGES.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGES.rst b/CHANGES.rst index c20f01241..db25bb662 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -38,6 +38,12 @@ stpipe - Add ``ModelContainer`` support to ``Step._datamodels_open`` to allow loading "pars-*" files from CRDS. [#1270] +mosaic_pipeline +--------------- + +- Fix construction of skycell WCS. [#1297] + + 0.15.1 (2024-05-15) ===================