Space Telescope Science Institute
help@stsci.edu
Table of Contents Previous Next Index Print


NICMOS Data Handbook > Chapter 5: Data Analysis > 5.7 Grism Data Reduction

5.7 Grism Data Reduction
The NICMOS camera 3 grisms permit multi-object, slitless, low resolution spectroscopy. The reduction and analysis of NICMOS grism data benefit from decisions made by the user and from careful, interactive examination, and are therefore discussed here rather than in the chapter on pipeline calibration.
Software to extract spectra from NICMOS grism images has been developed at Space Telescope European Coordinating Facility (ST-ECF). Two packages are available: NICMOSlook, which is interactive, and aXe, which is non-interactive. The interactive program, NICMOSlook, provides a number of tools called from an IDL GUI widget. This program is recommended for most extraction because of its versatility and interactive features. The automatic version, aXe, is recommended if an extraction of a large number of spectra from different images is desired. Both software packages, together with user documentation, can be obtained from the ST-ECF Web site. Here we offer only a brief description of grism analysis methodology, and refer the user to the documentation provided with the software for details. The ST-ECF also maintains grism calibration reference files which are included with the software distributions.
The extraction software assumes that grism data are pipeline processed like regular images with the exception that they are not flat fielded by calnica. The flat-field correction for a given pixel depends both on the pixel location (x,y) and on the wavelength of the light which is dispersed onto that pixel. The latter is not known until the location of the dispersed source has been specified, and therefor the flat fielding cannot be done in advance. It is omitted during 2 dimensional data processing through calnica. Later, after 1-dimensional spectra have been extracted from the grism images, the extraction software applies a wavelength dependent correction for QE variations (see Section 5.8.2).
The wavelength calibration for the extraction of spectra requires a direct image corresponding to each grism image. If individual exposures for the grism images are co-added before extraction, a similar co-addition should also be performed for the direct images in order to maintain the relative position of objects in the direct image with the corresponding spectrum in the grism image. If grism and direct images are processed separately by calnicb, this relative registration is, in general, not maintained.
 
