|
SINGS Galaxy NGC 4579:
IRS low resolution modules
|
Requirements:
- Follow the instructions on Spectroscopy:
Custom Spectrum Extraction to get and install the SPICE software.
- Follow the instructions on Spectroscopy:
Defringing to get and install the IRSFRINGE software.
- Download the data associated with the SINGS observation of NGC 4579.
There are several example Leopard downloads
available, but not for this specific object. Search by position to
find AORKEYs 9479424 (Sky Background for short-low data),
9494528 (Short-low module 1st and 2nd orders and Long-low module both),
and 9499136 (Short-high and Long-high modules). The example below walks through
the steps for AORKEY 9494528, 2nd order. For a better understanding of the
wavelength range and names of the modules see the IRS pocketguide.
The image belows shows a leopard screenshot to query the archive by AORKEY.
This involves going to Query->By AOR ID->Typing in the AORID->OK. Then
select the BCD, PBCD, Cal data boxes on the lower right and File->Download Selections which
will transfer the zip files from the archive to your hard drive.

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
- The first step consists of
extracting *bcd.fits files from the zip file you get from the archive:
unix% unzip ngc4579_sings_bcds.zip |
OR
unix% unzip \*.zip |
if you have multiple zip files that you want to unzip in a single step:
-
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.
- 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.
- 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.
- 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).
- Load
the bcd, uncertainty and mask files into SPICE. This is done by clicking
on “Input” and then clicking on the buttons labeled
“…”

- 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.

- 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.

-
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.

- 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.
- 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.

- 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).

-
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:
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.