5.8 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.
IDL software to extract spectra from NICMOS grism images has been developed at Space Telescope European Coordinating Facility (ST-ECF). Two programs are available: NICMOSlook, which is interactive, and calnicc, 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, calnicc, is recommended if a quick-look extraction of a large number of spectra from different images is desired to identify interesting objects. Both software packages, together with user documentation, can be obtained from the ST-ECF NICMOS 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.
Grism data are treated as regular images by the extraction software (see section 5.8.1) with the exception that they are not flatfielded by calnica. The flatfield 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 therefore the flatfielding 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, a wavelength dependent correction for QE variations is applied (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. An IRAF package nictools which helps to co-add direct and grism images is available from the ST-ECF nictools web site. The package includes tasks to create association files (makeasn), find relative shifts from direct images and apply them to grism images (alignasn), and combine associated images with those fits applied (asncombine). This package can be used to prepare images for the extraction of the spectra.
|
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 that individual spectral and direct image pairs be reduced and the resulting spectra combined, when the individual spectra are strong enough.
|
5.8.1 Extraction Software
Detailed software manuals and descriptions of the extraction algorithms can be found at the above URLs. 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 flatfielded, which is the default in calnica.
The input files can be either the output of calnica (*_cal.fits) or the mosaiced images created with calnicb (*_mos.fits). The software also reads FITS images without the NICMOS specific extension, but some functionalities which depend on the error planes (*_cal.fits[err]) or data quality flags (*_cal.fits[dq]) will not be available.
Calibration data and configuration files for the extraction programs are in directory calib. The ASCII file grismspec.dat describes grism parameters, and calnicc.setup specifies configuration parameters. Parameters interactively changed and saved with NICMOSlook are written to those files. File names of other calibration data are specified in those two files.
Output Files
The basic output of the extraction are the spectra, which can be saved in several forms.
- A FITS table containing the extracted spectra (
image_spc.fits). This file contains the successfully extracted spectra; it consists of a primary header and a series of table extensions, each extension consisting of a header and the associated table. There is one table extension for each spectrum extracted. The primary header of the file contains the relevant information regarding the observation, namely a subset of the keywords in the primary headers of the input direct and grism images. The table extension header contains keywords relevant for the individual spectrum; the keywords describe: the content of the table (the list of columns), the nature and position of the object, and the characteristics of the spectrum (line positions and fluxes, continuum level, etc.). The associated table contains five columns: the wavelength vector, the flux vector, and three vectors of the statistical, deblending, and total errors from the extraction process.
- Postscript files of the extracted spectra (
image_n.ps). This file contains graphical representations of the extracted spectra. One postscript file for each spectrum is generated, where n is a sequential number starting with 0.
In addition, a number of miscellaneous output files can be created by the software, which include background image, finding charts, catalog files and object lists. In NICMOSlook, these files have to be explicitly requested, while in calnicc files are created depending on the configuration of the program.
5.8.2 Processing
Object Detection and Classification
Objects on the direct images may be found by interactively using the cursor. Automatic programs to find objects are also available. NICMOSlook uses DAOFIND for that purpose, while calnicc uses Sextractor to find and classify objects.
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 flatfielded using ordinary, on-orbit grism flatfields, displayed, and examined visually for e.g. emission line objects, or very red spectra. Ordinarily, these on-orbit flatfields are not used as part of NICMOS grism data processing: instead, the flatfielding is done on the extracted spectra, as is described below. Once the interesting objects have been identified, their spectra should be extracted from non-flatfielded grism images.
Location of Spectra
The positions of the direct objects can be used to compute the location and orientation of the spectra. The positions of spectra relative to the position of the object on the direct image is parameterized in grismspec.dat. 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 on-orbit grism flatfields, which are normally not used for grism data processing (see Flatfielding, below), can provide one convenient way to artificially remove the background from spectral images before extracting the spectra. This is a particularly useful procedure if your field is crowded and other sources might contaminate the regions on either side of the spectra, used to determine the background. The grism flats can be significantly different from flats through regular filters, and do a better job of removing the background once they are inverted and scaled to match the background in the spectral image.
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 using the moments of the image. The weights are then created by summing up all the pixel values in a given column (fixed wavelength) of the grism image that fall within the ellipse defined by the size and orientation of the object in 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 taken 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. 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.
Flatfielding 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., flatfielded). The QE variations depend both on the wavelength and on the position of the object on the detector. Because of this wavelength dependence, the flatfielding 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 flatfields. For wavelengths where narrow band flatfields are available, they are used. For other wavelengths, the correction factors are derived through interpolation from a set of monochromatic flatfield images (see Storrs et al. 1999, NICMOS ISR-99-002). The list of flatfields to be used is specified in calnicc.setup, and users can provide their own preferred flatfields. The default list is shown in table 5.10.
Table 5.10: Default Flatfields For Spectra
| Flatfield File |
 (µ) |
FWHM (µ) |
Filter |
| i191346kn_flt.fits |
1.07990 |
0.0096000 |
F108N |
| i191346mn_flt.fits |
1.12830 |
0.0110000 |
F113N |
| i191346pn_flt.fits |
1.64600 |
0.0170000 |
F164N |
| i191346qn_flt.fits |
1.65820 |
0.0164000 |
F166N |
| i191346sn_flt.fits |
1.87380 |
0.0192000 |
F187N |
| i191346tn_flt.fits |
1.90030 |
0.0174000 |
F190N |
| i1913470n_flt.fits |
1.96390 |
0.0186000 |
F196N |
| i1913471n_flt.fits |
1.99740 |
0.0206000 |
F200N |
| i1913472n_flt.fits |
2.12130 |
0.0206000 |
F212N |
| i1913473n_flt.fits |
2.14870 |
0.0200000 |
F215N |
| i1913475n_flt.fits |
2.39770 |
0.1975000 |
F240M |
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. Freudling 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. The extraction software 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. The deblending procedure also produces an error estimate which is reported in the output FITS table and indicated in the postscript file containing the spectrum.