Spitzer Documentation & Tools
IRS Instrument Handbook

8.2.2             Optional Steps

The following steps are not necessary for all users, but may be applicable to your data set.  You should follow the basic procedure outlined in Section 8.2 and review Chapter 7 before deciding if any of the following steps are necessary.

1.  Remove bad pixels.  Background subtraction should have removed many bad pixels. If your spectrum still contains significant numbers of bad pixels, which may manifest themselves as sharp features away from the order edges in your extraction spectrum, you may wish to remove them (see Section 7.2.2).  For data taken in Mapping Mode, you can use CUBISM to remove known rogue pixels and flag any other pixels that look bad.  For data taken in Staring Mode, you can use IRSCLEAN to perform the same task.  These tools operate on the 2D spectra, so you will have to re-extract your spectrum after cleaning.

2.  Remove latent charge. A small fraction (e.g. 1-2% for LL) of charge on the detector persists between frames despite the resetting of the detector that occurs prior to every integration.  (See Section 7.2.5.) This latent charge decays slowly over time and is removed only by the annealing process. In the case of very faint sources, the source of latent charge is the zodiacal background.  For long duration (>1 hour) integrations on very faint (<1-3 mJy) sources, this charge can build up to a significant level.  The user may search for any charge accumulation (especially for high background and long integrations) by monitoring the signal as a function of time. One way of doing this is to take the median of each row (or 2-3 rows) within an order in each BCD and see if the median of the same group of pixels increases with time. If so, you can fit a (first-order) polynomial to these median values and subtract the trend.  The user can do this with the software of their choice (e.g. IDL, IRAF) and then proceed with background subtraction and spectral extraction.

3.  Remove time-dependent dark current.  During observations with the Long-High (LH) module, the dark current may have anomalous values in the first 100-200 seconds of a series of exposures. (See Section 7.4.1.) Depending on the integration time and the number of cycles selected, data in the first exposure (or first nod position) may be affected. The flux is not evenly distributed over the LH array, being brightest on the blue end of each echelle order. The faint excess flux is seen as a bright band stretching across the bottom of the array, both on and between the orders. This phenomenon manifests itself in extracted spectra of relatively faint sources as a "scalloping" or order tilting, wherein the slopes of affected orders are made bluer (flatter), inducing order-to-order discontinuities.  If your spectra show evidence of time-dependent darks, you may wish to run DARKSETTLE to ameliorate the effects.

4.  Combine 1D spectra from a given AOR.  If you have low-resolution observations taken in Staring Mode, you now have two 1D spectra, one for each nod position, which you can average together. The co-addition can be performed with the software of your choice (e.g. IDL, IRAF).

5.  Co-add 1D spectra from different AORs.  Some users may be dealing with very deep observations of faint sources.  In some cases, observations of a single source will span multiple AORs.  In these cases, the extracted 1D spectra will need to be co-added before spectral features are measured.  The co-addition can be performed with the software of your choice (e.g. IDL, IRAF).

6.  Trim the edges of the orders.  The edges of the orders are noisy and you need to reject the first few and last few pixels. The trim ranges used to calibrate the data are given in Table 6.5. Notice that in the high-resolution arrays, the short-wavelength edge of each order is generally noisier than the long-wavelength edge. This is due to the blaze of the gratings. In general, the long-wavelength side of each high resolution order is more trustworthy than the short-wavelength side, and you may be able to disregard the latter.

7.  Subtract the background in 1D.  If you have high-resolution data or low-resolution observations of extended sources, and no dedicated sky backgrounds, you have two options.  If you have low resolution observations taken close in time, you can interpolate the sky values extracted from the low resolution data to derive the background at high resolution wavelengths.

8.  Remove fringes.  If your extracted spectra exhibit fringing, you may use IRSFRINGE to remove the effect. See Section 7.3.7.

9.  Apply a flux calibration correction.  If you have changed the extraction width from the default, you will have to apply a flux calibration correction. For a point source, this is essentially a ratio of the flux from a calibration star using the default extraction width to the flux from the same star using your extraction width. You may wish to fit a polynomial or low-order function to the calibration correction in order to reduce noise. Multiply the 1D spectrum by this ratio (which is wavelength dependent). Be sure that you have done exactly the same steps of rogue pixel masking, background subtraction and SPICE extraction on the calibration star as you have done for your target, before you estimate the flux calibration correction. See Section 4.1.4 for more details.

10.  Check the flux calibration.  Compare the flux in the spectrum with broadband imaging observations, perhaps using SPITZER_SYNTHPHOT (see the Data Analysis Cookbook for access to the software and a recipe for using it).  It is also useful to extract a spectrum from a blank part of the slit in your reduced 2D spectrum to check if there is any residual sky or latent charge (see Section 7.2.5) remaining.

