APOGEE Visit Spectra Reduction
The first stage of the APOGEE data reduction pipeline (apred) reduces the raw spectra of consecutive, spectrally-dithered exposures of one visit (of a particular plate on a given night) and extracts the individual spectra for each of the objects targeted on a plate. The other steps of the reduction process include dark subtraction, flat-fielding, wavelength and flux calibration, removal of sky emission and absorption within the Earth's atmosphere, and the combination of individual spectrally-dithered exposures into a single spectrum for each object. At the visit reduction level, the pipeline also provides an initial estimate of the radial velocity for each object. A more in-depth description of the visit-level reduction process follows below. See Nidever et al. (2015) for further technical details.
APOGEE Visit Data Reduction
- ap3d
- Extract 2-dimensional images from the 3-dimensional raw data cubes and apply the basic calibration steps of dark subtraction and flat fielding.
- ap2d
- Extract and calibrate 1-dimensional spectra from the 2-dimensional images and attach a wavelength calibration.
- ap1dvisit
- From the 1-dimensional spectra, measure the dither shifts between the individual exposures, subtract sky from each fiber, correct for telluric absorption in each fiber, combine the dithered exposures into a single well-sampled visit spectrum, perform flux calibration, and obtain an initial radial velocity estimate for the spectrum.
ap3d
For each readout of each exposure, the raw data are first corrected for bias variations in the IR detectors and electronics. This is accomplished by using a reference array of pixels that are generated by the readout electronics, as well as a set of reference pixels around the edge of each detector.
Each individual readout is then corrected for a dark current contribution, by subtracting a calibration dark current frame made from a combination of multiple individual dark frames.
The data are then collapsed from the 3D data cubes into 2D images. This is done on a pixel-by-pixel basis. At the most basic level, a linear function is fit to the series of up-the-ramp readouts for each pixel to determine the best-fitting slope. A linear function is used to fit all exposures, even if conditions vary throughout the exposure. The best-fitting linear slope, multiplied by the total exposure time, is taken to be the flux at this pixel location for the exposure.
The up-the-ramp sampling allows for the recognition of cosmic ray events during the course of the exposure. Cosmic ray events appear as significant jumps in the rate of charge accumulation within in the series of data points in up-the-ramp sampling. The ap3d software attempts to recognize these events using this signature and then flags the affected pixels.
The 2D images are then corrected for variations in pixel-to-pixel response by dividing them by a calibration flat field. The calibration flat field is an average of multiple exposure frames illuminated by a flat light source within the spectrograph.
We have also made an attempt to correct for some of the persistence that affects about a third of the “blue” detector and a smaller fraction of the “green” detector. Based on an analysis of illuminated frames followed by a series of long dark frames, a double-exponential fit for the amplitude of the persistence was derived for all pixels. This correction, described in detail in Holtzman et al. (2018, submitted), depends only on the exposure level and elapsed time. It was only applied to the "blue" detector. This correction is only partial in nature and does not completely remove the persistence issues. Therefore, during the visit combination step, visits that have been significantly affected by persistence are down-weighted.
ap2d
The ap2d routine takes the calibrated 2D images and extracts individual 1D spectra for each exposure. This is accomplished by modeling the distribution of the light from each fiber as a function of wavelength. The flux from all 300 fibers is fit simultaneously to account for contributions of the wings of the light distribution from each fiber to that of its two adjacent spectra. The profiles for each fiber are derived from a calibration frame taken through the telescope immediately after the exposure sequence. The shape and magnitude of the contribution of light from the wings of the fiber into the adjacent fibers is estimated using a library of calibration observations where only every sixth fiber is illuminated.
After the 1D images are extracted, a wavelength calibration is applied, which is determined from observations of arc calibration lamps. Because the APOGEE spectrograph is in a gravitationally-fixed orientation and is kept in a stable vacuum and at a stable temperature, the form of this wavelength correction is very stable, and a single wavelength calibration is adopted to determine the non-linear terms in the conversion between pixel location and wavelength. Note that the wavelength scale for each fiber is slightly different because of the different locations of the fibers in the pseudo-slit.
The wavelength calibration of the APOGEE data is done in vacuum wavelengths. However, the wavelengths of atomic transitions are usually quoted at standard temperature and pressure (S.T.P.); this is how the CRC Handbook of Chemistry and Physics lists them for transitions redward of 2000 Ångstroms. Thus, recognizing spectral lines associated with specific atomic transitions may require converting the SDSS data to the equivalent values at S.T.P. For APOGEE data, we have used the conversion from Ciddor (Applied Optics, Vol 35, p 1566, 1996) to convert between vacuum and air wavelengths. For a vacuum wavelength (VAC) in Ångstroms, convert to air wavelength (AIR) using the equation:
AIR = VAC / (1.0 + 5.792105E-2/(238.0185E0 - (1.E4/VAC)^2) + 1.67917E-3/( 57.362E0 - (1.E4/VAC)^2)
There are small linear shifts in the wavelength scale between different exposures, which result from (i) the intentional dithering of the detectors between exposures to allow for well-sampled combined images, and (ii) a small, slowly varying flexure in the instrument optical bench as the liquid nitrogen tank depletes over time (a larger "reset" shift occurs when this tank is filled, but this is always done during the day). The linear shifts are measured using prominent night sky emission lines that appear in every spectrum, and these shifts are applied to the wavelength solution.
ap1dvisit
The first stage in ap1dvisit determines to high accuracy the linear shifts between each exposure in a visit that result from the dithering of the detectors. This can be done at higher accuracy than the determination of the wavelength zero point from the skylines by cross-correlating the different exposures with each other.
Each fiber of each exposure is then corrected for the contribution of night sky emission. The IR portion of the spectrum includes a significant number of very bright OH emission lines. There can also be some continuum sky contribution, especially when there is significant moonlight (and even more so when thin clouds are present). Sky subtraction is accomplished using sky fibers that are distributed across each plug plate. Multiple fibers are used because the IR sky can vary spatially. For each object, the sky is estimated from nearest four sky fibers. However, as the wavelength scale is not identical for each fiber, the sky spectra need to be shifted a bit before they can be subtracted. Also, because the line profiles differ slightly from fiber to fiber, there are small differences that lead to imperfect sky subtraction, in particular, of the brightest night skylines. Because the sky subtraction for the bright night skylines is non-ideal, there are small regions of the spectra that are effectively rendered useless for science surrounding each skyline. This is an area for potential improvement in the pipeline. We note, however, that even with perfect sky modeling, the signal-to-noise under bright skylines would be substantially degraded compared with the surrounding spectrum.
The Earth's atmosphere also leads to significant absorption in the observed spectra, which arises from CO2, H2O, and CH4 bands in the APOGEE spectral window. A correction for this telluric absorption is derived from observations of "telluric" standards spread across the plate. The goal is to target hot stars that exhibit relatively few spectral features in the APOGEE wavelength region, which is accomplished by selecting stars based on their intrinsic color. Multiple telluric stars are chosen for each plate because the absorption can vary across the field of view. For each telluric standard, the amplitude of the absorption for the separate families of CO2, H2O, and CH4 bands are estimated by fitting model absorption spectra to that observed. A surface is fit to these scaling factors and this surface is used to predict the appropriate scale factors to be used for each individual fiber. The individual fiber scaling factors, together with model telluric spectra that are convolved with the fiber-specific line spread function, are used to correct each individual spectrum. Significant improvement had been made to the telluric correction over time, but there are still some cases where the correction remains imperfect.
After sky correction, pairs of dithered frames are combined to produce well-sampled images. The pairs are then combined to produce a single "visit" spectrum for each object observed.
The final visit spectra are then approximately flux calibrated. The relative flux calibration is performed using a calibration frame that computes the instrument spectral response, as determined from an observation of a blackbody source. The absolute level of the spectrum is then determined using a scaling based on the object's catalog H-band magnitude. We note that the subsequent pipeline for the analysis for stellar parameters and abundances (ASPCAP) normalizes the spectra to a pseudo-continuum, so the flux calibration done here is not critical.
Finally, an initial radial velocity (RV) estimate is made by cross-correlating each visit spectrum with a grid of synthetic spectra. The best matching one serves as a template, and the derived shift between the observed spectra and the best-fitting templates provide the initial RV estimate. Note that this estimate is later refined using multiple visits to the same object because these provide a higher signal-to-noise spectrum.
Output visit spectra: apVisit files
Multiple visit spectra of the same object are combined in the next stage of the pipeline, visit combination.