Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Jan 15, 2025
1 parent 8df70f9 commit af87194
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 11 deletions.
2 changes: 1 addition & 1 deletion changes/1583.associations.rst
Original file line number Diff line number Diff line change
@@ -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.
8 changes: 4 additions & 4 deletions docs/roman/pipeline/mosaic_pipeline.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.
Expand Down
12 changes: 9 additions & 3 deletions romancal/associations/skycell_asn.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"])),
Expand Down
8 changes: 5 additions & 3 deletions romancal/pipeline/mosaic_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,10 @@ def process(self, input):
if patch_match.PATCH_TABLE is None:
patch_match.load_patch_table()
skycell_record = patch_match.PATCH_TABLE[

Check warning on line 103 in romancal/pipeline/mosaic_pipeline.py

View check run for this annotation

Codecov / codecov/patch

romancal/pipeline/mosaic_pipeline.py#L98-L103

Added lines #L98 - L103 were not covered by tests
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"]:
Expand Down Expand Up @@ -161,8 +163,8 @@ def process(self, input):


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'''
"""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_projection_center"])
Expand Down

0 comments on commit af87194

Please sign in to comment.