Extract1dStep

class jwst.extract_1d.Extract1dStep(name=None, parent=None, config_file=None, _validate_kwds=True, **kws)[source]

Bases: jwst.stpipe.Step

Extract a 1-d spectrum from 2-d data

smoothing_length: int or None

If not None, the background regions (if any) will be smoothed with a boxcar function of this width along the dispersion direction. This should be an odd integer.

bkg_order: int or None

If not None, a polynomial with order bkg_order will be fit to each column (or row if the dispersion direction is horizontal) of the background region or regions. For a given column (row), one polynomial will be fit to all background regions. The polynomial will be evaluated at each pixel of the source extraction region(s) along the column (row), and the fitted value will be subtracted from the data value at that pixel. If both smoothing_length and bkg_order are not None, the boxcar smoothing will be done first.

log_increment: int

if log_increment is greater than 0 (the default is 50) and the input data are multi-integration (which can be CubeModel or SlitModel), a message will be written to the log with log level INFO every log_increment integrations. This is intended to provide progress information when invoking the step interactively.

subtract_background: bool or None

A flag which indicates whether the background should be subtracted. If None, the value in the extract_1d reference file will be used. If not None, this parameter overrides the value in the extract_1d reference file.

apply_nod_offset: bool or None

If True, the source and background positions specified in the reference file (or the default position, if there is no reference file) will be shifted to account for nod and/or dither offset. If None (the default), the value in the reference file will be used, or it will be set to True if it is not specified in the reference file. This offset is determined by finding the location in the data corresponding to the target position (keywords TARG_RA and TARG_DEC). For NIRSpec fixed-slit or MOS data, there must be different target coordinates for each slit for which a nod correction might be needed, and this is not implemented yet in extract_1d. It also doesn’t make sense to apply a nod/dither offset for an extended target, so this flag can internally be overridden (set to False) for extended targets.

Create a Step instance.

Parameters
  • name (str, optional) – The name of the Step instance. Used in logging messages and in cache filenames. If not provided, one will be generated based on the class name.

  • parent (Step instance, optional) – The parent step of this step. Used to determine a fully-qualified name for this step, and to determine the mode in which to run this step.

  • config_file (str path, optional) – The path to the config file that this step was initialized with. Use to determine relative path names of other config files.

  • **kws (dict) – Additional parameters to set. These will be set as member variables on the new Step instance.

Attributes Summary

reference_file_types

spec

Methods Summary

process(input)

Execute the step.

Attributes Documentation

reference_file_types = ['extract1d']
spec = '\n # Boxcar smoothing width for background regions.\n smoothing_length = integer(default=None)\n # Order of polynomial fit to one column (or row if the dispersion\n # direction is vertical) of background regions.\n bkg_order = integer(default=None, min=0)\n # Log a progress message when processing multi-integration data.\n log_increment = integer(default=50)\n # Flag indicating whether the background should be subtracted.\n subtract_background = boolean(default=None)\n # If True, the locations of the target and background regions will be\n # shifted to correct for the computed nod/dither offset.\n # Currently this offset is not applied for NIRSpec fixed-slit or\n # MOS (MSA) data), or for WFSS data.\n apply_nod_offset = boolean(default=None)\n '

Methods Documentation

process(input)[source]

Execute the step.

Parameters

input (JWST data model) –

Returns

This will be input_model if the step was skipped; otherwise, it will be a model containing 1-D extracted spectra.

Return type

JWST data model