Skip to content

Commit

Permalink
Merge branch 'main' into rcal-930-l3wcs
Browse files Browse the repository at this point in the history
  • Loading branch information
stscieisenhamer authored Jan 27, 2025
2 parents f9d8bea + cb24749 commit 6ebb223
Show file tree
Hide file tree
Showing 14 changed files with 17 additions and 71 deletions.
1 change: 0 additions & 1 deletion 1542.mosaic_pipeline.rst

This file was deleted.

1 change: 1 addition & 0 deletions changes/1593.exposure_pipeline.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix description of arguments in docs and add description of fully saturated input processing.
1 change: 1 addition & 0 deletions changes/1593.resample.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Remove unused arguments from step specification.
1 change: 1 addition & 0 deletions changes/1593.saturation.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add saturation step docs to package index.
1 change: 1 addition & 0 deletions docs/roman/package_index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
references_general/index.rst
refpix/index.rst
resample/index.rst
saturation/index.rst
skymatch/index.rst
source_catalog/index.rst
stpipe/index.rst
Expand Down
23 changes: 11 additions & 12 deletions docs/roman/pipeline/exposure_pipeline.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,7 @@ table below.

Arguments
---------
The ``exposure`` pipeline has an optional argument::

--use_ramp_jump_detection boolean default=True

When set to ``True``, the pipeline will perform jump detection as a part of the ramp
fitting step. The data at this stage of the pipeline are still in the form of the original
3D ramps ( ngroups x ncols x nrows ) and have had all of the detector-level
correction steps applied to it, up to but not including the detection and flagging of
Cosmic-Ray (CR) hits within each ramp (integration). For this case the jump detection
module in :ref:`ramp_fitting <ramp_fitting_step>` will update the dq array with the CR hits (jumps) that
are identified in the step.

The ``exposure`` pipeline has no arguments

Inputs
------
Expand Down Expand Up @@ -78,6 +67,16 @@ extensions. When such a file is loaded into the pipeline, it is immediately
converted into a `~romancal.datamodels.RampModel`, and has all additional data arrays
for errors and Data Quality flags created and initialized.

When the ``ExposurePipeline`` processes a fully saturated input (all pixels flagged as saturated).
The corresponding output image will:

- contain all 0 data arrays
- contain all 0 variance arrays
- not be processed by steps beyond saturation

A single fully saturated input will also cause :ref:`tweakreg <tweakreg_step>` to be skipped
for all input images.

Outputs
-------

Expand Down
4 changes: 2 additions & 2 deletions docs/roman/references_general/references_general.rst
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@ documentation on each reference file.
+---------------------------------------------+--------------------------------------------------+
| :ref:`flatfield <flatfield_step>` | :ref:`FLAT <flat_reffile>` |
+---------------------------------------------+--------------------------------------------------+
| :ref:`GAIN <gain_reffile>` | :ref:`ramp_fitting <ramp_fitting_step>` |
+---------------------------------------------+--------------------------------------------------+
| :ref:`linearity <linearity_step>` | :ref:`LINEARITY <linearity_reffile>` |
+---------------------------------------------+--------------------------------------------------+
| :ref:`photom <photom_step>` | :ref:`PHOTOM <photom_reffile>` |
Expand All @@ -74,6 +72,8 @@ documentation on each reference file.
+--------------------------------------------------+---------------------------------------------+
| :ref:`FLAT <flat_reffile>` | :ref:`flatfield <flatfield_step>` |
+--------------------------------------------------+---------------------------------------------+
| :ref:`GAIN <gain_reffile>` | :ref:`ramp_fitting <ramp_fitting_step>` |
+--------------------------------------------------+---------------------------------------------+
| :ref:`LINEARITY <linearity_reffile>` | :ref:`linearity <linearity_step>` |
+--------------------------------------------------+---------------------------------------------+
| :ref:`MASK <mask_reffile>` | :ref:`dq_init <dq_init_step>` |
Expand Down
18 changes: 0 additions & 18 deletions docs/roman/resample/arguments.rst
Original file line number Diff line number Diff line change
Expand Up @@ -82,24 +82,6 @@ image.
If `weight_type=exptime`, the scaling value will be set equal to the
exposure time found in the image header.

``--single`` (bool, default=False)
If set to `True`, resample each input image into a separate output. If
`False` (the default), each input is resampled additively (with weights) to
a common output

``--blendheaders`` (bool, default=True)
Blend metadata from all input images into the resampled output image.

``--allowed_memory`` (float, default=None)
Specifies the fractional amount of free memory to allow when creating the
resampled image. If ``None``, the environment variable
``DMODEL_ALLOWED_MEMORY`` is used. If not defined, no check is made. If the
resampled image would be larger than specified, an ``OutputTooLargeError``
exception will be generated.

For example, if set to ``0.5``, only resampled images that use less than
half the available memory can be created.

``--in_memory`` (bool, default=True)
If set to `False`, write output datamodel to disk.

