Skip to content

Commit

Permalink
Merge branch 'main' into rcal-954_dsd
Browse files Browse the repository at this point in the history
  • Loading branch information
ddavis-stsci authored Dec 4, 2024
2 parents 0c007d6 + 573d961 commit 6a355b5
Show file tree
Hide file tree
Showing 37 changed files with 206 additions and 659 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/tests_devdeps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,6 @@ jobs:
cache-key: data-${{ needs.webbpsf_data_cache.outputs.cache_key }}-${{ needs.crds_context.outputs.context }}
cache-restore-keys: ${{ needs.webbpsf_data_cache.outputs.cache_key }}
envs: |
- linux: py310-stdevdeps-webbpsf
- linux: py310-devdeps-webbpsf
- macos: py310-stdevdeps-webbpsf
- macos: py310-devdeps-webbpsf
- linux: py311-stdevdeps-webbpsf
- linux: py311-devdeps-webbpsf
- macos: py311-stdevdeps-webbpsf
Expand Down
1 change: 1 addition & 0 deletions changes/1354.assign_wcs.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Apply velocity aberration correction to the WFI WCS
1 change: 1 addition & 0 deletions changes/1533.source_catalog.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Use meta.source_catalog and meta.cal_step.source_catalog in source_catalog step.
1 change: 1 addition & 0 deletions changes/1533.source_detection.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Remove SourceDetectionStep (use SourceCatalogStep).
10 changes: 10 additions & 0 deletions docs/roman/assign_wcs/main.rst
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,16 @@ coordinate system using a package called `PySIAF <https://github.com/spacetelesc
>>> ap = siaf['WFI01_FULL']
>>> V2_REF, V3_REF = ap.get_reference_point('tel')

Corrections Due to Spacecraft Motion
------------------------------------

The WCS transforms contain two corrections due to motion of the observatory.

Absolute velocity aberration is calculated onboard when acquiring the guide star, but
differential velocity aberration effects are calculated during the ``assign_wcs`` step.
This introduces corrections in the conversion from sky coordinates to observatory
V2/V3 coordinates, and is stored in the WCS under the ``v2v3vacorr`` frame.


.. rubric:: Footnotes

Expand Down
6 changes: 3 additions & 3 deletions docs/roman/associations/skycell_asn.rst
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,15 @@ contribute data to. The association files will be json files with names based

.. code-block:: text
r0099101001001003001_<skycell name>_<product_type>_<filter>_<release product name>_i2d_asn.json
r0099101001001003001_<skycell name>_<product_type>_<filter>_<release product name>_coadd_asn.json
or for the selections above

.. code-block:: text
r0099101001001003001_r257dp63x98y83_visit_F158_prompt_i2d_asn.json
r0099101001001003001_r257dp63x98y83_visit_F158_prompt_coadd_asn.json
where the skycell name can vary based on the location on the celestial sphere and the i2d indicates
where the skycell name can vary based on the location on the celestial sphere and the coadd indicates
that this is resampled 2-d imaging data. The release product name can be changed from the default
by adding the optional argument --release-product <new name> to the command line.

Expand Down
4 changes: 2 additions & 2 deletions docs/roman/data_products/product_types.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Exposure Level Data Products
+==================================================================+========================+==========================+======+=======================+=======================================+
| :ref:`romancal.pipeline.ExposurePipeline <exposure_pipeline>` | uncal | cal | Exp | DN/s | 2-D calibrated data |
+------------------------------------------------------------------+------------------------+--------------------------+------+-----------------------+---------------------------------------+
| :ref:`romancal.pipeline.MosaicPipeline <mosaic_pipeline>` | cal | i2d | Exp | DN/s | 2-D calibrated data |
| :ref:`romancal.pipeline.MosaicPipeline <mosaic_pipeline>` | cal | coadd | Exp | DN/s | 2-D calibrated data |
+------------------------------------------------------------------+------------------------+--------------------------+------+-----------------------+---------------------------------------+


Expand Down Expand Up @@ -81,5 +81,5 @@ the user is running the pipeline. The input for each optional step is the output
+---------------------------------------------------+-----------------+------------------------------+------------------+---------------------+---------------------------------------+
| :ref:`resample <resample_step>` | | resamplestep (opt) | ModelLibrary | MJy/sr | A list of _cal files |
+---------------------------------------------------+-----------------+------------------------------+------------------+---------------------+---------------------------------------+
| | | i2d | MosaicModel | MJy/sr | A 2D resampled image |
| | | coadd | MosaicModel | MJy/sr | A 2D resampled image |
+---------------------------------------------------+-----------------+------------------------------+------------------+---------------------+---------------------------------------+
8 changes: 4 additions & 4 deletions docs/roman/data_products/science_products.rst
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,12 @@ The calibrated products are the result of an average over all integrations (``ca
- border_ref_pix_bottom: Copy of original border reference pixels, on the bottom (from viewers perspective).


Resampled 2-D data: ``i2d``
^^^^^^^^^^^^^^^^^^^^^^^^^^^
Resampled 2-D data: ``coadd``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Images and spectra that have been resampled by the :ref:`resample <resample_step>` step use a
different set of data arrays than other science products. Resampled 2-D images are stored in
``i2d`` products.
The ASDF structure for ``i2d`` products is as follows:
``coadd`` products.
The ASDF structure for ``coadd`` products is as follows:

+----------------------+----------+------------+---------------------------+-------------------------------+
| data array | | Data Type | Units | Dimensions |
Expand Down
2 changes: 1 addition & 1 deletion docs/roman/outlier_detection/outlier_detection.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Specifically, this routine performs the following operations:
should be used when resampling to create the output mosaic. Any pixel with a
DQ value not included in this value (or list of values) will be ignored when
resampling.
* Resampled images will be written out to disk with suffix `_outlier_i2d` by default.
* Resampled images will be written out to disk with suffix `_outlier_coadd` by default.
* **If resampling is turned off** through the use of the ``resample_data`` parameter,
a copy of the unrectified input images (as a ModelLibrary)
will be used for subsequent processing.
Expand Down
1 change: 0 additions & 1 deletion docs/roman/package_index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,5 @@
resample/index.rst
skymatch/index.rst
source_catalog/index.rst
source_detection/index.rst
stpipe/index.rst
tweakreg/index.rst
4 changes: 2 additions & 2 deletions docs/roman/pipeline/mosaic_pipeline.rst
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ Outputs
The resampled data can be found in

:Data model: `~romancal.datamodels.WfiMosaic`
:File suffix: _i2d
:File suffix: _coadd

Catalog file (MosaicSourceCatalog)
+++++++++++++++++++++++++++++++++++
Expand All @@ -92,6 +92,6 @@ Result of applying all the mosaic level pipeline steps up through the
:ref:`source_catalog <source_catalog_step>` step is to produce data background corrected
and cleaned of outliers and resampled to a distortion free grid along with
the source catalog and segmentation map.
The i2d file is 2D image data, with additional attributes for the mosaicing information. The cat
The coadd file is 2D image data, with additional attributes for the mosaicing information. The cat
file is an asdf file with the detected sources and the segmenation map is an asdf file
linking the input images to the detected sources.
1 change: 0 additions & 1 deletion docs/roman/pipeline_steps.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ Pipeline Steps
flatfield/index.rst
photom/index.rst
flux/index.rst
source_detection/index.rst
tweakreg/index.rst
skymatch/index.rst
outlier_detection/index.rst
Expand Down
2 changes: 1 addition & 1 deletion docs/roman/source_catalog/main.rst
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ PSF Fitting

Star finding algorithms like `~photutils.detection.DAOStarFinder` provide
approximate stellar centroids. More precise centroids may be inferred by
fitting model PSFs to the observations. Setting the SourceDetectionStep's
fitting model PSFs to the observations. Setting the SourceCatalogStep's
option `fit_psf` to True will generate model Roman PSFs with
`WebbPSF <https://webbpsf.readthedocs.io/en/latest/roman.html>`_, and fit
those models to each of the sources detected by
Expand Down
61 changes: 0 additions & 61 deletions docs/roman/source_detection/arguments.rst

