9.3 Spectroscopy

9.3.1 Using the WFC3 Grisms

WFC3 contains three grism elements: the G280 in the UVIS channel and the G102 and G141 in the IR channel. The grisms provide slitless spectra over the whole field of view of each channel. These spectroscopic modes have the well-known advantages and disadvantages of slitless spectroscopy. The chief advantage is large-area coverage, which enables spectroscopic surveys. Among the disadvantages are overlap of spectra, high background from the integrated signal over the passband, and modulation of the resolving power by the sizes of dispersed objects.

In the UVIS channel, the G280 grism provides spectroscopy over a useful wavelength range of 200-400nm, at a dispersion of ~14 Å per pixel in the first order. The two grisms for the IR channel cover the wavelength ranges 800-1150 nm (G102) and 1075-1700 nm (G141). The dispersions are 24.5 and 46.5 Å per pixel, respectively. The primary aim of the reduction of WFC3 slitless spectra is to provide one-dimensional wavelength- and flux-calibrated spectra of all objects with detectable spectra. The reduction presents special problems because of the dependence of the wavelength zero point on the position of the object in the field, the blending of spectra in crowded fields, and the need for flat-field information over the whole available wavelength range. hstaxe (Section 9.5.5.1), the python version of the original aXe software package, is designed for the automated extraction, calibration, visualization, and simulation of spectra from slitless spectroscopic instruments. The aXe package was originally developed by the Space Telescope - European Coordinating Facility (ST-ECF), a former department of the European Space Agency (ESA). 

A cookbook-style notebook provides an example of extracting spectra using hstaxe. The WFC3 Grism Spectroscopy page provides additional information.

A slitless Spectroscopy Workshop was held at STScI in November, 2010, with a focus on using the original aXe, now hstaxe, software. The webcast for this event can be found at:
https://cloudproject.hosted.panopto.com/Panopto/Pages/Viewer.aspx?id=bce5e1a4-7165-45f8-b34b-a98100d9ce62
 
The normal method for taking WFC3 slitless spectra is to take a pair of images, one direct and one dispersed, of each target field, without a shift in position between the two. The direct image provides the reference position for the spectrum and thus sets the pixel coordinates of the wavelength zero point on the dispersed image.

The WFC3 UVIS and IR grisms have some unique properties that result in different types of issues associated with data for the two different channels. These are discussed in more detail below. Some common issues associated with all WFC3 grism observations are highlighted here.

Bright Stars

The brightest objects produce spectra that can extend far across the detector. This is especially problematic for the UVIS G280 grism, where the relative throughput of the higher spectral orders is significant. These spectra provide a strong source of contamination for fainter sources. In addition, the higher order spectra are increasingly out of focus and thus spread in the cross-dispersion direction. Bright stars also produce spatially extended spectra formed by the wings of the PSF.

Resolution and Object Size

In slitless spectroscopy the object itself provides the ‘slit’. The WFC3 PSF has a high Strehl ratio over most of the accessible wavelength range of the grisms and therefore the degradation of point sources beyond the theoretical resolution is minimal. The spectral resolution for an extended object, however, will be degraded depending on the size and light distribution in the object and spectral features will be diluted.

Zeroth Order

The grism 0th order is only detectable for brighter objects observed with the IR grisms because that order contains only a small fraction of the total flux. This faint feature is therefore easily mistaken for an emission line. The direct image can be used to determine the position of the 0th order for each source, which allows the 0th order feature in the dispersed images to be distinguished from emission lines. For the UVIS G280 grism, the 0th order has high throughput and is therefore more readily distinguished from emission features. The high throughput of the G280 0th order also means that it will often be saturated in long exposures, which leads to CCD charge bleeding and potential contamination of adjacent spectra.

Background

The background in a single grism image pixel is the result of the transmission across the whole spectral range of the disperser and can therefore be high, depending on the spectrum of the background signal. The IR grism background includes not only signal from the sky, but also thermal emission from the telescope and WFC3 optics. The detected background in the IR grisms shows a distinct two-dimensional structure that is due to the overlapping of the background spectral orders. This background needs to be carefully removed before extracting the spectra of targets (WFC3 ISR 2020-04). The G280 grism, on the other hand, produces relatively low background compared to the IR grisms, because of the faintness of the sky in the near-UV and optical.

Crowding

