Skip to content

Commit

Permalink
Merge branch 'master' into release/1.12.x
Browse files Browse the repository at this point in the history
  • Loading branch information
zacharyburnett committed Oct 3, 2023
2 parents 8778cac + f4a20f8 commit f43b519
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 15 deletions.
13 changes: 11 additions & 2 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
1.12.3 (unreleased)
===================

-
documentation
-------------

- Updated the ``calwebb_spec2`` pipeline docs to indicate that the ``pixel_replace`` step is
applied to NIRSpec IFU data, and made minor wording updates to the ``pixel_replace`` step
docs. [#7990]

- Updated the ``FilterOffset`` reference file docs to indicate that this reference file
type is also used for NIRISS and increase clarity on how the offsets are applied. [#7991]


1.12.2 (2023-10-02)
===================
Expand Down Expand Up @@ -166,7 +175,7 @@ datamodels
- updated ``stdatamodels`` pin to ``>=1.8.0`` [#7854]

documentation
------------
-------------

- Fixed a reference to the ``ramp_fitting` module in the user documentation. [#7898]
Expand Down
2 changes: 1 addition & 1 deletion JenkinsfileRT
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ bc0.conda_ver = '22.11.1'
bc0.conda_packages = [
"python=${python_version}",
]
bc0.pip_reqs_files = ['requirements-sdp.txt', 'requirements-max.txt', 'requirements-dev-st.txt']
bc0.pip_reqs_files = ['requirements-dev-st.txt', 'requirements-max.txt', 'requirements-sdp.txt']
bc0.build_cmds = [
"pip install certifi -U --force-reinstall",
"pip install -e .[test,sdp] --no-cache-dir",
Expand Down
5 changes: 3 additions & 2 deletions docs/jwst/pipeline/calwebb_spec2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ TSO exposures. The instrument mode abbreviations used in the table are as follow
+----------------------------------------------------------+-----+-----+-----+-----+-----+-----+-----------------+------+--------+-----+
| :ref:`residual_fringe <residual_fringe_step>` \ :sup:`2` | | | | | | |c| | | | | |
+----------------------------------------------------------+-----+-----+-----+-----+-----+-----+-----------------+------+--------+-----+
| :ref:`pixel_replace <pixel_replace_step>` \ :sup:`2` | |c| | |c| | | |c| | |c| | | | |c| | |c| | |
| :ref:`pixel_replace <pixel_replace_step>` \ :sup:`2` | |c| | |c| | |c| | |c| | |c| | | | |c| | |c| | |
+----------------------------------------------------------+-----+-----+-----+-----+-----+-----+-----------------+------+--------+-----+
| :ref:`resample_spec <resample_step>` | |c| | |c| | | |c| | | | | | | |
+----------------------------------------------------------+-----+-----+-----+-----+-----+-----+-----------------+------+--------+-----+
Expand All @@ -92,7 +92,8 @@ For NIRISS and NIRCam WFSS, as well as NIRCam TSO grism exposures, the order is
flat_field, extract_2d, and srctype (no wavecorr).
For all other modes the order is extract_2d, srctype, wavecorr, and flat_field.

:sup:`2`\ By default this step is skipped in the ``calwebb_spec2`` pipeline.
:sup:`2`\ By default this step is skipped in the ``calwebb_spec2`` pipeline, but
is enabled for some modes via overrides provided in parameter reference files.

:sup:`3`\ NIRISS SOSS can have multiple spectral orders contribute flux to one pixel; because
photometric correction values depend on the spectral order assigned to a pixel, the order of
Expand Down
20 changes: 12 additions & 8 deletions docs/jwst/pixel_replace/main.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,19 @@ Description
:Classes: `jwst.pixel_replace.PixelReplaceStep`
:Alias: pixel_replace

During spectral extraction, pixels flagged as bad are ignored in the summation process.
During 1-D spectral extraction (:ref:`extract_1d <extract_1d_step>` step),
pixels flagged as bad are ignored in the summation process.
If a bad pixel is part of the point-spread function (PSF) at a given wavelength, the
absence of the signal in the flagged pixel will lead to a divot at that wavelength in
absence of the signal in the flagged pixel will lead to a hollow space at that wavelength in
the extracted spectrum.

To avoid this defect in the 1-D spectrum, this step estimates the flux values of pixels
flagged as ``DO_NOT_USE`` in 2-D extracted spectra, prior to rectification in the
``resample_spec`` step. ``pixel_replace`` inserts these estimates into the data array,
unsets the ``DO_NOT_USE`` flag and sets the ``FLUX_ESTIMATED`` flag for each pixel affected.
flagged as ``DO_NOT_USE`` in 2-D extracted spectra using interpolation methods,
prior to rectification in the :ref:`resample_spec <resample_step>` step.
``pixel_replace`` inserts these estimates into the 2-D data array,
unsets the ``DO_NOT_USE`` flag, and sets the ``FLUX_ESTIMATED`` flag for each affected pixel.

This step is provided as a cosmetic feature and, for that reason, should be used with caution.

Algorithms
==========
Expand All @@ -22,11 +26,11 @@ Adjacent Profile Approximation

This is the default (and most extensively tested) algorithm for most spectroscopic modes.

First, the input 2-d spectral cutout is scanned across the dispersion axis to determine
First, the input 2-D spectral cutout is scanned across the dispersion axis to determine
which cross-dispersion vectors (column or row, depending on dispersion direction) contain
at least one flagged pixel. Next, for each affected vector, a median normalized profile is created.

First, the adjacent arrays (the number of which is set by the step argument
The adjacent arrays (the number of which is set by the step argument
``n_adjacent_cols``) are individually normalized. Next, each pixel in the profile is set to
the median of the normalized values. This results in a median of normalized values filling the vector.

Expand All @@ -36,7 +40,7 @@ estimated from the scaled profile.
Minimum Gradient Estimator
--------------------------

In the case of the MIRI MRS, NaN-valued pixels are partially compensated during the cube building process
In the case of the MIRI MRS, NaN-valued pixels are partially compensated during the IFU cube building process
using the overlap between detector pixels and output cube voxels. The effects of NaN values are thus not
as severe as for slit spectra, but can manifest as small dips in the extracted spectrum when a NaN value
lands atop the peak of a spectral trace and cube building interpolates from lower-flux adjacent values.
Expand Down
9 changes: 7 additions & 2 deletions docs/jwst/references_general/filteroffset_reffile.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Instrument Keywords
========== ================================================
MIRI INSTRUME, DETECTOR, EXP_TYPE, DATE-OBS, TIME-OBS
NIRCam INSTRUME, CHANNEL, MODULE, DATE-OBS, TIME-OBS
NIRISS INSTRUME, EXP_TYPE, DATE-OBS, TIME-OBS
========== ================================================

.. include:: ../includes/standard_keywords.inc
Expand All @@ -30,8 +31,12 @@ The filteroffset reference file is an ASDF file that contains a list
called ``filters``. Every item in the list contains one or more entries that
are used as selectors, as well as the column and row offset values to be applied.
For the MIRI instrument, there is one selector "filter", which is the name of
the filter to which the offsets apply. For NIRCam, the selectors are "filter" and
"pupil". The offsets, in pixels, are applied in the image science frame.
the filter to which the offsets apply. For NIRCam and NIRISS, the selectors are "filter" and
"pupil".

The offsets, in units of pixels, are *added* to positions in images that use
the reference filter/pupil, in order to align images to the reference filter/pupil
frame.

:filters:
:filter: Filter name
Expand Down

0 comments on commit f43b519

Please sign in to comment.