- class jwst.extract_1d.Extract1dStep(name=None, parent=None, config_file=None, _validate_kwds=True, **kws)¶
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
median. Default is
If not None, a polynomial with order
bkg_orderwill 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
bkg_orderare 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
log_incrementis 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_incrementintegrations. 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 overridden (set to False) internally by the step.
bool or None
A list of 2 pixel coordinate values at which to place the center of the IFU extraction aperture, overriding any centering done by the step. Two values, in x,y order, are used for extraction from IFU cubes. Default is None.
int or None
Switch to select whether or not to apply an APERTURE correction during the Extract1dStep. Default is True
Switch to turn on auto-centering for point source spectral extraction in IFU mode. Default is False.
Switch to select whether or not to apply a 1d residual fringe correction for MIRI MRS IFU spectra. Default is False.
For MIRI MRS IFU data override srctype and set it to either POINT or EXTENDED.
For MRS IFU data a value for changing the extraction radius. The value provided is the number of PSF FWHMs to use for the extraction radius. Values accepted are between 0.5 to 3.0. The default extraction size is set to 2 * FWHM. Values below 2 will result in a smaller radius, a value of 2 results in no change to the radius and a value above 2 results in a larger extraction radius.
Switch to toggle extraction of SOSS data with the ATOCA algorithm. WARNING: ATOCA results not fully validated, and require the photom step be turned off. Default is False, meaning SOSS data use box extraction.
Threshold value above which a pixel will be included when modeling the SOSS trace in ATOCA. Default is 0.01.
Oversampling factor of the underlying wavelength grid when modeling the SOSS trace in ATOCA. Default is 2.
Rotation applied to the reference files to match the observation orientation. Default is None.
The regularization factor used for extraction in ATOCA. If left to default value of None, ATOCA will find an optimized value.
Aperture width used to extract the SOSS spectrum from the decontaminated trace in ATOCA. Default is 40.
Method used to handle bad pixels, accepts either “model” or “masking”. Default method is “model”.
Filename or SpecModel of the estimate of the target flux. The estimate must be a SpecModel with wavelength and flux values.
str or SpecModel or None
Filename or SossWaveGrid containing the wavelength grid used by ATOCA to model each pixel valid pixel of the detector. If not given, the grid is determined based on an estimate of the flux (soss_estimate), the relative tolerance (soss_rtol) required on each pixel model and the maximum grid size (soss_max_grid_size).
str or SossWaveGrid or None
The relative tolerance needed on a pixel model. It is used to determine the sampling of the soss_wave_grid when not directly given.
Maximum grid size allowed. It is used when soss_wave_grid is not provided to make sure the computation time or the memory used stays reasonable.
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.
Execute the step.
- class_alias = 'extract_1d'¶
- reference_file_types = ['extract1d', 'apcorr', 'wavemap', 'spectrace', 'specprofile', 'speckernel']¶
smoothing_length = integer(default=None) # background smoothing size bkg_fit = option("poly", "mean", "median", None, default=None) # background fitting type bkg_order = integer(default=None, min=0) # order of background polynomial fit bkg_sigma_clip = float(default=3.0) # background sigma clipping threshold log_increment = integer(default=50) # increment for multi-integration log messages subtract_background = boolean(default=None) # subtract background? use_source_posn = boolean(default=None) # use source coords to center extractions? center_xy = float_list(min=2, max=2, default=None) # IFU extraction x/y center apply_apcorr = boolean(default=True) # apply aperture corrections? ifu_autocen = boolean(default=False) # Auto source centering for IFU point source data. ifu_rfcorr = boolean(default=False) # Apply 1d residual fringe correction ifu_set_srctype = option("POINT", "EXTENDED", None, default=None) # user-supplied source type ifu_rscale = float(default=None, min=0.5, max=3) # Radius in terms of PSF FWHM to scale extraction radii soss_atoca = boolean(default=True) # use ATOCA algorithm soss_threshold = float(default=1e-2) # TODO: threshold could be removed from inputs. Its use is too specific now. soss_n_os = integer(default=2) # minimum oversampling factor of the underlying wavelength grid used when modeling trace. soss_wave_grid_in = input_file(default = None) # Input wavelength grid used to model the detector soss_wave_grid_out = string(default = None) # Output wavelength grid solution filename soss_estimate = input_file(default = None) # Estimate used to generate the wavelength grid soss_rtol = float(default=1.0e-4) # Relative tolerance needed on a pixel model soss_max_grid_size = integer(default=20000) # Maximum grid size, if wave_grid not specified soss_transform = list(default=None, min=3, max=3) # rotation applied to the ref files to match observation. soss_tikfac = float(default=None) # regularization factor for NIRISS SOSS extraction soss_width = float(default=40.) # aperture width used to extract the 1D spectrum from the de-contaminated trace. soss_bad_pix = option("model", "masking", default="masking") # method used to handle bad pixels soss_modelname = output_file(default = None) # Filename for optional model output of traces and pixel weights
Execute the step.
input (JWST data model) –
This will be
input_modelif the step was skipped; otherwise, it will be a model containing 1-D extracted spectra.
- Return type:
JWST data model