get_extract_parameters
- jwst.extract_1d.extract.get_extract_parameters(ref_dict, input_model, slitname, sp_order, meta, smoothing_length=None, bkg_fit=None, bkg_order=None, subtract_background=None, use_source_posn=None, position_offset=0.0, model_nod_pair=False, optimize_psf_location=False, extraction_type='box', psf_ref_name='N/A')[source]
Get extraction parameter values.
- Parameters:
- ref_dictdict or None
For an extract1d reference file in JSON format,
ref_dict
will be the entire contents of the file. If there is no extract1d reference file,ref_dict
will be None.- input_modelJWSTDataModel
This can be either the input science file or one SlitModel out of a list of slits.
- slitnamestr
The name of the slit, or “ANY”.
- sp_orderint
The spectral order number.
- metaObjectNode
The metadata for the actual input model, i.e. not just for the current slit, from input_model.meta.
- smoothing_lengthint or None, optional
Width of a boxcar function for smoothing the background regions. If None, the smoothing length will be retrieved from
ref_dict
, or it will be set to 0 (no background smoothing) if this key is not found inref_dict
. Ifsmoothing_length
is not None, that means that the user explicitly specified the value, so that value will be used. This argument is only used if background regions have been specified.- bkg_fitstr or None, optional
The type of fit to apply to background values in each column (or row, if the dispersion is vertical). The default ‘poly’ results in a polynomial fit of order
bkg_order
. Other options are ‘mean’ and ‘median’. If ‘mean’ or ‘median’ is selected,bkg_order
is ignored.- bkg_orderint or None, optional
Polynomial order for fitting to each column (or row, if the dispersion is vertical) of background. If None, the polynomial order will be retrieved from
ref_dict
, or it will be set to 0 if not found inref_dict
. A value of 0 means that a simple average of the background regions, column by column (or row by row), will be used. Ifbkg_order
is not None, that means that the user explicitly specified the value, so that value will be used. This argument must be positive or zero, and it is only used if background regions have been specified.- subtract_backgroundbool or None, optional
If False, all background parameters will be ignored.
- use_source_posnbool or None, optional
If True, the target and background positions specified in
ref_dict
(or a default target position) will be shifted to account for the actual source location in the data. If None, a default value will be set, based on the exposure type.- position_offsetfloat or None, optional
Pixel offset to apply to the nominal source location. If None, the value specified in
ref_dict
will be used or it will default to 0.- model_nod_pairbool, optional
If True, and if
extraction_type
is ‘optimal’, then a negative trace from nod subtraction will be modeled alongside the positive source, if possible.- optimize_psf_locationbool
If True, and if
extraction_type
is ‘optimal’, then the source location will be optimized, via iterative comparisons of the scene model with the input data.- extraction_typestr, optional
Extraction type (‘box’ or ‘optimal’). Optimal extraction is only available if
psf_ref_name
is not ‘N/A’. If set to None, optimal extraction will be used ifuse_source_posn
is True.- psf_ref_namestr, optional
The name of the PSF reference file, or “N/A”.
- Returns:
- extract_paramsdict
Information copied from
ref_dict
. The items will be selected based onslitname
andsp_order
. Default values will be assigned ifref_dict
is None.