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 759f04c commit 1981e8a
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 10 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
6 changes: 4 additions & 2 deletions romancal/pipeline/mosaic_pipeline.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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"]:
Expand Down

0 comments on commit 1981e8a

Please sign in to comment.