extract_grism_objects

jwst.extract_2d.grisms.extract_grism_objects(input_model, grism_objects=None, reference_files=None, extract_orders=None, source_ids=None, source_ra=None, source_dec=None, max_sep=None, mmag_extract=None, compute_wavelength=True, wfss_extract_half_height=None, nbright=None)[source]

Extract 2D boxes around each objects spectra for each order.

Parameters:
input_modelImageModel

Model of the grism image.

grism_objectslist of GrismObject

A list of grism objects.

reference_filesdict

This dictionary must contain the name of the WAVELENGTHRANGE reference file.

extract_ordersint

Spectral orders to extract.

source_idslist

List of source IDs to extract.

source_ralist of float

Source right ascensions to be processed. The nearest matching source to each RA/Dec pair will be extracted. If both source_ids and source_ra/source_dec are provided, the lists will be combined and their union extracted.

source_declist of float

Source declinations to be processed, must have same length as source_ra.

max_sepfloat

Radius in arcseconds within which source_ra and source_dec will be matched to sources in the catalog. If no source is found within this radius, a warning will be emitted and no source will be extracted corresponding to that RA, Dec pair.

mmag_extractfloat

The minimum magnitude extraction cutoff. Sources fainter than this will not be extracted.

compute_wavelengthbool

Compute a wavelength array for the datamodel.

wfss_extract_half_heightint

Cross-dispersion extraction half height in pixels. Overwrites the computed extraction height.

nbrightint

Number of brightest objects to extract.

Returns:
output_modelMultiSlitModel

Output model of extracted spectra.

Notes

This method supports WFSS modes only.

GrismObject is a named tuple which contains distilled information about each catalog object. It can be created by calling create_grism_bbox() which will return a list of GrismObject that contains the bounding boxes that will be used to define the 2D extraction area.

For each spectral order, the configuration file contains a magnitude-cutoff value. The total list of objects to extract is limited by both MMAG_EXTRACT and NBRIGHT. Sources with magnitudes fainter than the extraction cutoff (MMAG_EXTRACT) will not be extracted, but are accounted for when computing the spectral contamination and background estimates; the default value is 99. NBRIGHT further limits the list to the NBRIGHT brightest objects; the default value is 999.

The sensitivity information from the original aXe-style configuration file needs to be modified by the passband of the filter used for the direct image to get the min and max wavelengths which correspond to t=0 and t=1. The min and max wavelengths used to calculate t are stored in the grism WAVELENGTHRANGE reference file.

  1. Convert the source catalog from the reference frame of the uber-image to that of the dispersed image. We assume that the pointing information in the file headers is sufficient. This will be strictly true if all images were obtained in a single visit (same guide stars).

  2. Record source information for each object in the catalog: position (RA, Dec), shape (A_IMAGE, B_IMAGE, THETA_IMAGE), and all available magnitudes, and minimum bounding boxes.

  3. Compute the trace and wavelength solutions for each object in the catalog and for each spectral order. Record this information.

  4. Compute the WIDTH of each spectral subwindow, which may be fixed or variable. The cross-dispersion size is taken from the minimum bounding box.

Each of the virtual slits in the output MultiSlitModel will have its own WCS object that is a copy of the input model’s WCS, but with an additional transform from “grism_slit” to “grism_detector” prepended to it; this transform encodes a shift to the center of the slit and a binding to the slit’s bounding box.