11.  Fit spectral features. You may use PAHFIT, SMART, IRAF, IDL, or the software tool of your choice to fit spectral features in your extracted spectra.  Be careful not to confuse rogue pixels/cosmic rays with emission/absorption lines. When doing full slit extraction for SH/LH, the rogue pixels (since they only decay slowly with time) can appear in both nod positions in the spectrum while cosmic rays will appear only in one nod.  In addition, check that the line is not the 14 micron teardrop known to exist in SL1 data (see Chapter 7).  Finally, check that the full width at half maximums (FWHMs) of the lines are reasonable i.e at least the spectral resolution of the instrument.

8.2.3             Transit or Eclipse Spectra

Spectra of transiting or eclipsing exoplanets were taken using the low resolution modules in either Staring or Mapping mode, but typically in such a way as to minimize telescope movement.
Relying as they did on comparing spectra taken during different parts of an exoplanet's orbit (e.g. (star+planet)-star=planet emission, or (star+planet-atmosphere)-(star+planet)=atmospheric absorption), it was important to keep the system stable, reducing as much as possible variable slit losses and movement of the source on the detector.  Exposures were typically taken continuously over a period of 4-6 hours, bracketing the time of transit or eclipse by one to two hours on either side. Since the parent stars are quite bright, latent charge buildup is rapid and obvious.  However, normal latent charge removal was found to be insufficiently precise for measurements at the 100-1000 ppm level. Consequently the first 10-20 minutes of each 4-6 hour observation sequence (after which a steady state is reached) were usually discarded. Due to telescope pointing oscillations at the 0.05 arcsec level, corrections to the measured flux vs time per wavelength bin were made using a derived pointing model or some functional approximation. Background subtraction is defined somewhat differently than usual, with the "background" being measured at the same point on the sky either during secondary eclipse (for an exoplanet emission spectrum) or during primary transit (atmospheric absorption spectrum). While a "stabilizing adjustment" might be made to each exposure by measuring and subtracting a median of pixels in the off order (to remove any small offsets due to droop or other electronic effects) the actual background was typically measured and subtracted in the 1D spectra by generating a light curve for each wavelength bin and measuring the depth of eclipse.  More details concerning the reduction process of transit spectra can be found in Richardson et al. (2007, Nature 445, 892), Grillmair et al. (2007, ApJ, 658, L115), Swain et al. (2008, ApJ, 674, 482), and Grillmair et al. (2008, Nature 456, 767).

8.3  Data Reduction Steps for IRS Peak-Up Imaging (PUI)

1.  Examine the data.  The Post-BCD mosaics (b_mos.fits and r_mos.fits) will often be adequate for doing photometry. However, if visual inspection reveals bad pixels near the science target or in the desired background annulus region of the image, creating your own mosaic using MOPEX may help to mitigate such artifacts. MOPEX also allows you to create a mosaic with a north up and east left orientiation rather than a detector x-y orientation. Photometry on Post-BCD mosaics and MOPEX mosaics are consistent to within 0.1% on average, with a meximum deviation of around 2%.

2.  Create a mosaic.  In the BCD directory, your data will have suffixes bcdb.fits (16 microns) and bcdr.fits (22 microns). You can use MOPEX to create a mosaic from these individual images.

3.  Extract  photometry.  You can extract photometric information from your mosaics using APEX (distributed as part of MOPEX).  PRFs are provided to use within APEX. The units of photometry from APEX are automatically given in microJy. If you are using another package, e.g. IRAF, the fluxes will be output in the BCD units of MJy/sr. In order to correct to microJy, you should convert to steradian per arcsecond, and then multiply by the pixel area. The default pixels in the mosaics are 1.8" x 1.8" = 3.24 square arcseconds per pixel (the BCDs have a pixel area of 3.367 square arcseconds per pixel). The conversion factor for the default mosaics is therefore:

1 MJy/sr = (1E12 microJy)/(4.254517E10 arcsec2) x 3.24 arcsec2 = 76.1544 microJy.

4. Apply a color correction. For Peak-Up Imaging observations, the photometric calibration assumes the source spectrum has  the spectral shape νFν = constant. The calculations take into account the full spectral response of the instrument. Due to the so-called "Red Leak" (a small increase in response at about 28 microns) some emission will be detected in the Blue Peak-Up camera for very cold sources that would not have been detected in a system without the red leak. This translates into large correction factors for very cold sources (T<50 K) observed with the Blue Peak-Up camera. While these numbers are formally correct, the observers should be very wary of blindly applying them to the data. Longer wavelength observations are advised in this case.

To get the peak-up flux for a non νFν = constant shape, divide the flux by the appropriate color correction factor. See Table 4.12 and Table 4.13.

5.  Apply an aperture correction.  Photometry measured within a given aperture must be corrected to obtain the total flux within an infinite aperture. Section 4.2.4.1 provides aperture corrections to infinity for a variety of spectral types and aperture radii.