Skip to content

Commit

Permalink
Merge branch 'main' into tweakreg-use-psf-astrometry
Browse files Browse the repository at this point in the history
  • Loading branch information
schlafly authored Jan 24, 2025
2 parents f36a1dd + 458cd35 commit 311e356
Show file tree
Hide file tree
Showing 24 changed files with 181 additions and 350 deletions.
10 changes: 9 additions & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# automatically requests pull request reviews for files matching the given pattern; the last match takes precendence

* @spacetelescope/romancal-maintainers
# maintainers own everything
* @spacetelescope/romancal-maintainers

# developers can own some specific paths
/.github/ @spacetelescope/romancal-developers # CI files
/* @spacetelescope/romancal-developers # top level files only
/changes/** @spacetelescope/romancal-developers # changelogs
/docs/** @spacetelescope/romancal-developers # docs
/romancal/regtest/** @spacetelescope/romancal-developers # regtest code
8 changes: 0 additions & 8 deletions CODEOWNERS.txt

This file was deleted.

125 changes: 0 additions & 125 deletions JenkinsfileRT

This file was deleted.

117 changes: 0 additions & 117 deletions JenkinsfileRT_dev

This file was deleted.

1 change: 1 addition & 0 deletions changes/1474.general.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Remove units from reference file datamodels.
2 changes: 2 additions & 0 deletions changes/1583.associations.rst
Original file line number Diff line number Diff line change
@@ -0,0 +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.
2 changes: 2 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,8 @@ def check_sphinx_version(expected_version):
"-Gfontname=Helvetica Neue, Helvetica, Arial, sans-serif",
]

# activate figure numbering
numfig = True
# If true, '()' will be appended to :func: etc. cross-reference text.
# add_function_parentheses = True

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
57 changes: 57 additions & 0 deletions docs/roman/pipeline/mosaic_pipeline.rst
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,63 @@ calibrated data for the the exposures. The most convenient way to pass the list
exposures to be processed with the mosaic level pipeline is to use an association.
Instructions on how to create an input association an be found at :ref:`asn-from-list`.

The mosaic pipeline can create different types of products. In one
mode you give it a list of calibrated images and the pipeline will run
the above steps and the final product is a mosaic of the input images
resampled to a regular grid. The mode is selected based on the target
field in the association header. If the input association contains a
target field which matches a skycell name (see TBD) then the mosaic
pipeline will resample the final product onto the skycell grid.

If the association has been generated with :ref:`skycell_asn` the
skycell name and projection coordinates should be available in the
association header. If the skycell name is available and corresponds
to a valid name in the database and the projection cell coordinates
are not available in the association header then the pipeline will
read the needed information from the data file containing the skycell
information.

.. _figure-skycell-mosaic:

.. figure:: graphics/wfi_4sca_skycell.png
:scale: 60 %

Image showing the four SCA's that overlap a given skycell.


The projection of the single WFI exposure resampled to a skycell is shown in :numref:`figure-skycell-mosaic`.
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.

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
single image the input will need to be an association with a single
member.

.. list-table::

* - .. figure:: graphics/mosaic_regular_grid.png
:name: figure-mosaic-regular-grid
:scale: 25 %
: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.
.. :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.


Outputs
----------
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ dependencies = [
"photutils >=1.13.0",
"pyparsing >=2.4.7",
"requests >=2.26",
# "roman_datamodels>=0.22.0,<0.23.0",
"roman_datamodels @ git+https://github.com/spacetelescope/roman_datamodels.git",
"roman_datamodels>=0.23.0,<0.24.0",
#"roman_datamodels @ git+https://github.com/spacetelescope/roman_datamodels.git",
"scipy >=1.14.1",
# "stcal>=1.10.0,<1.11.0",
"stcal @ git+https://github.com/spacetelescope/stcal.git@main",
Expand Down
19 changes: 14 additions & 5 deletions romancal/associations/skycell_asn.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,23 @@ 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"]),
("pixel_scale", float(pm.PATCH_TABLE[item]["pixel_scale"])),
("ra_cent", float(pm.PATCH_TABLE[item]["ra_projection_center"])),
("dec_cent", float(pm.PATCH_TABLE[item]["dec_projection_center"])),
("shiftx", float(pm.PATCH_TABLE[item]["x0_projection"])),
("shifty", float(pm.PATCH_TABLE[item]["y0_projection"])),
(
"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"])),
("dec_center", float(pm.PATCH_TABLE[item]["dec_center"])),
("nx", int(pm.PATCH_TABLE[item]["nx"])),
("ny", int(pm.PATCH_TABLE[item]["ny"])),
("orient", float(pm.PATCH_TABLE[item]["orientat"])),
("orientat", float(pm.PATCH_TABLE[item]["orientat"])),
(
"orientat_projection_center",
float(pm.PATCH_TABLE[item]["orientat_projection_center"]),
Expand Down
2 changes: 1 addition & 1 deletion romancal/dark_current/dark_current_step.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def process(self, input):
# Do the dark correction
out_model = input_model
nresultants = len(input_model.meta.exposure["read_pattern"])
out_model.data -= dark_model.data[:nresultants].value
out_model.data -= dark_model.data[:nresultants]
out_model.pixeldq |= dark_model.dq
out_model.meta.cal_step.dark = "COMPLETE"

Expand Down
Loading

0 comments on commit 311e356

Please sign in to comment.