Because of the high sensitivities of the WFC3 grisms, observations of moderately crowded fields can produce many instances where spectra overlap. It is important to know if a given spectrum is contaminated by that of a neighbor. This can be determined by performing simulations of the grism image with software such as aXesim using a catalog of position, brightness, and angular extent of sources in the field. The simulations can be used to choose a telescope roll angle which eliminates or minimizes contamination for specific sources of interest. Contamination can also be mitigated by obtaining grism observations of the same field at different telescope roll angles, which improves the chances of cleanly extracting the spectrum for a given target. 

Extra-field Objects

There will inevitably be cases where objects outside the field of view result in spectra getting dispersed into the field, resulting in contamination of sources within the field. This is more serious for the G280 where the spectra are long relative to the size of the detector (WFC3 ISR 2020-09). In such cases reliable wavelengths can not be determined for the extra-field object unless the 0th order is also present. Even then, the wavelength zero point will be relatively uncertain because the 0th order is somewhat dispersed and therefore difficult to localize. The extent of the out-of-field area has been determined for the G102 and G141 IR grisms: extending to pixel -189 on the left of the detector and +85 on the right (WFC3 ISR 2016-15).

9.3.2 Pipeline Calibration

The direct image of a direct-plus-grism image pair can be fully reduced by calwf3, including bias subtraction, dark subtraction, flat fielding, and computation of the photometric zero point in the header. In contrast to direct images, no single flat-field image can be correctly applied to grism images, because each pixel contains signal arising from different wavelengths. Flat fielding must therefore be applied during the extraction of spectra once the wavelength corresponding to each pixel is known from post-pipeline processing with aXe. With aXe, the user can apply flat-field corrections which are dependent on the wavelength falling on each pixel, as specified by the position of the direct image and the dispersion solution. So during calwf3 processing the FLATCORR step is still performed, but the division is done using a special flat-field reference file that only contains information on the relative gain offsets between the different detector amplifier quadrants. This allows the FLATCORR step to still apply the gain correction (converting the data to units of electrons for UVIS or electrons per second for IR) and thus also corrects for offsets in gain between the various quadrants of the detectors.

The calwf3 flt products should then be the starting point for all subsequent reduction of slitless data with aXe or other software. The units of the data in the SCI and ERR extensions of these files are electrons for UVIS and electrons per second for IR. The primary output of aXe is a file of extracted, flux calibrated spectra, provided as a FITS binary table with as many table extensions as there are extracted spectra.

9.3.3 Slitless Spectroscopy Data and Dithering

The common approach to dithering WFC3 imaging data, in order to improve the sampling of the PSF and to allow for the removal of bad pixels, applies equally well to slitless spectroscopy data. For long grism observations the data taking is typically broken into several sub-orbit, dithered exposures.

The AstroDrizzle task, which is normally used to correct for the geometrical distortion of WFC3 and combine dithered exposures, is not generally applicable to grism observations. This is due to the fact that the spatial distortion correction would only be applicable to the cross-dispersion direction of grism images. For similar reasons, the combining of dithered grism images before extracting spectra is not generally recommended. Every detector pixel has a different spectral response, which has not yet been corrected in the calibrated two-dimensional images (see Section 9.3.2 on flat fielding). Combining dithered grism images before extraction will combine data from different pixels, making it difficult or impossible to reliably flat field and flux-calibrate the extracted spectra. Extracted spectra from dithered images can be properly combined into a final spectrum using the aXedrizzle task in the aXe package.

AstroDrizzle processing of dithered grism exposures can, however, be useful for simple visual assessment of spectra in a combined image and for the purpose of flagging cosmic-ray (CR) hits in the input flt images. When AstroDrizzle detects CR’s in the input images it inserts flags to mark the affected pixels in the DQ arrays of the input flt files. The aXe spectral extraction can then be run on these updated flt images utilizing the DQ flags to reject bad pixels. This is very useful for rejecting the large number of CR hits that occur in long UVIS G280 exposures. It is not as necessary for IR grism images, because the IR flt files have already had CR’s rejected by the calwf3 up-the-ramp fitting process.

9.3.4 Spectroscopy with the WFC3 G280 Grism

The filters most often used for obtaining a direct image in tandem with the G280 grism are the F300X and F200LP. The direct image provides the reference position for the spectrum and thus sets the pixel coordinates of the wavelength zero point on the dispersed image. The G280 wavelength zero point is generally calibrated to an accuracy of about 1 pixel. It is not possible to use the 0th order image of a source in a G280 exposure to establish the source position, because the 0th order is somewhat dispersed.

