extract_one_slit

jwst.extract_1d.extract.extract_one_slit(data_model, integration, profile, bg_profile, nod_profile, extract_params, data_attr='data')[source]

Extract data for one slit, or spectral order, or integration.

Parameters:
data_modelJwstDataModel

The input science model. May be a single slit from a MultiSlitModel (or similar), or a single data type, like an ImageModel, SlitModel, or CubeModel.

integrationint

For the case that data_model is a SlitModel or a CubeModel, integration is the integration number. If the integration number is not relevant (i.e., the data array is 2-D), integration should be -1.

profilendarray of float

Spatial profile indicating the aperture location. Must be a 2D image matching the input, with floating point values between 0 and 1 assigning a weight to each pixel. 0 means the pixel is not used, 1 means the pixel is fully included in the aperture.

bg_profilendarray of float or None

Background profile indicating any background regions to use, following the same format as the spatial profile. Ignored if extract_params['subtract_background'] is False.

nod_profilendarray of float or None

For optimal extraction, if nod subtraction was performed, a second spatial profile is generated, modeling the negative source in the slit. This second spatial profile may be passed in nod_profile for simultaneous fitting with the primary source in profile. Otherwise, nod_profile should be None.

extract_paramsdict

Parameters read from the EXTRACT1D reference file, as returned by get_extract_parameters().

data_attrstr

Name of attribute where data array is found. This is typically “data” but can be “contam” when extracting contamination estimates for WFSS data.

Returns:
sum_fluxndarray

The 1D sum of the data values in the extraction region minus the sum of the data values in the background regions (scaled by the ratio of the numbers of pixels), for each pixel. The data values are usually in units of surface brightness, so this value isn’t the flux, it’s an intermediate value. Multiply sum_flux by the solid angle of a pixel to get the flux for a point source (column “flux”). Divide sum_flux by npixels (to compute the average) to get the array for the “surf_bright” (surface brightness) output column.

f_var_rnoisendarray

The 1D extracted read noise variance values to go along with the sum_flux array.

f_var_poissonndarray

The 1D extracted Poisson variance values to go along with the sum_flux array.

f_var_flatndarray

The 1D extracted flat field variance values to go along with the sum_flux array.

backgroundndarray

The 1D background count rate that was subtracted from the sum of the source data values to get sum_flux.

b_var_rnoisendarray

The 1D extracted read noise variance values to go along with the background array.

b_var_poissonndarray

The 1D extracted Poisson variance values to go along with the background array.

b_var_flatndarray

The 1D extracted flat field variance values to go along with the background array.

npixelsndarray

The number of pixels that were added together to get sum_flux, including any fractional pixels included via non-integer weights in the input profile.

scene_modelndarray

A 2D model of the flux in the spectral image, corresponding to the extracted aperture.

residualndarray

Residual 2D image from the input minus the scene model.