create_grism_bbox

jwst.assign_wcs.util.create_grism_bbox(input_model, reference_files=None, mmag_extract=None, extract_orders=None, source_ids=None, wfss_extract_half_height=None, wavelength_range=None, nbright=None)[source]

Create bounding boxes for each object in the catalog.

The sky coordinates in the catalog image are first related to the grism image. They need to go through the WCS object in order to find the “direct image” pixel location, which is also in a detector pixel coordinate frame. This “direct image” location can then be sent through the trace polynomials to find the spectral location on the grism image for that wavelength and order.

Parameters:
input_modelImageModel

Data model which holds the grism image

reference_filesdict, optional

Dictionary of reference file names. If None, wavelength_range must be supplied to specify the orders and corresponding wavelength ranges to be used in extraction.

mmag_extractfloat, optional

The faintest magnitude to extract from the catalog.

extract_orderslist, optional

The list of orders to extract, if specified this will override the orders listed in the wavelengthrange reference file. If None, the default one in the wavelengthrange reference file is used.

source_idslist, optional

List of source IDs to extract.

wfss_extract_half_heightint, optional

Cross-dispersion extraction half height in pixels, WFSS mode. Overwrites the computed extraction height in GrismObject.order_bounding. If None, it’s computed from the segmentation map, using the min and max wavelength for each of the orders that are available.

wavelength_rangedict, optional

Pairs of {spectral_order: (wave_min, wave_max)} for each order. If None, the default one in the wavelengthrange reference file is used.

nbrightint, optional

The number of brightest objects to extract from the catalog.

Returns:
grism_objectslist

A list of GrismObject(s) for every source in the catalog. Each grism object contains information about its spectral extent.

Notes

The wavelengthrange reference file is used to govern the extent of the bounding box for each object. The name of the catalog has been stored in the input models meta information under the source_catalog key.

It’s left to the calling routine to cut the bounding boxes at the extent of the detector (for example, extract 2d would only extract the on-detector portion of the bounding box).

Bounding box dispersion direction is dependent on the filter and module for NIRCAM and changes for GRISMR, but is consistent for GRISMC, see https://jwst-docs.stsci.edu/display/JTI/NIRCam+Wide+Field+Slitless+Spectroscopy

NIRISS has one detector. GRISMC disperses along rows and GRISMR disperses along columns.

If wfss_extract_half_height is specified it is used to compute the extent in the cross-dispersion direction, which becomes 2 * wfss_extract_half_height + 1. wfss_extract_half_height can only be applied to point source objects.