run_extract1d
- jwst.extract_1d.extract.run_extract1d(input_model, extract_ref_name='N/A', apcorr_ref_name=None, psf_ref_name='N/A', extraction_type='box', smoothing_length=None, bkg_fit=None, bkg_order=None, log_increment=50, subtract_background=None, use_source_posn=None, position_offset=0.0, model_nod_pair=False, optimize_psf_location=True, save_profile=False, save_scene_model=False, save_residual_image=False)[source]
Extract all 1-D spectra from an input model.
- Parameters:
- input_model
JwstDataModel The input science model.
- extract_ref_namestr
The name of the EXTRACT1D reference file, or “N/A”.
- apcorr_ref_namestr or None
Name of the APCORR reference file. Default is None.
- psf_ref_namestr
The name of the PSF reference file, or “N/A”.
- extraction_typestr
Extraction type (‘box’ or ‘optimal’). Optimal extraction is only available if
psf_ref_nameis not “N/A”.- smoothing_lengthint or None
Width of a boxcar function for smoothing the background regions.
- bkg_fitstr or None
Type of fitting to apply to background values in each column (or row, if the dispersion is vertical). Allowed values are ‘mean’, ‘median’, ‘poly’, or None.
- bkg_orderint or None
Polynomial order for fitting to each column (or row, if the dispersion is vertical) of background. Only used if
bkg_fitis ‘poly’. Allowed values are>= 0.- log_incrementint
If
log_incrementis greater than 0 and the input data are multi-integration, a message will be written to the log everylog_incrementintegrations.- subtract_backgroundbool or None
User supplied flag indicating whether the background should be subtracted. If None, the value in the EXTRACT1D reference file will be used. Otherwise, this parameter overrides the value in the reference file.
- use_source_posnbool or None
If
True, the target and background positions specified in the reference file (or the default position, if there is no reference file) will be shifted to account for source position offset.- position_offsetfloat
Number of pixels to shift the nominal source position in the cross-dispersion direction.
- model_nod_pairbool
If
True, and ifextraction_typeis ‘optimal’, then a negative trace from nod subtraction is modeled alongside the positive source during extraction. Even if set toTrue, this will be attempted only if the input data has been background subtracted and the dither pattern indicates that only 2 nods were used.- optimize_psf_locationbool
If
True, and ifextraction_typeis ‘optimal’, then the source location will be optimized, via iterative comparisons of the scene model with the input data.- save_profilebool
If
True, the spatial profiles created for the input model will be returned asImageModel. IfFalse, the return value is None.- save_scene_modelbool
If
True, a model of the 2D flux as defined by the extraction aperture is returned as anImageModelorCubeModel. IfFalse, the return value is None.- save_residual_imagebool
If
True, the residual image (from the input minus the scene model) is returned as anImageModelorCubeModel. IfFalse, the return value is None.
- input_model
- Returns:
- output_model
MultiSpecModelorTSOMultiSpecModel A new data model containing the extracted spectra.
- profile_model
ModelContainer,ImageModel, or None If
save_profileisTrue, the return value is anImageModelcontaining the spatial profile with aperture weights, used in extracting a single slit, or else a container ofImageModel, one for each slit extracted. Otherwise, the return value is None.- scene_model
ModelContainer,ImageModel,CubeModel, or None If
save_scene_modelisTrue, the return value is anImageModelorCubeModelmatching the input data, containing a model of the flux as defined by the aperture, created during extraction. Otherwise, the return value is None.- residual
ModelContainer,ImageModel,CubeModel, or None If
save_residual_imageisTrue, the return value is anImageModelorCubeModelmatching the input data, containing the residual image (from the input minus the scene model). Otherwise, the return value is None.
- output_model