Skip to content

Commit 0f29b71

Browse files
Clean up help message style and contents (#9686)
2 parents da67809 + 0a6e722 commit 0f29b71

36 files changed

+179
-526
lines changed

jwst/assign_wcs/assign_wcs_step.py

Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -24,27 +24,7 @@
2424

2525

2626
class AssignWcsStep(Step):
27-
"""
28-
AssignWcsStep: Create a gWCS object and store it in ``Model.meta``.
29-
30-
Reference file types:
31-
32-
camera Camera model (NIRSPEC)
33-
collimator Collimator Model (NIRSPEC)
34-
disperser Disperser model (NIRSPEC)
35-
distortion Spatial distortion model (FGS, MIRI, NIRCAM, NIRISS)
36-
filteroffset Filter offsets (MIRI Imager)
37-
fore Transform through the FORE optics (NIRSPEC)
38-
fpa Transform in the FPA plane (NIRSPEC)
39-
ifufore Transforms from the MSA plane to the plane of the IFU slicer (NIRSPEC)
40-
ifupost Transforms from the slicer plane to the MSA plane (NIRSPEC)
41-
ifuslicer Metrology of the IFU slicer (NIRSPEC)
42-
msa Metrology of the MSA plane (NIRSPEC)
43-
ote Transform through the Optical Telescope Element (NIRSPEC)
44-
specwcs Wavelength calibration models (MIRI, NIRCAM, NIRISS)
45-
regions Stores location of the regions on the detector (MIRI)
46-
wavelengthrange Typical wavelength ranges (MIRI, NIRCAM, NIRISS, NIRSPEC)
47-
"""
27+
"""Create a gWCS object and store it in ``Model.meta.wcs``."""
4828

4929
class_alias = "assign_wcs"
5030

@@ -82,6 +62,24 @@ def process(self, input_data):
8262
"""
8363
Run the assign_wcs step.
8464
65+
Reference file types for this step:
66+
67+
- camera: Camera model (NIRSPEC)
68+
- collimator: Collimator Model (NIRSPEC)
69+
- disperser: Disperser model (NIRSPEC)
70+
- distortion: Spatial distortion model (FGS, MIRI, NIRCAM, NIRISS)
71+
- filteroffset: Filter offsets (MIRI Imager)
72+
- fore: Transform through the FORE optics (NIRSPEC)
73+
- fpa: Transform in the FPA plane (NIRSPEC)
74+
- ifufore: Transforms from the MSA plane to the plane of the IFU slicer (NIRSPEC)
75+
- ifupost: Transforms from the slicer plane to the MSA plane (NIRSPEC)
76+
- ifuslicer: Metrology of the IFU slicer (NIRSPEC)
77+
- msa: Metrology of the MSA plane (NIRSPEC)
78+
- ote: Transform through the Optical Telescope Element (NIRSPEC)
79+
- specwcs: Wavelength calibration models (MIRI, NIRCAM, NIRISS)
80+
- regions: Stores location of the regions on the detector (MIRI)
81+
- wavelengthrange: Typical wavelength ranges (MIRI, NIRCAM, NIRISS, NIRSPEC)
82+
8583
Parameters
8684
----------
8785
input_data : JwstDataModel or str

jwst/clean_flicker_noise/clean_flicker_noise_step.py

Lines changed: 13 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -7,71 +7,7 @@
77

88

99
class CleanFlickerNoiseStep(Step):
10-
"""
11-
Perform flicker noise correction.
12-
13-
Input data is expected to be a ramp file (RampModel), in between
14-
jump and ramp fitting steps, or a rate file (ImageModel or CubeModel).
15-
16-
Correction algorithms implemented are:
17-
- `fft`: Background noise is fit in frequency space.
18-
Implementation is based on the NSClean algorithm, developed
19-
by Bernard Rauscher.
20-
- `median`: Background noise is characterized by a median
21-
along the detector slow axis. Implementation is based on the
22-
`image1overf` algorithm, developed by Chris Willott.
23-
24-
Attributes
25-
----------
26-
fit_method : str, optional
27-
The noise fitting algorithm to use. Options are 'fft' and 'median'.
28-
fit_by_channel : bool, optional
29-
If set, flicker noise is fit independently for each detector channel.
30-
Ignored for MIRI, for subarray data, and for `fit_method` = 'fft'
31-
background_method : {'median', 'model', None}
32-
If 'median', the preliminary background to remove and restore
33-
is a simple median of the background data. If 'model', the
34-
background data is fit with a low-resolution model via
35-
`~photutils.background.Background2D`. If None, the background
36-
value is 0.0.
37-
background_box_size : tuple of int or None, optional
38-
Box size for the data grid used by `Background2D` when
39-
`background_method` = 'model'. For best results, use a box size
40-
that evenly divides the input image shape. If None, the largest
41-
value between 1 and 32 that evenly divides the image dimension
42-
is used.
43-
mask_science_regions : bool, optional
44-
For NIRSpec, mask regions of the image defined by WCS bounding
45-
boxes for slits/slices, as well as any regions known to be
46-
affected by failed-open MSA shutters. For MIRI imaging, mask
47-
regions of the detector not used for science.
48-
apply_flat_field : bool, optional
49-
If set, images are flat-corrected prior to fitting background
50-
and noise levels. A full-frame flat field image
51-
(reference type FLAT) is required. For modes that do not provide
52-
FLAT files via CRDS, including all NIRSpec spectral modes, a manually
53-
generated override flat is required to enable this option.
54-
Use the `override_flat` parameter to provide an alternate flat image
55-
as needed.
56-
n_sigma : float, optional
57-
Sigma clipping threshold to be used in detecting outliers in the image.
58-
fit_histogram : bool, optional
59-
If set, the 'sigma' used with `n_sigma` for clipping outliers
60-
is derived from a Gaussian fit to a histogram of values.
61-
Otherwise, a simple iterative sigma clipping is performed.
62-
single_mask : bool, optional
63-
If set, a single mask will be created, regardless of
64-
the number of input integrations. Otherwise, the mask will
65-
be a 3D cube, with one plane for each integration.
66-
user_mask : None, str, or `~jwst.datamodels.ImageModel`
67-
Optional user-supplied mask image; path to file or opened datamodel.
68-
save_mask : bool, optional
69-
Save the computed mask image.
70-
save_background : bool, optional
71-
Save the computed background image.
72-
save_noise : bool, optional
73-
Save the computed noise image.
74-
"""
10+
"""Perform flicker noise correction."""
7511

7612
class_alias = "clean_flicker_noise"
7713

@@ -98,6 +34,18 @@ def process(self, input_data):
9834
"""
9935
Fit and subtract 1/f background noise from a ramp data set.
10036
37+
Input data is expected to be a ramp file (RampModel), in between
38+
jump and ramp fitting steps, or a rate file (ImageModel or CubeModel).
39+
40+
Correction algorithms implemented are:
41+
42+
- "fft": Background noise is fit in frequency space.
43+
Implementation is based on the NSClean algorithm, developed
44+
by Bernard Rauscher.
45+
- "median": Background noise is characterized by a median
46+
along the detector slow axis. Implementation is based on the
47+
"image1overf" algorithm, developed by Chris Willott.
48+
10149
Parameters
10250
----------
10351
input_data : DataModel

jwst/combine_1d/combine_1d_step.py

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -11,29 +11,7 @@
1111

1212

1313
class Combine1dStep(Step):
14-
"""
15-
Combine 1D spectra.
16-
17-
Attributes
18-
----------
19-
exptime_key : str
20-
A case-insensitive string that identifies the metadata element
21-
(or FITS keyword) for the weight to apply to the input data. The default
22-
is "exposure_time". If the string is "effinttm" or starts with
23-
"integration", the integration time (FITS keyword EFFINTTM) is used
24-
as the weight. If the string is "effexptm" or starts with "exposure",
25-
the exposure time (FITS keyword EFFEXPTM) is used as the weight. If
26-
the string is "unit_weight" or "unit weight", the same weight (1) will
27-
be used for all input spectra. If the string is anything else, a warning
28-
will be logged and unit weight will be used.
29-
30-
sigma_clip : float or None
31-
Optional factor for sigma clipping outliers when combining spectra. If
32-
a floating point value is provided for ``sigma_clip``, this value will be
33-
used to set an outlier threshold for any pixels in the input spectra that
34-
deviate from the median and median absolute deviation of the inputs.
35-
Defaults to None (such that no clipping is performed).
36-
"""
14+
"""Combine 1D spectra."""
3715

3816
class_alias = "combine_1d"
3917

jwst/cube_build/cube_build_step.py

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,7 @@
1414

1515

1616
class CubeBuildStep(Step):
17-
"""
18-
Create a 3-D spectral cube from IFU data.
19-
20-
This is the controlling routine for building IFU Spectral Cubes.
21-
It loads and sets the various input data and parameters needed by
22-
the cube_build_step.
23-
24-
This routine does the following operations:
25-
26-
1. Extracts the input parameters from the cubepars reference file and
27-
merges them with any user-provided values.
28-
2. Creates the output WCS from the input images and defines the mapping
29-
between all the input arrays and the output array.
30-
3. Passes the input data to the function to map all their input data
31-
to the output array.
32-
4. Updates the output data model with correct meta data.
33-
"""
17+
"""Create a 3-D spectral cube from IFU data."""
3418

3519
class_alias = "cube_build"
3620

@@ -71,6 +55,20 @@ def process(self, input_data):
7155
"""
7256
Build an IFUCube from overlapping IFUImage data.
7357
58+
This is the controlling routine for building IFU Spectral Cubes.
59+
It loads and sets the various input data and parameters needed by
60+
the cube_build_step.
61+
62+
This routine does the following operations:
63+
64+
1. Extracts the input parameters from the cubepars reference file and
65+
merges them with any user-provided values.
66+
2. Creates the output WCS from the input images and defines the mapping
67+
between all the input arrays and the output array.
68+
3. Passes the input data to the function to map all their input data
69+
to the output array.
70+
4. Updates the output data model with correct meta data.
71+
7472
Parameters
7573
----------
7674
input_data : list of DataModel or str

jwst/extract_1d/extract_1d_step.py

Lines changed: 1 addition & 136 deletions
Original file line numberDiff line numberDiff line change
@@ -12,142 +12,7 @@
1212

1313

1414
class Extract1dStep(Step):
15-
"""
16-
Extract a 1D spectrum from 2D data.
17-
18-
Attributes
19-
----------
20-
subtract_background : bool or None
21-
A flag which indicates whether the background should be subtracted.
22-
If None, the value in the extract_1d reference file will be used.
23-
If not None, this parameter overrides the value in the
24-
extract_1d reference file.
25-
apply_apcorr : bool
26-
Switch to select whether to apply an APERTURE correction during
27-
the Extract1dStep. Default is True.
28-
extraction_type : str or None
29-
If 'box', a standard extraction is performed, summing over an
30-
aperture box. If 'optimal', a PSF-based extraction is performed.
31-
If None, optimal extraction is attempted whenever use_source_posn is
32-
True. Currently, optimal extraction is only available for MIRI LRS
33-
Fixed Slit data.
34-
use_source_posn : bool or None
35-
If True, the source and background extraction regions specified in
36-
the extract1d reference file will be shifted to account for the computed
37-
position of the source in the data. If None (the default), this parameter
38-
is set to True for point sources in NIRSpec and MIRI LRS fixed slit modes.
39-
position_offset : float
40-
Number of pixels to offset the source and background extraction regions
41-
in the cross-dispersion direction. This is intended to allow a manual
42-
tweak to the aperture defined via reference file; the default value is 0.0.
43-
model_nod_pair : bool
44-
If True, and the extraction type is 'optimal', then a negative trace
45-
from nod subtraction is modeled alongside the positive source during
46-
extraction. Even if set to True, this will be attempted only if the
47-
input data has been background subtracted and the dither pattern
48-
indicates that only 2 nods were used.
49-
optimize_psf_location : bool
50-
If True, and the extraction type is 'optimal', then the placement of
51-
the PSF model for the source location (and negative nod, if present)
52-
will be iteratively optimized. This parameter is recommended if
53-
negative nods are modeled.
54-
smoothing_length : int or None
55-
If not None, the background regions (if any) will be smoothed
56-
with a boxcar function of this width along the dispersion
57-
direction. This should be an odd integer.
58-
bkg_fit : str
59-
A string indicating the type of fitting to be applied to
60-
background values in each column (or row, if the dispersion is
61-
vertical). Allowed values are `poly`, `mean`, and `median`.
62-
Default is `None`.
63-
bkg_order : int or None
64-
If not None, a polynomial with order `bkg_order` will be fit to
65-
each column (or row, if the dispersion direction is vertical)
66-
of the background region or regions. For a given column (row),
67-
one polynomial will be fit to all background regions. The
68-
polynomial will be evaluated at each pixel of the source
69-
extraction region(s) along the column (row), and the fitted value
70-
will be subtracted from the data value at that pixel.
71-
If both `smoothing_length` and `bkg_order` are not None, the
72-
boxcar smoothing will be done first.
73-
log_increment : int
74-
if `log_increment` is greater than 0 (the default is 50) and the
75-
input data are multi-integration (which can be CubeModel or
76-
SlitModel), a message will be written to the log with log level
77-
INFO every `log_increment` integrations. This is intended to
78-
provide progress information when invoking the step interactively.
79-
save_profile : bool
80-
If True, the spatial profile containing the extraction aperture
81-
is saved to disk. Ignored for IFU and NIRISS SOSS extractions.
82-
save_scene_model : bool
83-
If True, a model of the 2D flux as defined by the extraction aperture
84-
is saved to disk. Ignored for IFU and NIRISS SOSS extractions.
85-
save_residual_image : bool
86-
If True, the residual image (from the input minus the scene model)
87-
is saved to disk. Ignored for IFU and NIRISS SOSS extractions.
88-
center_xy : int or None
89-
A list of 2 pixel coordinate values at which to place the center
90-
of the IFU extraction aperture, overriding any centering done by the step.
91-
Two values, in x,y order, are used for extraction from IFU cubes.
92-
Default is None.
93-
ifu_autocen : bool
94-
Switch to turn on auto-centering for point source spectral extraction
95-
in IFU mode. Default is False.
96-
bkg_sigma_clip : float
97-
Background sigma clipping value to use on background to remove outliers
98-
and maximize the quality of the 1d spectrum. Used for IFU mode only.
99-
ifu_rfcorr : bool
100-
Switch to select whether or not to apply a 1d residual fringe correction
101-
for MIRI MRS IFU spectra. Default is True.
102-
ifu_set_srctype : str
103-
For MIRI MRS IFU data override srctype and set it to either POINT or EXTENDED.
104-
ifu_rscale : float
105-
For MRS IFU data a value for changing the extraction radius. The value provided is
106-
the number of PSF FWHMs to use for the extraction radius. Values accepted are between
107-
0.5 to 3.0. The default extraction size is set to 2 * FWHM. Values below 2 will result
108-
in a smaller radius, a value of 2 results in no change to the radius and a value above
109-
2 results in a larger extraction radius.
110-
ifu_covar_scale : float
111-
Scaling factor by which to multiply the ERR values in extracted spectra to account
112-
for covariance between adjacent spaxels in the IFU data cube.
113-
soss_atoca : bool, default=False
114-
Switch to toggle extraction of SOSS data with the ATOCA algorithm.
115-
WARNING: ATOCA results not fully validated, and require the photom step
116-
be turned off. Default is False, meaning SOSS data use box extraction.
117-
soss_threshold : float
118-
Threshold value above which a pixel will be included when modeling the SOSS
119-
trace in ATOCA. Default is 0.01.
120-
soss_n_os : int
121-
Oversampling factor of the underlying wavelength grid when modeling the SOSS
122-
trace in ATOCA. Default is 2.
123-
soss_wave_grid_in : str or SossWaveGrid or None
124-
Filename or SossWaveGrid containing the wavelength grid used by ATOCA
125-
to model each pixel valid pixel of the detector. If not given, the grid is determined
126-
based on an estimate of the flux (soss_estimate), the relative tolerance (soss_rtol)
127-
required on each pixel model and the maximum grid size (soss_max_grid_size).
128-
soss_wave_grid_out : str or None
129-
Filename to hold the wavelength grid calculated by ATOCA.
130-
soss_estimate : str or SpecModel or None
131-
Filename or SpecModel of the estimate of the target flux. The estimate must
132-
be a SpecModel with wavelength and flux values.
133-
soss_rtol : float
134-
The relative tolerance needed on a pixel model. It is used to determine the sampling
135-
of the soss_wave_grid when not directly given.
136-
soss_max_grid_size: int
137-
Maximum grid size allowed. It is used when soss_wave_grid is not provided
138-
to make sure the computation time or the memory used stays reasonable.
139-
soss_tikfac : float
140-
The regularization factor used for extraction in ATOCA. If left to default
141-
value of None, ATOCA will find an optimized value.
142-
soss_width : float
143-
Aperture width used to extract the SOSS spectrum from the decontaminated
144-
trace in ATOCA. Default is 40.
145-
soss_bad_pix : str
146-
Method used to handle bad pixels, accepts either "model" or "masking". Default
147-
method is "model".
148-
soss_modelname : str
149-
Filename for optional model output of ATOCA traces and pixel weights.
150-
"""
15+
"""Extract a 1D spectrum from 2D data."""
15116

15217
class_alias = "extract_1d"
15318

jwst/extract_2d/extract_2d_step.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99

1010
class Extract2dStep(Step):
11-
"""Class that provides method to perform a 2D extraction of spectra."""
11+
"""Extract 2D spectral cutouts."""
1212

1313
class_alias = "extract_2d"
1414

jwst/firstframe/firstframe_step.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ class FirstFrameStep(Step):
1010
"""
1111
Set data quality flags for the first group in MIRI ramps.
1212
13-
A MIRI specific task. If the number of groups is > than 3,
14-
the DO_NOT_USE group data quality flag is added to first group.
13+
If the number of groups is > than 3, the DO_NOT_USE group data
14+
quality flag is added to first group.
1515
"""
1616

1717
class_alias = "firstframe"

0 commit comments

Comments
 (0)