Expand Down
1 change: 0 additions & 1 deletion docs/roman/stpipe/config_asdf.rst
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ entries for clarity:
output_use_model: false
post_hooks: []
pre_hooks: []
save_calibrated_ramp: false
save_results: true
search_output_file: true
skip: false
Expand Down
1 change: 0 additions & 1 deletion docs/roman/stpipe/user_pipeline.rst
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ class:
output_use_model: false
post_hooks: []
pre_hooks: []
save_calibrated_ramp: false
save_results: true
search_output_file: true
skip: false
Expand Down
1 change: 0 additions & 1 deletion romancal/pipeline/exposure_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ class ExposurePipeline(RomanPipeline):
class_alias = "roman_elp"

spec = """
save_calibrated_ramp = boolean(default=False)
save_results = boolean(default=False)
suffix = string(default="cal")
"""
Expand Down
22 changes: 0 additions & 22 deletions romancal/resample/resample.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ def __init__(
input_models,
output=None,
single=False,
blendheaders=True,
pixfrac=1.0,
kernel="square",
fillval="INDEF",
Expand Down Expand Up @@ -90,7 +89,6 @@ def __init__(
self.output_filename = output
self.pscale_ratio = pscale_ratio
self.single = single
self.blendheaders = blendheaders
self.pixfrac = pixfrac
self.kernel = kernel
self.fillval = fillval
Expand Down Expand Up @@ -143,23 +141,6 @@ def __init__(

log.debug(f"Output mosaic size: {self.output_wcs.array_shape}")

# NOTE: should we enable memory allocation?

# can_allocate, required_memory = datamodels.util.check_memory_allocation(
# self.output_wcs.array_shape,
# kwargs['allowed_memory'],
# datamodels.ImageModel
# )
# if not can_allocate:
# raise OutputTooLargeError(
# f'Combined ImageModel size {self.output_wcs.array_shape} '
# f'requires {bytes2human(required_memory)}. '
# f'Model cannot be instantiated.'
# )

# NOTE: wait for William to fix bug in datamodels' init and then
# use datamodels.ImageModel(shape=(nx, ny)) instead of mk_datamodel()

# n_images sets the number of context image planes.
# This should be 1 to start (not the default of 2).
self.blank_output = maker_utils.mk_datamodel(
Expand Down Expand Up @@ -341,9 +322,6 @@ def resample_many_to_one(self):
) is not None:
output_model.meta.asn.table_name = asn_table_name

if self.blendheaders:
log.info("Skipping blendheaders for now.")

# Initialize the output with the wcs
driz = gwcs_drizzle.GWCSDrizzle(
output_model,
Expand Down
5 changes: 0 additions & 5 deletions romancal/resample/resample_step.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,6 @@ class ResampleStep(RomanStep):
pixel_scale_ratio = float(default=1.0) # Ratio of input to output pixel scale
pixel_scale = float(default=None) # Absolute pixel scale in arcsec
output_wcs = string(default='') # Custom output WCS.
single = boolean(default=False)
blendheaders = boolean(default=True)
allowed_memory = float(default=None) # Fraction of memory to use for the combined image.
in_memory = boolean(default=True)
good_bits = string(default='~DO_NOT_USE+NON_SCIENCE') # The good bits to use for building the resampling mask.
"""
Expand All @@ -80,7 +77,6 @@ def process(self, input):
input_models = ModelLibrary([input])
# set output filename from meta.filename found in the first datamodel
output = input.meta.filename
self.blendheaders = False
elif isinstance(input, str):
# either a single asdf filename or an association filename
try:
Expand Down Expand Up @@ -118,7 +114,6 @@ def process(self, input):
self.wht_type = self.weight_type
self.log.info("Setting drizzle's default parameters...")
kwargs = self.set_drizzle_defaults()
kwargs["allowed_memory"] = self.allowed_memory

# Issue a warning about the use of exptime weighting
if self.wht_type == "exptime":
Expand Down
8 changes: 0 additions & 8 deletions romancal/resample/tests/test_resample.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,8 +290,6 @@ def test_resampledata_init(exposure_1):
"""Test that ResampleData can set initial values."""
input_models = ModelLibrary(exposure_1)
output = "output.asdf"
single = False
blendheaders = False
pixfrac = 0.8
kernel = "turbo"
fillval = 0.0
Expand All @@ -304,8 +302,6 @@ def test_resampledata_init(exposure_1):
resample_data = ResampleData(
input_models,
output=output,
single=single,
blendheaders=blendheaders,
pixfrac=pixfrac,
kernel=kernel,
fillval=fillval,
Expand All @@ -320,8 +316,6 @@ def test_resampledata_init(exposure_1):
assert resample_data.input_models == input_models
assert resample_data.output_filename == output
assert resample_data.pscale_ratio == pscale_ratio
assert resample_data.single == single
assert resample_data.blendheaders == blendheaders
assert resample_data.pixfrac == pixfrac
assert resample_data.kernel == kernel
assert resample_data.fillval == fillval
Expand All @@ -341,8 +335,6 @@ def test_resampledata_init_default(exposure_1):
assert resample_data.input_models == input_models
assert resample_data.output_filename is None
assert resample_data.pscale_ratio == 1.0
assert not resample_data.single
assert resample_data.blendheaders
assert resample_data.pixfrac == 1.0
assert resample_data.kernel == "square"
assert resample_data.fillval == "INDEF"
Expand Down

0 comments on commit 6ebb223

Please sign in to comment.