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_model (JWSTDataModel) – 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.

  • integration (int) – 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.

  • profile (ndarray 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_profile (ndarray 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_profile (ndarray 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_params (dict) – Parameters read from the extract1d reference file, as returned by get_extract_parameters.

Returns:

  • sum_flux (ndarray, 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”). Divide sum_flux by npixels (to compute the average) to get the array for the “surf_bright” (surface brightness) output column.

  • f_var_rnoise (ndarray, 1-D) – The extracted read noise variance values to go along with the sum_flux array.

  • f_var_poisson (ndarray, 1-D) – The extracted poisson variance values to go along with the sum_flux array.

  • f_var_flat (ndarray, 1-D) – The extracted flat field variance values to go along with the sum_flux array.

  • background (ndarray, 1-D) – The background count rate that was subtracted from the sum of the source data values to get sum_flux.

  • b_var_rnoise (ndarray, 1-D) – The extracted read noise variance values to go along with the background array.

  • b_var_poisson (ndarray, 1-D) – The extracted poisson variance values to go along with the background array.

  • b_var_flat (ndarray, 1-D) – The extracted flat field variance values to go along with the background array.

  • npixels (ndarray, 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_model (ndarray, 2-D, float64) – A 2D model of the flux in the spectral image, corresponding to the extracted aperture.

  • residual (ndarray, 2-D, float64) – Residual image from the input minus the scene model.