Figure 9.6. A standard flux star (left) and plot of the raw spectra of the same frame (right).
Units are as in Figure 9.2.
pixels to wavelength coordinates in the arc. This transformation is also used to calibrate in wavelength our object data.
Selected lamps produce many lines along the spectrum; accurate line lists are available in manuals and software. The spectra of calibration sources such as Cu-Ar-Ne and Fe lamps contain numerous narrow emission lines of known wavelength (Figure 9.5). Arcs should be obtained as often as spectrograph stability demands.
Flux standard images are taken only when flux-calibrated spectra are required. All standard star images have to be reduced following the steps described above. The goal is to convert ADUs or counts into flux units such as erg s-1 A-1. Most observatories and software-reduction packages have lists of suitable spectrophotometric-standard stars. Using the known fluxes of the standard stars, we convert pixel counts into relative or absolute fluxes. The difference between relative and absolute flux corresponds to the difference between a narrow and a large slit. The conversion of counts to flux is performed under the assumption that slit losses, color terms, transparency, and seeing for the standard-star observations and the object of interest were similar.
9.4. From raw data to calibrated data using IRAF procedures
The correction of bias level is similar to that applied in the image-reduction process. We select the bias images and combine all of them in order to minimize noise. To combine images we can use either the imcombine or the zerocombine task. Then, we analyze the bias image (imstat, imexam). If the image does not have structure, it is better to correct the zero level of the science and flat-field images using only the overscan region, since in that case we subtract a constant from the image and therefore we do not introduce noise into the images. The ccdproc task is used to correct for all effects present in a CCD exposure using various calibration images. To correct for the zero level, we can use both the bias image and the overscan. To determine the overscan and trim-strip sections, we can use the implot task with a flat-field image.
9.4.2 Flat-field correction Spectroscopic flat-field images (to correct along the spatial direction) are obtained with white-lamp exposures. First, we check flat-field images, selecting those with the adequate level of counts. Then, we combine all lamp flat images meeting the count-level condition using flatcombine. If just one good lamp flat is found, we use it directly in the next step. We scale flat images with the mode value (it could also be done using the median value) before combining since they can have very different levels of counts.
To obtain the final flat-field image, we fit a smooth function along the spatial direction of our combined flat image; then we divide the combined flat image by the fitted function. This is accomplished with the response task from the twodspec.longslit package. It is usually necessary to use the spline3 function and a high number of terms (>15). When we have obtained a normalized flat-field image, we can correct all science and sky flat images. Again, we use ccdproc using the output of response (the normalized flat image) as the correction flat-field image.
We select all sky flat images and perform statistics to accept only those with the appropriate count level (i.e. rejecting those with levels of counts that are too low or too high). We then combine all good sky flat images to obtain an averaged sky flat image, with lower noise, using again the flatcombine task. The illumination calibration is obtained from this sky spectrum by fitting functions across the slit (the slit profiles) at a number of points along the dispersion, normalizing each fitted function to unity at the center of the slit, and interpolating the illumination between the dispersion points. The fitted data are formed by dividing the dispersion points into a set of bins and averaging the slit profiles within each bin. The illumination task creates the illumination-calibration image. The order of the fitted function should be low (generally two, three, or four). Finally, we correct all the science images by means of ccdproc, using the illumination-calibration image as the correction image.
First, we select arc-lamp images and identify the lamp used (Cu-Ar, Cu-Ne, He-Ar, ...), grating, and central wavelength. The identify task (from twodspec.longslit packages) identifies features interactively in a one-dimensional spectrum. Before we execute the task, we look for the appropriate table of features in the linelists. In general, we fit a Legendre or Chebyshev function of order three or four. The output file is written in the database directory, named idbfile; it contains a list of identified features and parameters of the fitting function. Now it is necessary to identify feature lines across the whole image, using our identifications in the one-dimensional arc spectrum. To this end, we use a non-interactive task: reidentify. The output file overwrites idbfile, now including identified lines and a fit across the whole image.
The next step consists of fitting wavelength coordinates to pixel coordinates, that is, fitting a surface defining wavelength as a function of x and y coordinates or A = s(x,y). We use the interactive task fitcoords.
Using calibration files obtained from arc-lamp images, we can calibrate in wavelength our science images. The transform task transforms long-slit images into wavelength coordinates. Outputs of transform are wavelength-calibrated images.
To subtract the background of the object images, it is necessary to fit the sky at each wavelength value. We use another interactive task: background (from twodspec.longslit packages). We fit the background across each wavelength. In general, the order of the polynomial has to be low (one, two, or three); data points should be rejected as required in order to avoid taking into account the object flux in the fit, and the number of iterations should range between two and five.
First, we need to collapse the two-dimensional spectra of the standard stars into a one-dimensional spectrum. To do this, we measure the spatial coverage of the star in the frame. We can use, for example, implot and select columns that contain the spectrum of the star. Now, we extract a one-dimensional spectrum by adding all the apertures including star flux, by means of the apall task. This task is located in the apextract package. Now, using the one-dimensional spectrum of the standard star, and the table listing its AB magnitudes, we will create a table with two entries: the real flux of the standard star (in erg cm-2 s-1 A-1) and the measured flux (in counts). We use the task standard located in the onedspec package. We need the image of the standard star, the name of the extinction file, the directory containing the standard flux tables, and the name of the star in the database. IRAF provides several tables of standard stars and the extinction curves for several observatories, placed in the onedstds directory.
From the output of standard, we determine the system's sensitivity as a function of wavelength and extinction functions using the sensfunc task. The last step is calibrating our spectra. The calibrate task is used for this. The input spectra are corrected for extinction and calibrated to a flux scale using sensitivity spectra produced by the sensfunc task. The output of calibrate will consist of our bidimensional spectrum, corrected for all effects and calibrated in wavelength and flux.
Now, we can proceed to analyze our spectra.
More information about how to reduce spectra with IRAF:
• A User's Guide to Reducing Slit Spectra with IRAF,* by P. Massey, F. Valdes, and J. Barnes (15 April 1992)
• IRAF help page for the twodspec package*
Was this article helpful?