Spectra produced by the G280 grism are oriented in WFC3 images with the positive spectral orders to the left (lower x-axis pixel index) of the 0th order spot, with wavelength increasing to the left. Negative orders are located to the right, with wavelength increasing to the right. The +1st order extends to the left of the 0th order a distance of about 1/4 of the image width. The throughput of the +1st order of the G280 is only somewhat larger than that of higher orders and of the negative orders. This leads to heavy overlap of the orders at wavelengths greater than ~400nm. In addition, there is curvature of the spectra at the blue ends of the orders. The amplitude of the curvature is about 30 pixels in the detector y-axis. Due to the relatively significant throughput of the higher orders, the spectra of very bright objects may extend across nearly the entire field of view of the detector. See WFC3 ISR 2009-01 for more details on the characteristics and calibration of the G280 grism.

As an example, Figure 9.8 shows a G280 image of the Wolf-Rayet star WR-14, which is used as a wavelength calibrator. Superimposed on the dispersed image is a F300X image, which illustrates the relative location of the direct image of the source (circled in Figure 9.8). The full 4096-pixel x-axis extent of the detector is shown, which is completely filled by the positive and negative orders of this bright source.

Figure 9.8: Appearance of the G280 spectral orders on the detector. The circled source is the superimposed position of the F300X direct image. The 0th order is the bright source in the center, with the positive and negative orders extending to the left and right, respectively. The image shows the full 4096-pixel extent of the detector in the x-axis.



Figure 9.9 shows a zoomed view of the first several positive spectral orders of this source, where wavelength increases to the left. Notice how the blue end of each order curves upwards, and that at longer wavelengths (greater than ~400nm) there is significant overlap of adjacent orders. Very bright sources produce spectra in which orders up to 6-8 can be detected. These spectra, which in principle can be analyzed (although dispersion solutions have been determined for only the first few orders), provide a strong source of contamination for the spectra from fainter objects. In addition, the higher order spectra are increasingly out of focus and thus spread in the cross-dispersion direction.

Figure 9.9: Zoomed view of the G280 positive spectral orders. Overlap between the +1st and +2nd orders occurs for wavelengths greater than about 400nm.


9.3.5 Spectroscopy with the WFC3 IR Grisms

The dispersion of the G102 grism is high enough that only the +1st and +2nd order spectra generally lie within the field of the detector. For the lower-dispersion G141 grism, the 0th, +1st, +2nd, and +3rd order spectra lie within the field for a source that has the +1st order roughly centered. The IR grisms have the majority (~80%) of their throughput in the +1st order, resulting in only faint signals from the other orders. The trace of the observed spectra are well described by a first-order polynomial, however the direct-to-dispersed image offset is a function of the source position in the field. The tilt of the spectra relative to the image axes are small, being only 0.5-0.7 degrees. Typical filters used for obtaining companion direct images are the F098M and F105W for the G102, and the F140W and F160W for the G141. Other medium- and narrow-band filters can be used when necessary to prevent saturation of very bright targets. The image centroids of sources at a given telescope pointing will depend on the filter used. These filter-dependent systematic variations, which are documented in WFC3 ISR 2012-01, are generally at the sub-pixel level, but must be taken into account during the spectral extraction and reduction process, if the filter that is used to take the direct images is different from the filter in which the trace is calibrated. Version 4.32 of the G102 and G141 grism configuration files now include filter specific configuration files which include the direct filter wedge corrections.

The dispersion direction of the IR grisms is opposite to that of the G280, with the positive spectral orders appearing to the right of the 0th order and wavelength also increasing to the right. Examples of G102 and G141 observations of the flux calibration standard star GD153 are shown in Figure 9.10 and Figure 9.11 respectively.

Figure 9.10: A G102 grism observation of the star GD-153. The location of the source in the accompanying direct image is shown superimposed. The entire x-axis extent of the detector is shown.


Figure 9.11: A G141 grism observation of the star GD-153. The location of the source in the accompanying direct image is shown superimposed. The entire x-axis extent of the detector is shown.


9.3.6 Extracting and Calibrating Slitless Spectra

The software package aXe provides a streamlined method for extracting spectra from WFC3 slitless spectroscopy data. aXe is distributed as part of the Anaconda package. More information can be found at http://axe-info.stsci.edu/

