extract_one_slit
- jwst.extract_1d.extract.extract_one_slit(data_model, integration, profile, bg_profile, nod_profile, extract_params)[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 inprofile
. Otherwise,nod_profile
should be None.- extract_paramsdict
Parameters read from the extract1d reference file, as returned by
get_extract_parameters
.
- Returns:
- sum_fluxndarray, 1-D, float64
The 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”). Dividesum_flux
bynpixels
(to compute the average) to get the array for the “surf_bright” (surface brightness) output column.- f_var_rnoisendarray, 1-D
The extracted read noise variance values to go along with the sum_flux array.
- f_var_poissonndarray, 1-D
The extracted poisson variance values to go along with the sum_flux array.
- f_var_flatndarray, 1-D
The extracted flat field variance values to go along with the sum_flux array.
- backgroundndarray, 1-D
The background count rate that was subtracted from the sum of the source data values to get
sum_flux
.- b_var_rnoisendarray, 1-D
The extracted read noise variance values to go along with the background array.
- b_var_poissonndarray, 1-D
The extracted poisson variance values to go along with the background array.
- b_var_flatndarray, 1-D
The extracted flat field variance values to go along with the background array.
- npixelsndarray, 1-D, float64
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, 2-D, float64
A 2D model of the flux in the spectral image, corresponding to the extracted aperture.
- residualndarray, 2-D, float64
Residual image from the input minus the scene model.