Skip to content

Commit 4fe6fd4

Browse files
committed
DOC: Complete API for flatfield
1 parent b52070e commit 4fe6fd4

13 files changed

Lines changed: 151 additions & 109 deletions

docs/jwst/flatfield/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.flatfield.flat_field_step
9+
:no-inheritance-diagram:
10+
11+
Complete Developer API
12+
======================
13+
14+
.. automodapi:: jwst.flatfield.flat_field
15+
:no-inheritance-diagram:

docs/jwst/flatfield/index.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ Flatfield Correction
77
:maxdepth: 2
88

99
main.rst
10-
reference_files.rst
1110
arguments.rst
12-
13-
.. automodapi:: jwst.flatfield
11+
reference_files.rst
12+
api_ref.rst

docs/jwst/flatfield/main.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Description
22
===========
33

4-
:Class: `jwst.flatfield.FlatFieldStep`
4+
:Class: `jwst.flatfield.flat_field_step.FlatFieldStep`
55
:Alias: flat_field
66

77
At its basic level this step flat-fields an input science dataset by dividing
@@ -17,7 +17,7 @@ to "COMPLETE" in the output science data.
1717

1818
Imaging and Non-NIRSpec Spectroscopic Data
1919
------------------------------------------
20-
Simple imaging data, usually in the form of an ImageModel, and some
20+
Simple imaging data, usually in the form of an `~stdatamodels.jwst.datamodels.ImageModel`, and some
2121
spectroscopic modes, use a straight-forward approach that involves applying
2222
a single flat-field reference file to the science image. The spectroscopic
2323
modes included in this category are NIRCam WFSS and Time-Series Grism,
@@ -75,7 +75,7 @@ that is divided into the SCI and ERR arrays is constructed on-the-fly
7575
by extracting the relevant section from the reference files, and then --
7676
for each pixel -- interpolating to the appropriate wavelength for that
7777
pixel. This interpolation requires knowledge of the dispersion direction,
78-
which is read from keyword "DISPAXIS." See the Reference File section for
78+
which is read from keyword "DISPAXIS." See :ref:`flat_ref_nirspec_spec` for
7979
further details.
8080

8181
For NIRSpec Fixed Slit (FS) and MOS exposures, an on-the-fly flat-field is
@@ -84,8 +84,8 @@ exposure. For NIRSpec IFU exposures, a single full-frame flat-field is
8484
constructed, which is applied to the entire science image.
8585

8686
NIRSpec NRS_BRIGHTOBJ data are processed just like NIRSpec fixed slit
87-
data, except that NRS_BRIGHTOBJ data are stored in a CubeModel,
88-
rather than a MultiSlitModel. A 2-D flat-field image is constructed
87+
data, except that NRS_BRIGHTOBJ data are stored in a `~stdatamodels.jwst.datamodels.CubeModel`,
88+
rather than a `~stdatamodels.jwst.datamodels.MultiSlitModel`. A 2-D flat-field image is constructed
8989
on-the-fly as usual, but this image is then divided into each plane of
9090
the 3-D science data arrays.
9191