There is a detailed aXe manual and a cookbook specific to WFC3 grism data reduction, both of which are available from the aXe webpages, so only a brief outline of its use is presented here. Other software packages are also available and a current list can be obtained from:
http://www.stsci.edu/hst/instrumentation/wfc3/documentation/grism-resources#section-989789e7-6af1-472b-b41f-c1e6aad45566.

9.3.7 Reducing WFC3 grism data

The basic steps involved in extracting spectra from grism images are:

  • Make a direct image source catalog. This step consists of identifying and cataloging sources from a direct image in the field of the grism image. The source positions and sizes are used later to define extraction boxes and calculate wavelength solutions in the extraction step. The source information is often derived from an AstroDrizzle combination of direct images.
  • Prepare the grism images and remove sky background. In this step a scaled master sky background image is subtracted from the grism images.
  • Project master source catalog positions to coordinate system of direct images. If the source catalog was derived from dithered or drizzled direct images, then the catalog positions need to be transformed back to the coordinate system of each direct image.
  • Extract sets of pixels for each object spectrum. The spectra of all objects in the transformed catalog are extracted from each grism image.
  • Combine all spectra of each object using aXedrizzle. All 2-dimensional spectra for each object are combined and CR-rejected using drizzle techniques. The results are 2-d spectral images and 1-d tables.

