SSC Home
Page

SINGS Galaxy NGC 4579:
IRS low resolution modules

Requirements:

Outline of the demo:

NGC4579 is an extragalactic source which was observed as part of the SINGS Legacy program. The source was mapped out using the IRS spectral modules, both in the low spectral resolution and the high spectral resolution modes. In this page we will outline the steps required to go from the zip file you get from the Spitzer data archive to a basic spectrum using the spectral extraction tool called SPICE. The illustration here is for only one position in the spectral map but can be used for any observation performed in the staring mode or spectral mapping mode.

Step by Step Guide

  1. The first step consists of extracting *bcd.fits files from the zip file you get from the archive:
  2. unix% unzip ngc4579_sings_bcds.zip
    OR if you have multiple zip files that you want to unzip in a single step:
    unix% unzip \*.zip

  1. This will create a directory with the name corresponding to the AORKEY (r9494528) with subdirectories such as ch0, ch1, ch2, ch3 corresponding to the Short-low (short wavelength low resolution = SL), Short-high (SH), Long-low (LL) and Long-high (LH) modules respectively. In this particular example only the ch0 and ch2 subdirectories are created corresponding to the low resolution modules.

    Each of the ch? subdirectories has the bcd.fits files in the bcd subdirectory. The bcd.fits files are the ideal ones to start with to obtain a final reduced spectrum. You will also need the *func.fits and *bmask.fits files which are the uncertainty files and bad pixel mask. You can edit the bmask files by hand to flag pixels which might be bad in your data. To identify which bits in the bmask file need to be changed to flag a pixel, read section 7.3 of the SPICE user's guide, in particular Table 1. Click here to get campaign specific bad pixels masks which were created from the IRS darks.


  1. Before attempting any data reduction, visualize your AOR on the data of your observations in SPOT to understand the orientation of the observations and the sequence in which the files were generated. The AOR used and the visualization of these particular spectral mapping observations are shown below. As can be seen the short wavelength modules each consist of 18 steps in the perpendicular direction while the LL1 module consists of 6 steps parallel to the slit and 10 steps perpendicular to the slit.

  1. Then view your data in 2D format using your favorite fits file viewer such as DS9 or SAOIMAGE. The short low data is shown on the left and the long low data on the right for different positions in the spectral map. Note that in SL order 2, the nuclear source is in the slit in position 9. In SL order 1, the nuclear source is in the slit in position 27 for these observations.

  1. Now you are ready to read your data into SPICE. Start by running the spice.csh shell script (Requires Java Development Kit version 1.4.0 or higher).
  2. unix% spice.csh

  1. Load the bcd, uncertainty and mask files into SPICE. This is done by clicking on “Input” and then clicking on the buttons labeled “…”

  1. Click on the View button and then display button to see the data on the right side window. You can also change the viewing parameters such as the stretch or zoom of the display window inside the “View” module.

  1. The next step is to check the name of the output files because each time a module is run, the output files are overwritten. So you want to be careful in changing the output filename when you change the extraction parameters. This can be done by clicking on the “Output” button and entering the output filenames. Note that the current version of SPICE automatically changes the output filenames when the input filenames are changed.

  1. Select the order you want to get a profile for. This is done by clicking on the “Profile” button. Then clicking on “Orders” and choosing “Default”, “1”, “2 and 3” or “All”.Order 3 is the bonus order. In the example shown, the source is in the order 2 slit so we want to generate a profile just for order 2 and 3. Once you have selected an order, run the Profile module by clicking on the profile button. Note that there are two profile buttons, one to select the Profile module and another to run the Profile module. The button to run the Profile module is above the one to select the Profile module. The profile module collapses the spectrum in wavelength space for a particular slit order – this maximizes the S/N to help determine where the source is within the slit.

  1. Then run the Ridge module. If the center is set to “Auto” then the peak in the profile is automatically assumed to be the source and a spectrum extracted for the source. Alternately, use the “Manual” option to enter a number as a percent of the slit width where the source should be extracted from. This is particularly useful when you want to extract the spectrum of the sky or the spectrum of a secondary source which is not the brightest source in the slit.

  1. The width over which the spectrum should be extracted is defined in the next module, the “Extract” module. You can either extract a spectrum for the full slit or specify the width in pixels for a particular wavelength. The width of the extraction window increases with increasing wavelength to factor in the increasing point spread function. If you specify a width at 0 microns, then a constant width extraction window is used which is independent of wavelength. The lines in the right hand window illustrate which part of the slit is being extracted. Then run the module by clicking on the “Extract “ execution button. In this module, there are also other options such as extended source extraction "ExtSrc", masking of specific bits and interpolation of NaNs which can help you improve the fidelity of your spectrum.

  1. Finally flux calibrate the extracted spectrum using PtSrcTune. Click on the “PtSrcTune” module button and then on the “PtSrcTune” execution button to obtain a flux calibrated spectrum for a point source. If you use the default options in each step of the process, the output of tune should be exactly the same as that of the postbcd files that you downloaded from the Spitzer archive. The output of the “Tune” module is a file called “*spect.tbl” which you have specified in the “Output” module of SPICE. For extended sources, you might consider the extended source tune button which makes specific assumptions about the spatial and spectral nature of the extended source (See SPICE manual for details).

  1. If you are working with LL data or high resolution data, it is likely that you will have residual fringes. This can be removed using the IDL procedure IRSFRINGE. Fire up IDL and at the IDL prompt:
  2. IDL% irs=ipac2irs('spect.tbl')
    IDL% irsd=irsfringe(irs,order=1)

IRSFRINGE has a number of different options which are discussed in the IRSFRINGE User’s Guide. These allow you to defringe only particular orders or a particular wavelength range or mask particular spectral features that might affect the defringing. Defringing is generally an empirical tool which should be used at the observer’s discretion since it is not always clear how many sine waves need to be fit to the data or what their relative frequencies are.

Miscellaneous Notes

· Use calibration files which are consistent with the version of the pipeline that was used to process your data i.e. look at the header of your bcd.fits files. If they were processed with S11.0.2, use calibration files that correspond to S11.0.2.

·SPICE has a batch mode which allows you to process large numbers of files in exactly the same way once you have identified the appropriate extraction parameters for your data. The pdf file contains a slide which illustrates how the batch processing can be setup.

·The default options for the steps outlined in this illustration i.e. profile, ridge, extract, tune and defringe will result in an output spectrum which is similar to the Spitzer IRS pipeline. You will want to improve the quality of your data before undertaking these steps by performing:

1. sky subtraction – Subtract one nod position from the other. Or create a supersky by taking a median of the bcd files from the off source position and subtract it from the on source data

2.Creating bad/hot/rogue pixel masks which are appropriate for your data by flagging bits in the bmask files

3.Changing the extraction width from the default value of full slit to maybe 2 pixels which would correspond to a Nyquist sampled point source. However, to ensure that your resultant flux calibration is correct, you must download the data for the calibration stars and extract the spectrum with exactly the same extraction width. In other words, lets say Source_lambda is the spectrum of your point source and Calib_lambda is the spectrum of the calibration star extracted with the same extraction parameters. If Calib_Decin is the Decin spectral model corresponding to this star in Jy, then the calibrated spectrum of the source is Source_lambda*Calib_Decin/Calib_lambda.

See Chapter 10 of the IRS Data Handbook which describes the steps you should undertake before publishing your IRS data.


Return to the Data Analysis Demos main page.