docs/jwst/flatfield/reference_files.rst

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,20 @@ spectroscopic exposures use the three reference files :ref:`fflat_reffile` (fore
77

88
.. include:: ../references_general/flat_reffile.inc
99

10+
.. _flat_ref_nirspec_spec:
11+
1012
Reference Files for NIRSpec Spectroscopy
1113
========================================
1214
For NIRSpec spectroscopic data, the flat-field reference files allow for variations in
1315
the flat field with wavelength, as well as from pixel to pixel. There is a
1416
separate flat-field reference file for each of three sections of the
15-
instrument: the fore optics (FFLAT), the spectrograph (SFLAT), and the
16-
detector (DFLAT). The contents of the reference files differ from one mode
17+
instrument:
18+
19+
* the fore optics (:ref:`fflat_reffile`)
20+
* the spectrograph (:ref:`sflat_reffile`)
21+
* the detector (:ref:`dflat_reffile`)
22+
23+
The contents of the reference files differ from one mode
1724
to another (see below), but in general they may contain a flat-field image and
1825
a 1-D array. The image provides pixel-to-pixel values for the flat field
1926
that may vary slowly (or not at all) with wavelength, while the 1-D array
@@ -45,8 +52,8 @@ there are different flat fields for fixed-slit data, IFU data, and for
4552
multi-object spectroscopic data. Here is a summary of the contents of these
4653
files.
4754

48-
For the fore optics (FFLAT), the flat field for fixed-slit data contains just a
49-
FAST_VARIATION table (i.e. there is no image). This table has five rows,
55+
For the fore optics (:ref:`fflat_reffile`), the flat field for fixed-slit data contains just a
56+
FAST_VARIATION table (i.e., there is no image). This table has five rows,
5057
one for each of the fixed slits. The FFLAT for IFU data also contains
5158
just a FAST_VARIATION table, but it has only one row with the value "ANY"
5259
in the "slit_name" column. For multi-object spectroscopic data, the FFLAT
@@ -57,22 +64,18 @@ than to detector pixels. The array size is 365 columns by 171 rows,
5764
and there are multiple planes to handle the slow variation
5865
of flat field with wavelength.
5966

60-
For the spectrograph optics (SFLAT), the flat-field files have nearly the same
67+
For the spectrograph optics (:ref:`sflat_reffile`), the flat-field files have nearly the same
6168
format for fixed-slit data, IFU, and multi-object data. The difference is
6269
that for fixed-slit and IFU data, the image is just a single plane,
63-
i.e. the only variation with wavelength is in the FAST_VARIATION table,
70+
i.e., the only variation with wavelength is in the FAST_VARIATION table,
6471
while there are multiple planes in the image for multi-object spectroscopic
6572
data (and therefore there is also a corresponding WAVELENGTH table, with
6673
one row for each plane of the image).
6774

68-
For the detector section, the DFLAT file contains a 3-D image
69-
(i.e. the flat field at multiple wavelengths), a corresponding
75+
For the detector section, the :ref:`dflat_reffile` contains a 3-D image
76+
(i.e., the flat field at multiple wavelengths), a corresponding
7077
WAVELENGTH table, and a FAST_VARIATION table with one row.
7178

72-
As just described, there are 3 types of reference files for NIRSpec (FFLAT,
73-
SFLAT, and DFLAT), and within each of these types, there are several formats,
74-
which are now described.
75-
7679
.. include:: ../references_general/fflat_reffile.inc
7780

7881
.. include:: ../references_general/sflat_reffile.inc

docs/jwst/references_general/dflat_reffile.inc

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,22 +24,22 @@ DQ_DEF BINTABLE 2 TFIELDS = 4 N/A
2424

2525
.. include:: ../includes/dq_def.inc
2626

27-
The keyword NAXIS3 in the SCI extension specifies the number, n_wl, of monochromatic
28-
slices, each of which gives the flat_field value for every pixel for the corresponding
27+
The keyword NAXIS3 in the SCI extension specifies the number, ``n_wl```, of monochromatic
28+
slices, each of which gives the ``flat_field`` value for every pixel for the corresponding
2929
wavelength, which is specified in the WAVELENGTH table.
3030

3131
The WAVELENGTH table contains a single column:
3232

33-
* wavelength: float 1-D array, values of wavelength
33+
* ``wavelength``: float 1-D array, values of wavelength
3434

3535
Each of these wavelength values corresponds to a single plane of the SCI IMAGE array.
3636

3737
The FAST_VARIATION table contains four columns:
3838

39-
* slit_name: the string "ANY"
40-
* nelem: integer, maximum number of wavelengths
41-
* wavelength: float 1-D array, values of wavelength
42-
* data: float 1-D array, flat field values for each wavelength
39+
* ``slit_name``: the string "ANY"
40+
* ``nelem``: integer, maximum number of wavelengths
41+
* ``wavelength``: float 1-D array, values of wavelength
42+
* ``data``: float 1-D array, flat field values for each wavelength
4343

4444
The flat field values in this table are used to account for a wavelength-dependence on a
4545
much finer scale than given by the values in the SCI array. There is a single row in

docs/jwst/references_general/dflat_selection.inc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ DFLAT is not applicable for instruments not in the table.
55
Non-standard keywords used for file selection are *required*.
66

77
========== ================================================
8-
Instrument Keywords
8+
Instrument Keywords
99
========== ================================================
10-
NIRSpec INSTRUME, DETECTOR, EXP_TYPE, DATE-OBS, TIME-OBS
10+
NIRSpec INSTRUME, DETECTOR, EXP_TYPE, DATE-OBS, TIME-OBS
1111
========== ================================================
12-

docs/jwst/references_general/fflat_reffile.inc

Lines changed: 35 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5,33 +5,42 @@ FFLAT Reference File
55

66
:REFTYPE: FFLAT
77

8-
There are 3 forms of NIRSpec FFLAT reference files: fixed slit, MSA spec, and IFU.
9-
For each type the primary HDU does not contain a data array.
8+
There are 3 forms of NIRSpec FFLAT reference files:
9+
10+
* :ref:`fflat_fixed_slit`
11+
* :ref:`fflat_msa`
12+
* :ref:`fflat_ifu`
13+
14+
For each type, the primary HDU does not contain a data array.
1015

1116
.. include:: ../references_general/fflat_selection.inc
1217

13-
*Fixed Slit*
14-
++++++++++++
18+
.. _fflat_fixed_slit:
19+
20+
Fixed Slit
21+
++++++++++
1522
:Data model: `~stdatamodels.jwst.datamodels.NirspecFlatModel`
1623

17-
The fixed slit FFLAT files have EXP_TYPE=NRS_FIXEDSLIT, and have a single BINTABLE
24+
The fixed slit FFLAT files have ``EXP_TYPE=NRS_FIXEDSLIT``, and have a single BINTABLE
1825
extension, labeled FAST_VARIATION.
1926

2027
The table contains four columns:
2128

22-
* slit_name: string, name of slit
23-
* nelem: integer, maximum number of wavelengths
24-
* wavelength: float 1-D array, values of wavelength
25-
* data: float 1-D array, flat field values for each wavelength
29+
* ``slit_name``: string, name of slit
30+
* ``nelem``: integer, maximum number of wavelengths
31+
* ``wavelength``: float 1-D array, values of wavelength
32+
* ``data``: float 1-D array, flat field values for each wavelength
2633

2734
The number of rows in the table is given by NAXIS2, and each row corresponds to a
2835
separate slit.
2936

30-
*MSA Spec*
31-
++++++++++++
37+
.. _fflat_msa:
38+
39+
MSA Spec
40+
++++++++
3241
:Data model: `~stdatamodels.jwst.datamodels.NirspecQuadFlatModel`
3342

34-
The MSA Spec FFLAT files have EXP_TYPE=NRS_MSASPEC, and contain data pertaining
43+
The MSA Spec FFLAT files have ``EXP_TYPE=NRS_MSASPEC``, and contain data pertaining
3544
to each of the 4 quadrants. For each quadrant, there is a set of 5 extensions -
3645
SCI, ERR, DQ, WAVELENGTH, and FAST_VARIATION.
3746
The file also contains a single DQ_DEF extension.
@@ -61,35 +70,37 @@ wavelength of each pixel.
6170

6271
The WAVELENGTH table contains a single column:
6372

64-
* wavelength: float 1-D array, values of wavelength
73+
* ``wavelength``: float 1-D array, values of wavelength
6574

6675
Each of these wavelength values corresponds to a single plane of the IMAGE arrays.
6776

6877
The FAST_VARIATION table contains four columns:
6978

70-
* slit_name: the string "ANY"
71-
* nelem: integer, maximum number of wavelengths
72-
* wavelength: float 1-D array, values of wavelength
73-
* data: float 1-D array, flat field values for each wavelength
79+
* ``slit_name``: the string "ANY"
80+
* ``nelem``: integer, maximum number of wavelengths
81+
* ``wavelength``: float 1-D array, values of wavelength
82+
* ``data``: float 1-D array, flat field values for each wavelength
7483

7584
The flat field values in this table are used to account for a wavelength-dependence on a
7685
much finer scale than given by the values in the SCI array. There is a single row in
7786
this table, which contains 1-D arrays of wavelength and flat-field values.
7887
The same wavelength-dependent value is applied to all pixels in a quadrant.
7988

80-
*IFU*
81-
+++++
89+
.. _fflat_ifu:
90+
91+
IFU
92+
+++
8293
:Data model: `~stdatamodels.jwst.datamodels.NirspecFlatModel`
8394

84-
The IFU FFLAT files have EXP_TYPE=NRS_IFU. These have one extension,
95+
The IFU FFLAT files have ``EXP_TYPE=NRS_IFU``. These have one extension,
8596
a BINTABLE extension labeled FAST_VARIATION.
8697

8798
The FAST_VARIATION table contains four columns:
8899

89-
* slit_name: the string "ANY"
90-
* nelem: integer, maximum number of wavelengths
91-
* wavelength: float 1-D array, values of wavelength
92-
* data: float 1-D array, flat field values for each wavelength
100+
* ``slit_name``: the string "ANY"
101+
* ``nelem``: integer, maximum number of wavelengths
102+
* ``wavelength``: float 1-D array, values of wavelength
103+
* ``data``: float 1-D array, flat field values for each wavelength
93104

94105
For each pixel in the science data, the wavelength of the light that fell
95106
on that pixel will be determined from the WAVELENGTH array in the science exposure

docs/jwst/references_general/fflat_selection.inc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ FFLAT is not applicable for instruments not in the table.
55
Non-standard keywords used for file selection are *required*.
66

77
========== ==============================================
8-
Instrument Keywords
8+
Instrument Keywords
99
========== ==============================================
10-
NIRSpec INSTRUME, FILTER, EXP_TYPE, DATE-OBS, TIME-OBS
10+
NIRSpec INSTRUME, FILTER, EXP_TYPE, DATE-OBS, TIME-OBS
1111
========== ==============================================
12-

docs/jwst/references_general/flat_reffile.inc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ FLAT Reference File
77
:Data model: `~stdatamodels.jwst.datamodels.FlatModel`
88

99
The FLAT reference file contains pixel-by-pixel detector response values.
10-
It is used for all instrument modes except the NIRSpec spectroscopic modes.
10+
It is used for all instrument modes except for the
11+
:ref:`NIRSpec spectroscopic modes <flat_ref_nirspec_spec>`.
1112

1213
.. include:: ../references_general/flat_selection.inc
1314

@@ -55,5 +56,5 @@ used in the DQ array.
5556

5657
For application to imaging data, the FITS file contains a single set of SCI,
5758
ERR, DQ, and DQ_DEF extensions. Image dimensions should be 2048x2048 for the
58-
NIR detectors and 1032x1024 for MIRI (i.e. they include reference pixels),
59+
NIR detectors and 1032x1024 for MIRI (i.e., they include reference pixels),
5960
unless data were taken in subarray mode.

docs/jwst/references_general/sflat_reffile.inc

Lines changed: 28 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,36 @@ SFLAT Reference File
66
:REFTYPE: SFLAT
77
:Data model: `~stdatamodels.jwst.datamodels.NirspecFlatModel`
88

9-
There are 3 types of NIRSpec SFLAT reference files: fixed slit, MSA spec, and IFU.
10-
For each type the primary HDU does not contain a data array.
9+
There are 3 types of NIRSpec SFLAT reference files:
10+
11+
* :ref:`sflat_fixed_slit`
12+
* :ref:`sflat_msa`
13+
* IFU
14+
15+
For each type, the primary HDU does not contain a data array.
1116

1217
.. include:: ../references_general/sflat_selection.inc
1318

14-
*Fixed Slit*
15-
++++++++++++
16-
The fixed slit references files have EXP_TYPE=NRS_FIXEDSLIT, and have a BINTABLE
19+
.. _sflat_fixed_slit:
20+
21+
Fixed Slit
22+
++++++++++
23+
The fixed slit references files have ``EXP_TYPE=NRS_FIXEDSLIT``, and have a BINTABLE
1724
extension labeled FAST_VARIATION. The table contains four columns:
1825

19-
* slit_name: string, name of slit
20-
* nelem: integer, maximum number of wavelengths
21-
* wavelength: float 1-D array, values of wavelength
22-
* data: float 1-D array, flat field values for each wavelength
26+
* ``slit_name``: string, name of slit
27+
* ``nelem``: integer, maximum number of wavelengths
28+
* ``wavelength``: float 1-D array, values of wavelength
29+
* ``data``: float 1-D array, flat field values for each wavelength
2330

2431
The number of rows in the table is given by NAXIS2, and each row corresponds to a
2532
separate slit.
2633

27-
*MSA Spec*
28-
++++++++++
29-
The MSA Spec SFLAT files have EXP_TYPE=NRS_MSASPEC.
34+
.. _sflat_msa:
35+
36+
MSA Spec
37+
++++++++
38+
The MSA Spec SFLAT files have ``EXP_TYPE=NRS_MSASPEC``.
3039
They contain 6 extensions, with the following characteristics:
3140

3241
============== ======== ===== ===================== =========
@@ -42,22 +51,22 @@ DQ_DEF BINTABLE 2 TFIELDS = 4 N/A
4251

4352
.. include:: ../includes/dq_def.inc
4453

45-
The keyword NAXIS3 in the 3 IMAGE extensions specifies the number, n_wl, of monochromatic
46-
slices, each of which gives the flat_field value for every pixel for the corresponding
54+
The keyword NAXIS3 in the 3 IMAGE extensions specifies the number, ``n_wl``, of monochromatic
55+
slices, each of which gives the ``flat_field`` value for every pixel for the corresponding
4756
wavelength, which is specified in the WAVELENGTH table.
4857

4958
The WAVELENGTH table contains a single column:
5059

51-
* wavelength: float 1-D array, values of wavelength
60+
* ``wavelength``: float 1-D array, values of wavelength
5261

5362
Each of these wavelength values corresponds to a single plane of the IMAGE arrays.
5463

5564
The FAST_VARIATION table contains four columns:
5665

57-
* slit_name: the string "ANY"
58-
* nelem: integer, maximum number of wavelengths
59-
* wavelength: float 1-D array, values of wavelength
60-
* data: float 1-D array, flat field values for each wavelength
66+
* ``slit_name``: the string "ANY"
67+
* ``nelem``: integer, maximum number of wavelengths
68+
* ``wavelength``: float 1-D array, values of wavelength
69+
* ``data``: float 1-D array, flat field values for each wavelength
6170

6271
The flat field values in this table are used to account for a wavelength-dependence on a
6372
much finer scale than given by the values in the SCI array. For each pixel in the

0 commit comments

Comments
 (0)