The starting point is always a set of dispersed slitless images and the derived catalog of objects in the images. Information about the location of the spectra relative to the position of the direct image, the tilt of the spectra on the detector, the dispersion solution for various orders, the name of the flat-field image and the sensitivity (flux per Å per electron per second) table are stored in a configuration file, which enables the full calibration of extracted spectra. For each instrumental configuration, the configuration files and all necessary calibration files for flat fielding and flux calibration can be downloaded from the WFC3 instrument website (http://www.stsci.edu/hst/instrumentation/wfc3/documentation/grism-resources).

Background Subtraction

aXe has two different strategies for removal of the sky background from the spectra. The first strategy is to perform a global subtraction of a scaled ''master sky'' frame from each input grism image at the beginning of the reduction process. This removes the background signature from the images, so that the remaining signal can be assumed to originate from the sources only and is extracted without further background correction in the aXe reduction. Master sky frames are available for download from the aXe webpage.

The second strategy is to make a local estimate of the sky background for each beam by interpolating between the adjacent pixels on either side of the beam. In this case, an individual sky estimate is made for every beam in each science image. This individual sky estimate is processed (flat fielded, wavelength calibrated) parallel to the original beam. Subtracting the 1D spectrum extracted from the sky estimate from the 1D spectrum derived from the original beam results in the pure object spectrum. The second approach needs to account for the fact that the background of an observation can vary during the course of an observation. As is the case for direct imaging, there can be a significant amount of dispersed HeI light as part of the background. Steps to mitigate this problem are described in WFC3 ISR 2017-05. An updated discussion of variable background subtraction methods for the IR grisms and an improved set of dispersed background models are provided in WFC3 ISR 2020-04.

Output Products: Extracted Spectra

The primary output of aXe is a file of extracted and calibrated spectra, which is provided as a multi-extension FITS binary table with as many table extensions as there are extracted spectra. The table contains 15 columns, including wavelength, total and extracted and background counts and their errors, the calibrated flux and error, the weight and a contamination flag. The primary header of this "SPC" table is a copy of the header of the frame from which the spectrum was extracted

aXe also creates a 2-d “stamp” image for each beam. The stamp images of all spectra extracted from a grism image are stored as a multi-extension FITS (STP) file with each extension containing the image of a single extracted spectra. It is of course also possible to create stamp images for 2-d drizzled grism images.

Handling the aXe Output

The output products from aXe consist of ASCII files, FITS images and FITS binary tables. The FITS binary tables can be accessed using the tasks in the stsdas.ttools package and wavelength-flux plots, with error bars, can be plotted using stsdas.graphics.stplot.sgraph.

When there are many detected spectra on a single image, a dedicated task aXe2web is available. aXe2web creates html pages consisting of direct image cut outs, stamp images and 1-d spectra for each extracted beam. This enables convenient browsing of large numbers of spectra or the publishing of aXe spectra on the Web with minimal interaction.

Examples of these products can be found via the Hubble Legacy Archive. The ST-ECF ACS/WFC Grism Final Release (July 6, 2010) on the HLA page above contains 47919 extractions from 32149 unique objects that have been uniformly reduced by the ECF team using the aXe software

9.3.8 Accuracy of Slitless Spectra Wavelength and Flux Calibration

Wavelength Calibration

The WFC3 grism dispersion solutions were established by observing both astronomical sources with known emission lines (e.g., the Wolf-Rayet star WR-14 and the planetary nebula Vy2-2; see WFC3 ISR 2009-17, 2009-18) and ground-based monochromator sources (see WFC3 ISR 2009-01 and ISR 2008-16). The field variation of the dispersion solution was mapped by observing the same source at different positions over the field. The internal accuracy of these dispersion solutions is good to ~0.25 pixels for the IR grisms (~6Å and ~9Å for the G102 and G141, respectively), and to ~1 pixel (~14Å) for the UVIS G280.

For a given object the accuracy of the assigned wavelengths depends most sensitively on the accuracy of the zero point and the transfer of the zero point from the direct to the slitless spectrum image. Provided that both direct and slitless images were taken with the same set of guide stars, systematic pointing offsets less than 0.2 pixels can be expected. For faint sources the error on the determination of the object centroid for the direct image will also contribute to wavelength error. Realistic zero point errors of up to 0.3 pixels are representative. The wavelength calibration of the G102, G141 and G280 grisms were recently updated (WFC3 ISR 2017-15 and WFC3 ISR 2020-09). The new aXe format calibration files also include the filter dependent wedge offsets that should be applied when pairing G102 and G141 observations with imaging obtained using a specific direct filter.

Flux Calibration

The sensitivity of the dispersers was established by observing a spectrophotometric standard star at several positions across the field. The sensitivity (aXe uses a sensitivity tabulated in erg cm-2 s-1 Å-1 per detected electron) was derived using data flat fielded by the flat-field cube. Results for the IR grisms show 4-5% differences in the absolute flux of spectra located near the center of the field as compared to those near the field corners. This is clear evidence for a large-scale variation in the overall illumination pattern in the grism flat-field data cubes. Additional field-dependent flux calibration observations are planned, which will enable such corrections to be implemented.

UVIS Flux Calibration

The sensitivity of the G280 grism was established by observing a spectrophotometric standard star at several positions across the field. The sensitivity (aXe uses a sensitivity tabulated in erg cm-2 s-1 Å-1 per detected electron) was derived using data flat fielded by the flat-field cube. Please check the WFC3 Instrument Science Reports for updates. The results of a full calibration of the WFC3 UVIS G280 slitless spectroscopic mode from the entire G280 calibration data (nearly 600 datasets) obtained by 2020 are detailed in WFC3 ISR 2020-09.

IR Flux Calibration

The sensitivities of the G102 and G141 grisms were established by observing the white dwarf spectrophotometric standard stars GD153 and GD71 at several positions across the field (for example, see WFC3 ISRs 2009-17, 2009-18, and 2011-05).

The flux calibration is primarily based on observations of GD153 at the center of the detector. Variation of the sensitivity over the field-of-view was measured by observing GD71 over a grid of nine points over the detector, which shows that the throughput falls off by about 2% in y direction and by about 4% in x direction to the edges of the FoV. The large-scale variation is included in the grism flat-field cube (see WFC3 ISR 2011-05). Regular monitoring of the flux calibration is performed, and has shown that the calibration has been stable to within 1% since the installation of the camera on HST (WFC3 ISRs 2012-06, 2014-01 and 2020-09).

Flux Monitor

The IR grism flux monitor checks the sensitivity of the grisms using observations of CALSPEC white dwarf standards. Recent analysis shows that the relative sensitivity of both grisms is decreasing at a rate of 0.14+/-0.01% per year for G102 and 0.07+/-0.01% per year for G141. This is shown in Figure 9.12 which is an update to the results by Bohlin & Deustua (2019) including three more years of monitoring data. The vertical scatter in the data for a given date is due to dithered observations in the calibration data, designed to sample many different regions of the detector. This scatter will be much smaller for observations with the supported IR grism apertures G102-REF and G141-REF near the center of the detector.

Figure 9.12: Relative photometry of four CALSPEC white dwarf flux standards for the two IR grisms. A slight loss in sensitivity of 0.14 percent per year is observed for G102 and 0.07 percent per year for G141.