In this section and § 2.3, we outline the data processing steps which are carried out by our customIDL-based routine for the data reduction of low and high-resolution Spitzer-
IRS spectroscopy. Both sections are intended to be a recipe-style data-process which may be followed in-order to produce science-standard Spitzer-IRS spectroscopy.
1. Combine similar pointings: BCD 128×128 pixel images for DCEs at identical point- ing co-ordinates are stored into 3-dimensional image data cubes; i.e., an individual data cube is constructed for each order (i.e., 1st and 2nd) IRS module (i.e., short and long) in each of the two nod positions.
2. Hot pixel masking I: During the building of the cubes, those pixels which have been previously flagged by the SSC calibration files as damaged or unreliable (here- after, ‘hot’ pixels) are assigned NAN values. We note here that hot pixel identi- fication and masking is an extremely important process which greatly affects the quality of the final spectroscopy produced for Spitzer-IRS data and the ability to significantly detect weak spectral features.
3. Mask non-dispersion region: those pixels which lie outside of the standard disper- sion zones of the CCD are now masked and are removed from further analyses (see Fig. 2.3).
4. Source detection: Module regions are collapsed in the dispersion direction to con- struct a profile of mean wavelength pixel value (i.e., the mean row profile) versus column number. Significant peaks within these row profiles are flagged as possible spectroscopic sources within the image.3 The peak of the profile is normalised and a weighting image is constructed based on the normalised mean row value. The weighting image is used when analysing the image for further ‘hot’ pixels in the proceeding steps.
5. Hot pixel masking II: A pixel-by-pixel closest neighbour analysis is used to identify variable hot pixels (rogues) in each frame of the data cubes (i.e., those pixels which may be usable in some frames but not in others). Each image within the cube is artificially convolved with the weighting image constructed in the previous step. If a pixel is then found to be > 10σ that of each of its closest neighbours, it is
deemed to be hot and assigned aNANvalue.4 Weighting each of the pixels based
on their proximity to the target has the advantage that where a target is detected in the dispersion plane, it is more likely that a pixel has neighbours which have pixel values significantly less than itself, especially for faint sources which are spatially extended over only 1–2 columns. The weighted image correctly accounts for this source emission and hence, does not remove flux from the source. The frames are then deconvolved from the weighting image to restore the original pixel values with these newly detected rogue pixels flagged as ‘hot’.
6. Latent charge removal: As described in §8.3 of the Spitzer-IRS Data Handbook, after each integration, a small fraction of latent charge (∼ 1–2%) still exists on the detector which decays slowly over time (see footnote 2) Over the course of a long observing request, this latent charge can build to significant levels (30–50% of the true background signal) and must be removed, especially in the cases of faint sources. The latent charge is a function of both wavelength (i.e., row number) and time (i.e., DCE number), and hence may be assessed by fitting the slope of the perceived background in an individual row and the frame number in the data cube with either a first or second-order polynomial (see Fig. 2.4). The latent charge is then removed by subtracting the slope of the sky value row-by-row from each DCE.
7. Hot pixel masking III: Pixels are compared with their values in other DCE frames of the data cube. If a pixel value is > 10σ than that of its counterparts in the other DCEs in the cube it is assigned aNANvalue.5
8. Collapse the data cubes: At this point in the reduction process, the data cubes have been rigorously cleaned of all obvious defects. The images are now averaged us- ing a resistant mean in the direction of the stacked images for each nod-position, in effect, collapsing the 3-D cube into a 2-D image, one per module per nod-position. The variance as a function of time for each pixel is used to create a 128 × 128 pixel uncertainty image. All pixels with NAN values are ignored in both of these pro- cesses as ‘missing’ data.
4Variances and means are calculated using resistant (outlier invariant) statistics.
Figure 2.4: An example of the latent charge build up on the LL1 module as a function of DCE number (Fig. 8.1 of the IRS Data Handbook). This residual charge is well fit by a first or second order polynomial and removed row-by-row as a function of DCE number.
9. Flag likely emission lines: Regions of the images which contain emission/absorption lines (i.e., spectral features) are often strongly positive/negative when compared to background or source continuum image regions. Simple smoothing interpola- tion algorithms are likely to remove these important spectral features, especially if strongly peaked. Each image is scanned therefore for regions (# 3 pixels wide) which are well-fit by 2-d Gaussian profiles. These pixels are flagged as regions which are likely to contain emission lines, and they are partially shielded from smoothing in Step 10. The failure rate of this process (i.e., bad detection of emis- sion features) is ≈ 1 %, and hence a shielding factor of 1/100 is assigned.
10. Image smoothing: IRSCLEAN is an interactive tool created by the SSC to further remove/mask rogue pixels within BCD images. IRSCLEAN is invoked in an auto-
mated iterative method to remove any remaining strongly positive/negative pixels in the image. Within the sub-routineIRSCLEAN MASK, the aggressive parameter is
set to 1.5, this has the advantage thatIRSCLEANwill search the image for noise that is within 3σ of the background level (n.b., emission-features are partially shielded from this process in the previous step), analyse clusters of pixels and will not flag
Figure 2.5: An example of a LL2 module Spitzer-IRS BCD image which has been rigorously cleaned of rogue pixels, co-added and alternately background subtracted in the two nod positions. This has produced a background-subtracted source and a negative image of the source in the other nod-position.
more than 20 rogue pixels within the image. The image is analysed byIRSCLEAN
in three stages: (1) only the pixels with values > 0.0; (2) only the pixels with values < 0.0; and (3) all of the pixels. Pixels which are flagged as ‘bad’ in (1) and (3), or (2) and (3), are assigned the mean value of their immediate neighbours. This process is repeated until < 0.1 % of the pixels are identified as ‘bad’.
11. Hot pixel masking IV: Co-added BCDs in each nod-position are visually inspected for any remaining rogue pixels. Any rogue pixels identified at this stage are re- jected and assignedNANvalues. This stage is conveniently completed usingIRSCLEAN.
and the uncertainty image which are both required during spectral extraction. 12. Background subtraction: The residual charge on the detector after dark subtrac-
tion (i.e., the background) is now removed from the cleaned co-added BCDs by alternately subtracting the BCDs at differing nod-positions for each module. This produces an image with a background-subtracted source and a negative image of the source in the other nod-position (see Fig. 2.5)
13. Spectral extraction: The final rigorously-cleaned, co-added and background-subtracted BCD images are ready to have the spectra extracted. See § 2.4.