diff --git a/changes/1583.associations.rst b/changes/1583.associations.rst index 75857a69c..f84abcae2 100644 --- a/changes/1583.associations.rst +++ b/changes/1583.associations.rst @@ -1,2 +1,2 @@ This adds additional info to the asn header keyword skycell_wcs_info and updates the mosaic pipeline to use -that information to construct the skycell data from the input exposures. +that information to construct the skycell data from the input exposures. diff --git a/docs/roman/pipeline/mosaic_pipeline.rst b/docs/roman/pipeline/mosaic_pipeline.rst index 752e46bf9..66e9b7a21 100644 --- a/docs/roman/pipeline/mosaic_pipeline.rst +++ b/docs/roman/pipeline/mosaic_pipeline.rst @@ -87,7 +87,7 @@ The projection of the single WFI exposure resampled to a skycell is shown in :nu The image has the portion of the four SCAs that overlap the given skycell resampled to a regular grid on the WCS of the skycell. The gaps between the images show the placement of the SCAs in the detector. In general -these gaps will be filled in by additional exposures in the visit. +these gaps will be filled in by additional exposures in the visit. If the target field does not contain a valid skycell name then the image or images will be resampled to a regular grid. To resample a @@ -102,16 +102,16 @@ member. :align: left An SCA resampled to a regular grid. - + - .. figure:: graphics/mosaic4_regular_grid.png :name: figure-mosaic4-regular-grid :scale: 25 % Four SCAs resampled to a regular grid. -.. labels in list-tables do no appear to be used outside the list-table structure, hard codeing for now. +.. labels in list-tables do no appear to be used outside the list-table structure, hard codeing for now. .. :numref:`figure-mosaic-regular-grid` and :numref:`figure-mosaic4-regular-grid` show - + Figures 2 & 3 show the results of the mosaic pipeline on a single SCA and on four SCA's in the WFI array. Using the code to mosaic large areas of the sky may result on the code needing large amounts of memory, so care is needed not to exceed your local memory limits when constructing mosaics in this manner. diff --git a/romancal/associations/skycell_asn.py b/romancal/associations/skycell_asn.py index cd0dbe813..671af18f2 100644 --- a/romancal/associations/skycell_asn.py +++ b/romancal/associations/skycell_asn.py @@ -63,10 +63,16 @@ def skycell_asn(filelist, output_file_root, product_type, release_product): # grab all the wcs parameters needed for generate_tan_wcs projcell_info = dict( [ - ("name", pm.PATCH_TABLE[item]["name"]), + ("name", pm.PATCH_TABLE[item]["name"]), ("pixel_scale", float(pm.PATCH_TABLE[item]["pixel_scale"])), - ("ra_projection_center", float(pm.PATCH_TABLE[item]["ra_projection_center"])), - ("dec_projection_center", float(pm.PATCH_TABLE[item]["dec_projection_center"])), + ( + "ra_projection_center", + float(pm.PATCH_TABLE[item]["ra_projection_center"]), + ), + ( + "dec_projection_center", + float(pm.PATCH_TABLE[item]["dec_projection_center"]), + ), ("x0_projection", float(pm.PATCH_TABLE[item]["x0_projection"])), ("y0_projection", float(pm.PATCH_TABLE[item]["y0_projection"])), ("ra_center", float(pm.PATCH_TABLE[item]["ra_center"])), diff --git a/romancal/pipeline/mosaic_pipeline.py b/romancal/pipeline/mosaic_pipeline.py index 24e89f08f..e507046e2 100644 --- a/romancal/pipeline/mosaic_pipeline.py +++ b/romancal/pipeline/mosaic_pipeline.py @@ -1,11 +1,11 @@ #!/usr/bin/env python from __future__ import annotations +import json import logging import re from os.path import basename, isfile from typing import TYPE_CHECKING -import json import asdf import numpy as np @@ -103,8 +103,10 @@ def process(self, input): if patch_match.PATCH_TABLE is None: raise RuntimeError("No patch table has been loaded") skycell_record = patch_match.PATCH_TABLE[ - np.where(patch_match.PATCH_TABLE["name"][:] == skycell_name)[0][0] + np.where(patch_match.PATCH_TABLE["name"][:] == skycell_name)[0][ + 0 ] + ] log.info("Skycell record %s:", skycell_record) if skycell_name in skycell_record["name"]: