SSC Home Page

Early Release Observation of Comet SW-1:
IRS, module LL2, 14.0-21.3 micron

Requirements:

·  Follow the instructions on Spectroscopy: Custom Spectrum Extraction

Outline of the demo:

This demonstration uses SPICE to extract a spectrum from IRS data of the Comet Schwassmann-Wachmann-1. We describe the steps required to background-subtract your data and use the SPICE tool to perform a custom extraction of your target's spectrum. Background subtraction is particularly important for targets on a high background, such as that found in the ecliptic plane. Similarly for a moving target such as a comet, a custom extraction, rather than the standard pipeline product, may be important to separate the effects of nucleus and coma, and to otherwise correctly extract a slightly extended object, or one with an unusual morphology. This demonstration then, serves as a generic example for handling moving target data obtained with Spitzer IRS-Staring Mode. The steps are quite similar to those outlined here. This specific example involves an extraction from the LL2 module, but it is generally applicable to all of the IRS modules.

Note that a more detailed description of IRS Data Reduction steps can be found at: http://ssc.spitzer.caltech.edu/irs/documents/IRSDataReductionSteps.pdf

Step by Step Guide

  1. Perform the background subtraction. For IRS staring data in LL2, for point sources and slightly extended objects, this is simply done by subtracting the 2-D data from one nod position from the other. You can either use the coa2d spectra from the pbcd directory in your data extracted from the archive, or coadd the invidual DCE's yourself (taking care that you coadd only those exposures at a given slit nod position). There is no Spitzer-specific tool to do the sky subtraction, and we suggest you use your favorite data-reduction software to do this, ensuring that the sky-subtracted output is written out as a FITS image (if not already in FITS format). For example, in IDL:
 ;idl program to perform sky subtraction on IRS data
 filename1='SPITZER_S2_6068992_4_1_E181979_coa2d.fits'
 filename2='SPITZER_S2_6068992_5_1_E181965_coa2d.fits'
 filename3='6068992_LLO2_4_5.fits'
 filename4='6068992_LLO2_5_4.fits'
 r1=readfits(filename1,hdr1) 
 r2=readfits(filename2,hdr2) 
 r3=r1-r2 
 r4=r2-r1 
 writefits,filename3,r3,hdr1 
 writefits,filename4,r4,hdr2 
 end
  1. Download and install SPICE, and remember to change the environmental variables in the spice.csh file to point to the correct directories. Start the SPICE GUI by running the shell script "spice.csh:"
 unix% spice.csh 
  1. Load your data into SPICE by specifying the input data directories and names. Clicking on the input button (lower left) will bring up the dialog for selecting inputs. You can either copy and paste that in, or use the "..." buttons to browse your directory structure. Provide the input background-subtracted 2-D spectral image (which you created in step 1), and the corresponding uncertainty image, and mask file. If you used the *coa2d files to create your sky-subtracted 2-D image, then use the c2unc and c2mask filed form the pbcd for the positive nod position, as your uncertainty and mask files for the sky subtracted data.

  1. Pull down the "View" menu at the top of the SPICE window and select "SPICE," then "Cal," and select "Show." This will place a new button, "Cal," at the bottom of the SPICE window. Pressing the "Cal" button will show the calibration files directory ("cal") and the calibration files to be applied to the data ("*_wavsamp.tbl," "*_wavsamp_offset.fits," "*_wavsamp_wave.fits," and "*_fluxcon.tbl," as well as the extraction width table "*_psf_fov.tbl"). These are usually the default files and should not need editing. Be sure you are using the right calibration files for the version of the pipeline used to process the data.
  2. In a similar way, from the "View" menu, you can select "SPICE," "CDF," and "Show," to place a new button, "CDF," at the bottom of the SPICE window. Pressing the "CDF" button will show the namelists directory ("cdf") and input namelists ("*_profile.nl," "*_ridge.nl," "*_extract.nl," "*_irs_tune.nl") needed for establishing the profile, ridge, width, and tuning of the extracted spectrum; "b2" correspond to the short-low (LL) module. These are usually the default files and should not need editing.
  3. You can change the contrast ("stretch") of the 2-D image you are viewing by pressing the "View" button at the bottom of the SPICE window (NOT the View menu at the top of the window used in the previous step), and then selecting the "Stretch" function. The light-blue sliders in the Stretch window can be adjusted to taste, using the intensity histogram as reference.
  4. Select the output directory for the output files by pressing the “Output” button on the lower left of the SPICE window.  This output directory will be used to store the   "*_profile.tbl," "*_ridge.tbl," "*_extract.tbl," and "*_spect.tbl" file generated by the extraction. The "*_spect.tbl" is the final product -- this is your extracted 1-D spectrum in (ascii) IPAC table format.
  5. To begin the extraction, Click the "Profile" button at the bottom of the SPICE window, this will brings up the Profile function, which calculates the wavelength-collapsed average profile in the spatial direction across the 2-D background-subtracted spectrum.   Clicking on the larger blue "Profile" button, above the row of buttons, actually performs the function.   Note that for the background-subtracted spectrum, a "positive" profile and a "negative" profile (from the other nod) relative to the zero level, are seen as the output.  Next, establish the (peak) ridgeline of the spectrum in the dispersion direction along the 2-D spectrum. Clicking the "Ridge" button will perform the function; you can either allow SPICE to automatically derive the ridge peak or set the ridgeline peak manually by clicking on the profile plot (or typing into the box provided).

  1. To extract the spectrum, press the "Extract" button at the bottom of the SPICE window. This will bring up the Extract function. Pressing the larger blue "Extract" button above the row of buttons in the figure below will actually perform the function. The extraction can either be done in "Auto" mode or "Manual" mode, and you can specify which orders will be extracted using the "orders" button. For the low-resolution modules, the spectrum is extracted along the Ridge location, in accordance with the wavelength-dependent Point Spread Function (PSF) and the spectral trace (with "Auto" width). The Extract function can employ a window with a different width ("Manual" width), but the width will still scale with wavelength, unless a full-slit extraction ("Full" width) is specified (using the ExtSrc option under “Width”).  Note here that an “extended source” is expected to fill the entire slit.  Although it is possible to manually set the extraction width (e.g. change it to 7 pixels at 14 microns) to pick up the comet’s coma, the default flux calibration in the subsequent step will not be accurate.     Note that the output of the extraction is still in instrumental units, i.e., electrons/sec, and we perform the conversion to flux in the next step.

  1. You still need to "tune" the extraction by applying the flux conversion from instrumental to absolute flux units. To do this, press the "PtSrcTune" or “ExtSrc Tune” button at the bottom of the SPICE window. Again, in this case the definition of an extended source is on that fills the entire slit so we use the PtSrcTune button to bring up this function.  Pressing the "PtSrcTune" button above the row of buttons will actually perform the function, correcting the slope and curvature of each order by applying the polynomial coefficients in the "*_fluxcon.tbl" file. This correction is based on an order-by-order comparison of calibration data to standard star model spectra. The flux units are now in Janskys (Jy). Note that this conversion is only accurate for point sources and so will work for the comet nucleus, using the default ridge parameters. Currently, the tune calibration will not be accurate for extended targets that do not fill the slit, such as the nucleus + coma in this case. If you have MIPS or IRAC photometry of the same extended target you observed with IRS, it may also be possible to cross-calibrate the spectra using these imaging observations, as was done for the SW-1 observations (Stansberry et al., 2004).  

  1. SPICE will output the profile, ridge and extract information, and the 1-D spectrum, as table files. This will go to the output directory you specified in step 7.  If you did not specify an output directory before starting the extraction process, these files will default to being stored in the spice/output directory.
  2. To quit SPICE, pull down the "File" menu and select "Exit."

Return to the Data Analysis Demos main page.