Skip to content

Commit c8a9400

Browse files
authored
DOC: Complete API for linearity (spacetelescope#10439)
1 parent e4bab42 commit c8a9400

9 files changed

Lines changed: 45 additions & 31 deletions

File tree

docs/jwst/linearity/api_ref.rst

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
===
2+
API
3+
===
4+
5+
Public Step API
6+
===============
7+
8+
.. automodapi:: jwst.linearity.linearity_step
9+
:no-inheritance-diagram:
10+
11+
Complete Developer API
12+
======================
13+
14+
.. automodapi:: jwst.linearity.linearity
15+
:no-inheritance-diagram:

docs/jwst/linearity/arguments.rst

Lines changed: 0 additions & 4 deletions
This file was deleted.

docs/jwst/linearity/description.rst

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
Description
2-
============
2+
===========
33

4-
:Class: `jwst.linearity.LinearityStep`
4+
:Class: `jwst.linearity.linearity_step.LinearityStep`
55
:Alias: linearity
66

77
Assumptions
88
-----------
99
It is assumed that the input science exposure data for near-IR instruments
1010
have had the :ref:`superbias <superbias_step>` subtraction step applied,
11-
therefore the correction coefficients stored in the linearity reference files
11+
therefore the correction coefficients stored in the :ref:`linearity_reffile`
1212
for those instruments must have been derived from data that has also been
1313
bias subtracted.
1414
MIRI data, on the other hand, do not receive bias subtraction
@@ -30,8 +30,8 @@ for detector non-linearity. The correction is applied pixel-by-pixel,
3030
group-by-group, integration-by-integration within a science exposure.
3131

3232
The correction is represented by an nth-order polynomial for
33-
each pixel in the detector, with n+1 arrays of coefficients read from the
34-
linearity reference file.
33+
each pixel in the detector, with ``n+1`` arrays of coefficients read from the
34+
:ref:`linearity_reffile`.
3535

3636
The algorithm for correcting the observed pixel value in each group of an
3737
integration is currently of the form:
@@ -42,7 +42,7 @@ integration is currently of the form:
4242
where :math:`F` is the observed counts (in DN), :math:`c_n` are the polynomial
4343
coefficients, and :math:`F_\text{c}` is the corrected counts. There is no
4444
limit to the order of the polynomial correction; all coefficients contained in
45-
the reference file will be applied.
45+
the :ref:`linearity_reffile` will be applied.
4646

4747
Upon successful completion of the linearity correction the S_LINEAR keyword is
4848
set to "COMPLETE".
@@ -54,16 +54,16 @@ Special Handling
5454
the linearity correction applied and the DQ flag "NO_LIN_CORR" is added to
5555
the science exposure PIXELDQ array.
5656

57-
#. Pixels that have the "NO_LIN_CORR" flag set in the DQ array of the linearity
58-
reference file will not have the correction applied and the "NO_LIN_CORR" flag
57+
#. Pixels that have the "NO_LIN_CORR" flag set in the DQ array of the
58+
:ref:`linearity_reffile` will not have the correction applied and the "NO_LIN_CORR" flag
5959
is added to the science exposure PIXELDQ array.
6060

6161
#. Pixel values that have the "SATURATED" flag set in a particular group of the
6262
science exposure GROUPDQ array will not have the linearity correction
6363
applied to that group. Any groups for that pixel that are not flagged as
6464
saturated will be corrected.
6565

66-
The flags from the linearity reference file DQ array are propagated into the
66+
The flags from the :ref:`linearity_reffile` DQ array are propagated into the
6767
PIXELDQ array of the science exposure using a bitwise OR operation.
6868

6969
NIRCam Frame 0
@@ -81,7 +81,11 @@ Subarrays
8181
This step handles input science exposures that were taken in subarray modes
8282
in a flexible way. If the reference data arrays are the same size as the
8383
science data, they will be applied directly. If there is a mismatch, the
84-
routine will extract a matching subarray from the reference file data arrays
84+
routine will extract a matching subarray from the :ref:`linearity_reffile` data arrays
8585
and apply them to the science data. Hence full-frame reference files can be
8686
used for both full-frame and subarray science exposures, or
8787
subarray-dependent reference files can be provided if desired.
88+
89+
Step Arguments
90+
--------------
91+
The linearity correction has no step-specific arguments.

docs/jwst/linearity/index.rst

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,5 @@ Linearity Correction
88
:maxdepth: 2
99

1010
description.rst
11-
arguments.rst
1211
reference_files.rst
13-
14-
.. automodapi:: jwst.linearity
12+
api_ref.rst

docs/jwst/linearity/reference_files.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
Reference File Types
2-
====================
1+
Reference Files
2+
===============
33

44
The ``linearity`` step uses a LINEARITY reference file.
55

docs/jwst/references_general/linearity_reffile.inc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.. _linearity_reffile:
22

33
LINEARITY Reference File
4-
-------------------------
4+
------------------------
55

66
:REFTYPE: LINEARITY
77
:Data model: `~stdatamodels.jwst.datamodels.LinearityModel`
@@ -14,7 +14,7 @@ coefficients.
1414
.. include:: ../includes/standard_keywords.inc
1515

1616
Type Specific Keywords for LINEARITY
17-
+++++++++++++++++++++++++++++++++++++
17+
++++++++++++++++++++++++++++++++++++
1818
In addition to the standard reference file keywords listed above,
1919
the following keywords are *required* in LINEARITY reference files,
2020
because they are used as CRDS selectors

docs/jwst/references_general/linearity_selection.inc

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,11 @@ LINEARITY is not applicable for instruments not in the table.
77
All keywords used for file selection are *required*.
88

99
========== ==============================================================
10-
Instrument Keywords
10+
Instrument Keywords
1111
========== ==============================================================
12-
FGS INSTRUME, DETECTOR, SUBARRAY, DATE-OBS, TIME-OBS
13-
MIRI INSTRUME, DETECTOR, SUBARRAY, BAND, FILTER, DATE-OBS, TIME-OBS
14-
NIRCam INSTRUME, DETECTOR, SUBARRAY, DATE-OBS, TIME-OBS
15-
NIRISS INSTRUME, DETECTOR, SUBARRAY, DATE-OBS, TIME-OBS
16-
NIRSpec INSTRUME, DETECTOR, SUBARRAY, DATE-OBS, TIME-OBS
12+
FGS INSTRUME, DETECTOR, SUBARRAY, DATE-OBS, TIME-OBS
13+
MIRI INSTRUME, DETECTOR, SUBARRAY, BAND, FILTER, DATE-OBS, TIME-OBS
14+
NIRCam INSTRUME, DETECTOR, SUBARRAY, DATE-OBS, TIME-OBS
15+
NIRISS INSTRUME, DETECTOR, SUBARRAY, DATE-OBS, TIME-OBS
16+
NIRSpec INSTRUME, DETECTOR, SUBARRAY, DATE-OBS, TIME-OBS
1717
========== ==============================================================
18-

jwst/linearity/linearity.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ def do_correction(output_model, lin_model):
1717
1818
Parameters
1919
----------
20-
output_model : `~jwst.datamodels.RampModel`
20+
output_model : `~stdatamodels.jwst.datamodels.RampModel`
2121
Science data to be corrected.
2222
23-
lin_model : `~jwst.datamodels.LinearityModel`
23+
lin_model : `~stdatamodels.jwst.datamodels.LinearityModel`
2424
Linearity reference file model.
2525
2626
Returns
2727
-------
28-
output_model : `~jwst.datamodels.RampModel`
28+
output_model : `~stdatamodels.jwst.datamodels.RampModel`
2929
Linearity corrected science data.
3030
"""
3131
# Create the output model as a copy of the input

jwst/linearity/linearity_step.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
"""Apply linearity correction to ramp data."""
2+
13
import logging
24

35
from stdatamodels.jwst import datamodels

0 commit comments

Comments
 (0)