Build 2 spectroscopic calibration steps

For Build 2 we plan to deliver steps that produce Level-2b calibrated data from Level-2a slope images for the NIRSpec and MIRI Fixed Slits, MIRI and NIRISS single source slitless, and the MIRI IFU. Level-2b products will contain results from single exposures. Most observing scenarios include multiple, often dithered, exposures for a given target, where the final calibrated 2-d and extracted 1-d spectra will be produced from a combination of the multiple exposures. We will provide the capability of producing rectified 2-d images and extracted 1-d spectra from the individual Level-2b exposures.

Note: A question that arose in recent discussions with the INS working groups, which is not necessarily specific to Level-2b processing, is whether or not to have all spectral images rotated/flipped to a common orientation, such as dispersion along the x-axis (with wavelength increasing with increasing x) and spatial along the y-axis. There's also the question of where in the pipeline flow to perform such a transform. Should it be done already in the Level-1a images or much later such as in this part of the Level-2b pipeline when the rectified 2-d image is produced? If it's done for Level-1a images, then all 2-d reference data (e.g. bad pixel masks, darks, linearity coeffs, flats) will also need to be transformed in the same way.

List of Steps

From the information we have so far, we can envision the following types of processing steps for producing Level-2b products:

  • Extraction of 2-d "stamp" or "cutout" images, when necessary
    • input is a Level-2a slope image
  • Apply flat field and throughput corrections to 2-d images
  • Persistence/Latent correction
  • Straylight correction (MIRI only)
  • Assign WCS to 2-d extracted image
  • Assign Flux conversion/calibration to 2-d image
    • output is Level-2b calibrated slope image
  • Resample 2-d image to rectified space
    • output is Level-2b calibrated and rectified image
  • Extract 1-d spectrum from rectified 2-d image
    • output is Level-2b calibrated spectrum

Input Level-2a Images

The input slope images will come in a variety of formats, depending on the instrument mode.

  • NIRSpec fixed slit images
    • Full frame or subarray readouts
    • Full frame and ALLSLITS subarray contain data from all 5 slits
    • Smaller subarrays that cover a single slit
  • MIRI LRS fixed slit images
    • Always full frame
  • MIRI LRS slitless single source images
    • Always uses SLITLESSPRISM subarray
  • NIRISS single object/exoplanet slitless images
    • Full frame or subarray readouts
    • Default is 256x2048 subarray (covers all 3 orders)
    • 80x2048 subarray (covers 2 partial orders)
  • MIRI MRS (IFU) images
    • Always full frame for both SW and LW detectors

Extract 2-d cutout

NIRSpec full frame and ALLSLITS exposures will require the extraction of 2-d "stamp" or "cutout" images containing only the regions of each individual slit. This will likely require the use of a reference table that will contain the coordinates of the cutout regions for each slit, such as a table that lists the coordinates of the 4 corners of each cutout region. Because we won't necessarily know which of the 5 slits has the object of interest for any given exposure, the default processing scheme will be to always extract and process regions for all 5 slits. This means multiple passes through all the subsequent steps, in order to apply the processing to all 5 cutout images. Having the data from each slit in a separate sub-image also means they can each have a single, unique WCS applied to them.

For NIRISS full frame exposures, the default behavior should be to always extract the region equivalent to the default 256x2048 subarray.

Identifying input images that need extractions performed:


All other modes will leave the native full-frame or subarray exposure as is.

Flat Field and Throughput Correction

Because the spectra from the fixed slits will always fall on about the same position of the detector(s), at least to within a few pixels due to grating wheel slop, the pixel vs. wavelength relation is constant and hence a regular 2-d flat field reference image can simply be divided into the 2-d science image to remove pixel-to-pixel QE variations.

NIRISS will need to use separate flatfield images for the different subarrays, because the location of the source will be different and hence the pixel-to-wavelength mapping is different. Because we will always extract a 256x2048 cutout image from NIRISS full-frame exposures, we should be left with only two standard cases for NIRISS, namely the 256x2048 and 80x2048 subarrays, each of which will have a dedicated flat field reference image.

NIRSpec also plans to use separate flats for each of the 5 fixed slits.

