8.5 Extraction and Calibration of Spectra

Because there is no slit in the WFC3 grism mode, the PSF of the target determines the spectral resolution. In the case of non-stellar sources, it is the extent of the target in the direction of dispersion that limits the spectral resolution. The height of the software extraction slit is based on the object extent in the cross-dispersion direction of the direct image.

The dispersion of the grisms is well characterized, but in order to set the wavelength zero-point, it is necessary to know the position of the target in the direct image. The zeroth-order is generally too weak and is also slightly extended in a dispersed image to allow the wavelength zero-point to be set reliably. Given the typical spacecraft jitter, wavelength zero-points to ±0.5 pixels should be routinely achievable using a direct image taken just before or after the grism image.

Initially, a spectral extraction software package, called aXe, was made available to extract, flat-field, wavelength- and flux-calibrate WFC3 grism spectra. A separate software package, hstaxe, which is a follow-up to aXe, can now be used to extract and calibrate one-dimensional spectra from WFC3 grism exposures. Python Jupyter notebooks illustrating the extraction and calibration workflow for both UVIS and IR grisms are available in the WFC3 section of the hstaxe Github repository. Additionally, at the end of 2023, STScI released a preliminary version of slitlessutils, a new Python package for extracting and simulating wide-field slitless spectroscopy for WFC3 and ACS. An implementation of the LINEAR algorithm developed for fields of multiple orients (WFC3 ISR 2018-13), slitlessutils also includes a modified version of the aXe extraction for fields with a single orient. Several accompanying utility functions can be used to preprocess grism data (e.g. astrometric updates, background subtraction, and cosmic ray rejections) and thereby improve the final calibrated extractions.

The spectral trace and dispersion solutions are a function of source position within the field of view. These 2-dimensional variations were determined during the ground calibration campaigns and from on-orbit data. The resulting reference and calibration files are available on the WFC3 Grism Resources webpage. For bright sources, the multiple spectral orders of the G280, G102, and G141 grisms may extend across the full detector extent. Therefore, a careful selection of the optimum telescope roll angle is required to obtain non-overlapping spectra of faint sources in the vicinity of brighter objects. i.e., the observer needs to set the orientation of the detector on the sky by using the Visit Orientation Requirements parameter “ORIENT” in the Phase II; e.g. ORIENT ~135 degrees aligns the Y axis of the IR detector with North. See Section 6.2.2 of the Phase II Proposal Instructions, which gives detailed information on the relationship between detector coordinates, spacecraft coordinates, and ORIENT, and works out this example for aperture GRISM1024 (ORIENT = 135.3). Using the information in that section, one finds ORIENT ranging from 135.12 to 135.32 for the IR GRISM apertures (used for the grism exposures and matching reference images) and ORIENT = 135.17 for the G280 and G280-REF apertures). Note that any ORIENT requirement must be specified in the proposal Phase I in the "Special Requirements" section (see also the news section in the Phase I proposal instructions).

The quality of extracted spectra from single grism exposures can be degraded by bad pixels (e.g., dead, hot, strong cosmic ray hit). We recommend a dithering strategy for grism exposures. The hstaxe software automatically takes dither steps into account by using the information in the image headers to produce a combined spectrum with cosmic rays and bad pixels removed, while the new slitlessutils package provides cosmic ray mitigation via a preprocessing step 

UVIS Grism Extraction

The hstaxe packaage can be used to locate and extract slitless spectra of individual sources from calibrated G280 images, and perform wavelength calibration, background subtraction, flat fielding, and absolute flux calibration for the extracted spectra. 

Characterizing and minimizing the background light is necessary to optimize spectral extraction. WFC3 ISR 2023-06 presented the first background sky images for G280 (Figure 8.8), now available to download from the UVIS Grism Sky Images webpage. A single component was determined to be sufficient to model the scattered light, primarily originating from zodiacal light. While Earth limb angle, sun altitude, and sun angle were found to impact the background level, no additional spectral components attributable to OII emission in Earth's atmosphere were detected. Additionally, it was found that stray light scatters similarly regardless of component source.

These background sky calibration frames can be used as input in the hstaxe spectral extraction software by setting background subtraction to True using the backgr keyword and defining the path to the G280 sky frames using the backims keyword (see the G280 extraction cookbook for an in-depth tutorial on using hstaxe to extract spectra from G280 exposures). 

Figure 8.8: G280 background sky for UVIS 1 and UVIS 2 derived from individual flat-fielded, CTE-corrected science exposures (from WFC3 ISR 2023-06).


IR Grism Extraction

Extraction of WFC3/IR slitless spectra depends on an accurate determination of the diffuse background light that is observed in all grism exposures. The two-dimensional structure in the background of WFC3/IR grism exposures is caused primarily by overlapping grism spectral orders that are vignetted at different locations within the detector field of view and by the spectrum of the diffuse background. Both hstaxe and slitlessutils can be used to locate and extract spectra of individual sources from calibrated images and perform wavelength calibration, background subtraction, flat fielding, and absolute flux calibration for the extracted spectra. For examples of how to preprocess WFC3/IR data and extract 1D spectra, see the hstaxe Jupyter notebooks.

A more accurate background subtraction can be achieved by using separate images for each of these background components: zodiacal light, He I emission, and scattered light. These components are shown for G102 and G141 in Figure 8.9 and Figure 8.10, respectively. The He I component is due to a 1.083 µm emission line in the Earth’s upper atmosphere and often appears in exposures obtained while the spacecraft is outside of the earth’s shadow (see Section 7.9.5). The intensity of this airglow line varies on timescales of an orbit or even a single sample sequence. Scattered light produces a different structure, having bypassed the grism to reach the detector. WFC3 ISR 2015-17 presented a file containing all three component images for G141 and two of the component images for G102 (zodiacal light and He I emission) and an algorithm for applying them to observed WFC3/IR grism data. Images of all three background components for both IR grisms and software to background-subtract grism datasets are now available on the WFC3 Grism Resources webpage. Further discussion of the modeling and removal of background components are given in WFC3 ISR 2017-01 and WFC3 ISR 2020-04. See WFC3 ISR 2023-07 for more details regarding background subtraction with hstaxe.

Figure 8.9: Background components for G102.



Figure 8.10: Background components for G141.