This file was deleted.

76 changes: 0 additions & 76 deletions docs/roman/source_detection/description.rst

This file was deleted.

14 changes: 0 additions & 14 deletions docs/roman/source_detection/index.rst

This file was deleted.

29 changes: 0 additions & 29 deletions docs/roman/source_detection/psf.rst

This file was deleted.

4 changes: 2 additions & 2 deletions docs/roman/tweakreg/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Description
Overview
--------
This step uses the coordinates of point-like sources from an input catalog
(i.e. the result from `SourceDetectionStep` saved in the
(i.e. the result from `SourceCatalogStep` saved in the
`meta.tweakreg_catalog` attribute) and compares them with the
coordinates from a Gaia catalog to compute corrections to
the WCS of the input images such that sky catalogs obtained from the image catalogs
Expand Down Expand Up @@ -68,7 +68,7 @@ attributes to the catalog file names provided in either in the ASN table or

Alignment
---------
The source catalog (either created by `SourceDetectionStep` or provided by the user)
The source catalog (either created by `SourceCatalogStep` or provided by the user)
gets cross-matched and fit to an astrometric reference catalog
(set by ``TweakRegStep.abs_refcat``) and the results are stored in
``model.meta.wcs_fit_results``. The pipeline initially supports fitting to any
Expand Down
16 changes: 15 additions & 1 deletion romancal/assign_wcs/assign_wcs_step.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,15 +96,29 @@ def load_wcs(input_model, reference_files=None):
axes_names=("v2", "v3"),
unit=(u.arcsec, u.arcsec),
)
v2v3vacorr = cf.Frame2D(
name="v2v3vacorr",
axes_order=(0, 1),
axes_names=("v2", "v3"),
unit=(u.arcsec, u.arcsec),
)
world = cf.CelestialFrame(reference_frame=coord.ICRS(), name="world")

# Transforms between frames
distortion = wfi_distortion(output_model, reference_files)
tel2sky = pointing.v23tosky(output_model)

# Compute differential velocity aberration (DVA) correction:
va_corr = pointing.dva_corr_model(
va_scale=input_model.meta.velocity_aberration.scale_factor,
v2_ref=input_model.meta.wcsinfo.v2_ref,
v3_ref=input_model.meta.wcsinfo.v3_ref,
)

pipeline = [
Step(detector, distortion),
Step(v2v3, tel2sky),
Step(v2v3, va_corr),
Step(v2v3vacorr, tel2sky),
Step(world, None),
]
wcs = WCS(pipeline)
Expand Down
Loading

0 comments on commit 6a355b5

Please sign in to comment.