MIRI LRS fixed slit and single source slitless exposures also involve sources at different locations on the detector and hence separate flats will be required.

The MIRI MRS (IFU) mode has special flat fielding needs. It will require the application of 3 separate types of flats: fringe flat, pixel flat, and sky flat. All MIRI MRS flats will be full-frame and divided directly into the full-frame science images.

It therefore appears that, at least for now, all modes will use dedicated flatfield reference images, and hence it will not be necessary to have the capability to extract a subarray from a full-frame flat to apply to a subarray science image. There will be a one-to-one mapping between readout mode and flatfield ref images. Hence all of the new logic will reside strictly within CRDS rmaps, not within the flat field calibration step itself.

Folded into the flatfield reference image will be the larger-scale throughput and blaze function corrections, so that all corrections are achieved by dividing by the flat.

Persistence/Latent Correction

All JWST detectors will be susceptible to persistence (latent signal) from sources in previous exposures. It is not yet clear exactly where a correction for this should be placed in the pipeline flow, nor is an appropriate correction mechanism/algorithm known yet. Correction for sources in previous exposures will naturally require information from or access to the previous exposures. The mechanism for that is completely TBD. It may be sufficient to apply a correction to the slope image produced by ramp fitting (i.e. post Level-2a product), such as this point in the pipeline. It might be necessary, however, to apply a correction to the Ramp data, in which case this correction would be moved to a spot in the Build 1 pipeline flow.

This step will therefore be implemented as a no-op for Build 2, until more is known about how to apply it.

Straylight Correction

At this time only the MIRI team anticipates needing this type of correction, which will be used to correct for or remove stray light that may contaminate the region of the LRS spectrum as a result of bright sources elsewhere in the instrument FOV (e.g. in the imager region).

Until more is known, this step will also be implemented in Build 2 as a no-op.

Assign WCS

This step will consist of adding to the still distorted 2-d spectral image information pertaining to the spatial and wavelength coordinates, such that the coordinates of each pixel can be determined. The exact form of this information is TBD, but will likely consist of a combination of SIP coefficients and distortion maps. This step will only insert all of this information into the image header or additional extensions; it will not apply the information or correct the actual image in any way.

This will involve the use of reference file(s) that contain the appropriate WCS and distortion information for each instrument+detector combination.

Assign Flux Calibration

Using the same philosophy as the previous step, flux calibration information will be assigned to the image, but the image itself will not be modified in any way. The flux calibration information may take the form of a response curve that is either added to the image header or as an additional extension. This information will be used by subsequent steps to convert the data from units of DN/sec to an absolute flux after the image has been rectified to have constant spatial and wavelength axes. It will not be in a form suitable for application to the distorted image.

The flux calibration information may have aperture throughput corrections folded into it. The flux calibration information will be retrieved from a reference file.

The flux calibration could be a single scalar value, inserted as a header keyword, if the relative response as a function of wavelength is folded into the flatfield ref image.

At the end of this step an output product will be saved, consisting of the calibrated, yet still distorted, 2-d spectral image.

Rectify 2-d Image

As a prelude to extraction, the 2-d spectral image will be resampled to an undistorted, rectified image space, where the spatial and wavelength axes will be linear. This will provide a quick-look rectified 2-d image product, as well as a simple 2-d space in which to perform the subsequent 1-d extraction.

Note: If the Level-2a images have not already had transformations applied to place all the spectra in a common orientation, the resampling step here will provide those transforms, so that the rectified images all have common spectral orientations.

Extract 1-d Spectrum

For the purpose of the Build 2 delivery we will implement extraction techniques that work within rectified image space. More sophisticated techniques that work within distorted image space may be developed in the future.

Possible extraction modes are a simple boxcar with a wavelength-dependent aperture size (to follow the changes in PSF size as a function of wavelength) and optimal extraction using model PSFs. For Build 2 we will provide at least a simple boxcar extraction.

Need to decide how the extraction routine will get any necessary parameter values that it needs (e.g. aperture size). This could come from a reference file or step arguments.

Last modified 6 years ago Last modified on 06/12/13 17:28:38