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_dict (dict 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_model (JWSTDataModel) – This can be either the input science file or one SlitModel out of a list of slits.

  • slitname (str) – The name of the slit, or “ANY”.

  • sp_order (int) – The spectral order number.

  • meta (ObjectNode) – The metadata for the actual input model, i.e. not just for the current slit, from input_model.meta.

  • smoothing_length (int 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 in ref_dict. If smoothing_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_fit (str 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_order (int 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 in ref_dict. A value of 0 means that a simple average of the background regions, column by column (or row by row), will be used. If bkg_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_background (bool or None, optional) – If False, all background parameters will be ignored.

  • use_source_posn (bool 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_offset (float 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_pair (bool, 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_location (bool) – 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_type (str, 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 if use_source_posn is True.

  • psf_ref_name (str, optional) – The name of the PSF reference file, or “N/A”.

Returns:

extract_params – Information copied from ref_dict. The items will be selected based on slitname and sp_order. Default values will be assigned if ref_dict is None.

Return type:

dict