In general, combining dithered grism images before extracting spectra is probably not a good idea whenever it can be avoided. As noted above, every pixel on the array has a different spectral response. Combining dithered grism images before extraction will combined data from different pixels, making it difficult or impossible to reliably flux calibrate the resulting spectrum. In general, we recommend to feed individual images direct from calnica to the extraction software.
5.7.1
Detailed software manuals and descriptions of the extraction algorithms can be found at:
http://www.stecf.org/instruments/NICMOSgrism/.
Only a brief summary is given below.
Input Files
The extraction software requires two types of input images, one for object finding, and one which contains the spectra to be extracted. Typically, the former is a direct image of the target field obtained with one of the NICMOS continuum filters, preferably at a wavelength within the range covered by the grism. However, the grism image itself can also be used for object finding, e.g. on the zeroth order spectra. The image which contains the spectra is assumed to be not flat fielded, which is the default in calnica.
In most cases, the input files are the output of calnica (*_cal.fits). The software packages also accept plain FITS images without NICMOS specific extensions, but some functionalities which depend on the error planes (*_cal.fits[err]) or data quality flags (*_cal.fits[dq]) will not be available.
Output Files
The basic output of the extraction are the spectra, which can be written as ASCII or FITS tables, and associated metadata.
5.7.2
Object Detection and Classification
The extraction software programs include automatic finding of objects on the direct images. NICMOSlook uses DAOFIND for that purpose, while aXe uses Sextractor to find and classify objects. In NICMOSlook, objects can also be marked interactively with the cursor.
It may sometimes be useful to use the grism images to search for particular types of spectra “by eye”. In this case, the spectral images can be flat fielded using ordinary, on-orbit grism flat fields, displayed, and examined visually for e.g. emission line objects, or very red spectra. Ordinarily, these on-orbit flat fields are not used as part of NICMOS grism data processing: instead, the flat fielding is done on the extracted spectra, as is described below. Once the interesting objects have been identified, their spectra should be extracted from non flat-fielded grism images.
Location of Spectra
The positions of the direct objects can be used to compute the location and orientation of the spectra. The software packages know the approximate position of spectra relative to the position of the object on the direct image. However, the orientation of spectra varies enough from observation to observation so that a “tracing” of spectra is necessary for accurate spectrum extraction. See the NICMOSlook manual for details.
Background Subtraction
After source identification, an estimate of the two-dimensional background level is derived and removed from each image.
The grism image is not flat-fielded and the QE variations across the NICMOS detectors are strong, implying that a significant structure is present in an image of blank sky. Several options to subtract this background are provided. They include interpolation over the region of the spectra, or subtracting scaled versions of background images. The extraction software determines the regions of interpolation excluding positions occupied by other spectra in the image. The most accurate background subtraction can be achieved if a background image is specially prepared "by hand" from a dithered dataset.
Extraction of Spectra
Flux and Error Bars
Once objects on the images have been detected, their spectra can be extracted. The flux is then given by:
where the sum over the flux gji of all pixels at wavelength λ is performed with weights wji.
Several options for the weights can be used to achieve optimum S/N. Constant weights lead to an optimum extraction for high S/N spectra, while for background limited objects, weights can be derived from the profile of the spectrum to be extracted. The profile can either be determined directly from the spectrum, or predicted from the direct image for very low S/N spectra under the assumption that the shape of the object is independent of wavelength. First, the size and orientation of the object is computed from the direct image.
Since NICMOS grism images are undersampled, spectra of point sources and sources up to the size of a few pixels are best extracted using constant weights even for low S/N spectra.
The error estimate eji for each pixel is propagated from the ERR array of the input grism image. The error estimate ej for each wavelength is then the weighted quadratic sum over the errors of all pixels at constant wavelength.
Wavelength Calibration
The dispersion relation and the deviation of the spectra have been determined from wavelength calibration observations, and are parametrized as:
where x is the deflection in pixels relative to the position of the object in the direct image and λ is the corresponding wavelength. The coefficients are contained in the reference file grismspec.dat for NICMOSlook or in the configuration file (.conf) for aXe. The dispersion relation is given by:
where r is the distance of a pixel (x, y) from the object of coordinates
(xo, yo) and Δy is the deviation in pixels of the spectrum from a horizontal line. The alignment of the spectrum is taken into account by rotating the grism image around the object position (xo, yo) prior to the extraction. The distortions in the spectra are taken into account by introducing a corresponding distortion in the weights used for the extraction. For results from recent grism wave-length calibrations. For further updates please refer to the NICMOS Web page at:
http://www.stsci.edu/hst/nicmos
Flat Fielding of Spectra
After the spectra are extracted, the fluxes are corrected for pixel-to-pixel variations in the quantum efficiency of the detector (i.e., flat fielded). The QE variations depend both on the wavelength and on the position of the object on the detector. Because of this wavelength dependence, the flat fielding cannot be performed before the spectra are extracted and wavelength calibrated. The corrected flux fc(λ) is computed as follows
where q(x,y,λ) are interpolated flat fields. For wavelengths where narrow band flat fields are available, they are used. For other wavelengths, the correction factors are derived through interpolation from a set of monochromatic flat-field images (see Storrs et al. 1999, NICMOS ISR-99-002). The filters used in this process are F108N, F113N, F164N, F166N, F187N, F190N, F196N, F200N, F212N, F215N, and F240M. The most recent flat-field reference files are available at NICMOS dynamic reference files Web pages.
Flux calibration and Correction for Pixel Response Function
Once the spectra are extracted, the count rates in ADU/second are converted to physical units using calibration data form photometric standards P330E and G191B2B.
Undersampling of NICMOS grism images in combination with significant variation of the QE across any given pixel imposes a wave-like pattern onto extracted spectra of point sources and small objects. Since spectra are not exactly aligned with the rows of the images, the exact sub-pixel position and orientation of the spectra determines the phase and period of those waves. A simple model can be used to correct this effect for point sources. Details are discussed in an article by W. Freuding in the May 1999 issue of the ST-ECF Newsletter.
Deblending of Overlapping Spectra
Since the NICMOS grisms are slitless, overlaps among different spectra are likely to happen. The strategy of observing the same target at different telescope roll angles helps remove overlap in many instances.
aXe reports an estimate of the contamination by nearby objects. NICMOSlook includes an algorithm designed to remove or minimize contamination of one spectrum from another. The deblending algorithm is described in detail in the NICMOSlook software manual. The basic requirement for the algorithm to work is that, at each wavelength, different spatial portions of the spectrum to be deblended have different levels of contamination. The deblending algorithm relies on the assumption that the shape of the object is the same at all wavelengths.

Table of Contents Previous Next Index Print