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

Bases: jwst.stpipe.core.JwstStep

Extract a 1-d spectrum from 2-d data


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.


int or None


A string indicating the type of fitting to be applied to background values in each column (or row, if the dispersion is vertical). Allowed values are poly, mean, and median. Default is poly.




If not None, a polynomial with order bkg_order will be fit to each column (or row, if the dispersion direction is vertical) 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.


int or None


Background sigma clipping value to use on background to remove outliers and maximize the quality of the 1d spectrum




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.




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.


bool or None


If True, the source and background extraction positions specified in the extract1d reference file (or the default position, if there is no reference file) will be shifted to account for the computed position of the source in the data. If None (the default), the values in the reference file will be used. Aperture offset is determined by computing the pixel location of the source based on its RA and Dec. It does not make sense to apply aperture offsets for extended sources, so this parameter can be overriden (set to False) internally by the step.


bool or None


Switch to select whether or not to apply an APERTURE correction during the Extract1dStep. Default is True



Create a Step instance.

  • 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



Methods Summary


Execute the step.

Attributes Documentation

reference_file_types = ['extract1d', 'apcorr']
spec = '\n    smoothing_length = integer(default=None)  # background smoothing size\n    bkg_fit = option("poly", "mean", "median", default="poly")  # background fitting type\n    bkg_order = integer(default=None, min=0)  # order of background polynomial fit\n    bkg_sigma_clip = float(default=3.0)  # background sigma clipping threshold\n    log_increment = integer(default=50)  # increment for multi-integration log messages\n    subtract_background = boolean(default=None)  # subtract background?\n    use_source_posn = boolean(default=None)  # use source coords to center extractions?\n    apply_apcorr = boolean(default=True)  # apply aperture corrections?\n    '

Methods Documentation


Execute the step.


input (JWST data model) –


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