SSC Home
Page

FEPS Legacy Observations of HD 105:
IRS Short Low

Requirements:

Outline of the demo:

HD105 is an G0V that was observed as part of the FEPS Legacy program. The source was observed using both the low 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 SMART. The steps are as follows:

    Setup

  1. Download the data, unzip it.
  2. Look at the details of the AORs: these will tell you what the directories contain
  3. Visualize some of the data in the sky
  4. Change the names of the files to something more user friendly
  5. Look at the data to check for latents, bad pixels in the spectral trace, rowdroops, and general showstoppers
    Reduction
  1. Decide on an image combination method
  2. Decide on a sky subtraction method
  3. Extract the spectra
    Analysis
  1. Combine spectra from different nods
  2. Write paper, wrestle with referee, humbly accept tenure.

Step by Step Guide

  1. The first step consists of extracting the files from the zip file you get from the archive:
unix% unzip P00148-_IRSS-S148.zip
  1. This will create a directory with the name corresponding to the AORKEY (r5295616) 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. An explanation of the contents of each can be found in the IRS Data Handbook. You may also find the IRS Pipeline Handbook useful. In this particular demo we will use the ch0 subdirectory only.

    Looking into r5295616/ch0/bcd/ you'll see the pipeline-processed data. If you do

    unix% ls r5295616/ch0/bcd/SPITZER_S0_5295616_000*bcd.fits

  2. you'll get the list of bcd files. Some insight on the content is provided by the information given in the AOR. From it, we see that there were two SL observations (one at the first order, and one at the second). So we should have four science images (because there are two nods at each order).

  1. Before attempting any data reduction, visualize your AOR on the sky using Leopard or Spot. This visualization is useful to evaluate whether or not there are nearby bright sources that may contaminate your sky estimate. The 2MASS K-Band image does not show any other bright targets nearby. 

Detail of HD105 AOR

Visualization of the IRS apertures on 2MASS K image of the field

  1. The bcd.fits files are the ideal ones to start. The file names (as explained in this page) have the form SPITZER_S0_5295616_XXXX_YYYY_Z_bcd.fits, where XXXX is the exposure ID (a number identifying the overall exposure), YYYY is the DCE number (or the sub-exposure number within a given exposure), and Z is the version (which tells you how many times this particular chunk of data has flown through the pipeline as a result of pipeline updates). Each bcd.fits file has other files associated with it, with names like SPITZER_S0_5295616_XXXX_YYYY_Z_func.fits, SPITZER_S0_5295616_XXXX_YYYY_Z_bmask.fits, SPITZER_S0_5295616_XXXX_YYYY_Z_spect.tbl, etc.

    Files with values of XXXX ranging from 0000 to 0001, for any value of YYYY, correspond to peak-up exposures. For the purposes of this demo we will mostly ignore them, but keep in mind that the blue peak-up array provides imaging capabilities not replicated by any other Spitzer instrument. A specific AOT is available to exploit it, but if you selected the self-peak-up option in your AOR (like it was done in this one) you get an image of your target for free. Details are available in the SOM.

    From the details of the AOR, the target was imaged in low resolution only once per aperture. However, each slit is imaged in two nod positions, and so there are two images for each aperture. You can check which one is which by looking at the headers. In this case, XXXX=0002 corresponds to the first position of SL2, XXXX=0003 corresponds to the second, XXXX=0004 corresponds to the first position of SL1 and XXXX=0005 corresponds to the second. This is all very informative, but not very user friendly when trying to reduce data. So, as a first step, let's change the name of everything to HD105_X_Y_*. Use your favorite Unix script or word processor to do this.
            Now you can invoke SMART
unix% ./smart/smart

  1. You'll end up within IDL. A GUI (the "Project Manager") will show up.

Project Manager

  1. Although not strictly necessary, you can create the file structure that SMART likes. This is a fits file with 3 extensions: the bcd data, the func data and the bmask data. With this kind of structure, SMART knows how to propagate the errors when combining frames. The IDL procedure, make_3plane.pro creates these bcd3p.fits files. The /pu flag tells the procedure to ignore the first 8 files (which have the peak-up data).
IDL> make_3plane,dirname='r5295616/ch0/bcd',/pu

  1. Now create a project. In the Project Manager window, click on "Add Dataset". A new window asking the name of the new data set will appear. Call it something descriptive, like "Reduction1". Click "OK". On the Project Manager window, click on "Add records/Edit Dataset". The dataset manager window will appear.

Dataset Manager

Click on "Browse" and put in all the files that you want to reduce. In this case, we want all the bcd3p files. Press "Control" and the left mouse button to select multiple files to upload to the project.

  1. In the dataset manager window, click on one file, for example HD105_2_0_bcd3p.fits. Upon selection, some of the buttons at the bottom will activate. Click on "View". SMART provides three different image viewers. SMTV/IDEA is an image viewer like ds9. With IDP3/IDEA you can do arithmetic on the images. Finally, with QuickLook/IDEA you can check the spectral profile in the cross-dispersion direction. In our case, let's select SMTV/IDEA.
  1. The image below shows the trace of the target in the second and "third" (or "bonus") orders, in the first nod position. The grey squares on the right are the peak-up arrays. In this step you should be checking for the presence of latents. As Spitzer does not have a shutter, bright stars may leave an imprint on the detector as the telescope slews. You may see ghost spectra in the orders.  In addition, in the case of the SL module, bright stars on the peak-up arrays may contribute light to the spectra.  A correction for stray-light is done within the reduction pipeline, but the user should check that things look reasonable. The magnitude of these two effects will determine the sky subtraction procedure to be used. Finally we should be worried about bad pixels in the spectral trace. Because the traces are so undersampled, image cleaning methods that involve averages of neighboring pixels may not work.

2D SL2

 

  1. In this case, everything is nice: the sky is uniform, there are no bad pixels in the trace, not bright stars in the peak-ups. If you click on "Extract", in the Dataset Manager window, you can select from a group of different extractions. The files spect.tbl in the directory tree were extracted with the equivalent of "Automatic Column Point Source/NoSkySub". As a sanity check, let's select "Automatic Column Point Source/NoSkySub" and click on "Exit". Some windows will flash rapidly about. Eventually, the  IDEA window will open. Click to select "All" orders, the click "Plot". You can adjust your plot preferences by clicking "Style": select "connected", in the "Line Style" line to produce a continuous plot.
IDEA image

  1. Now compare that with the spectrum produced by the extraction pipeline. This was extracted using a similar kind of tapered aperture, and the extraction process can be reproduced exactly using SPICE. If we do:

IDL>readcol,'r5295616/ch0/bcd/HD105_2_0_spect.tbl',skipline=272,ord,w,f 
IDL>plot,w[where(ord eq 2)],f[where(ord eq 2)],xr=[5,9],xsty=3,ysty=3,yr=[0,0.5],ytit='Intensity (Jy)',xtit='Wavelength (um)'
IDL>oplot,w[where(ord eq 3)],f[where(ord eq 3)]


we get
IDL Window

which produces a similar result as SMART. (The calibration of the bonus order is still being worked out. With every update of the pipeline it gets better, but as we see here, the calibration in the overlap region is incorrect.) Notice, however, that the results are not exactly the same: at this point SMART cannot reproduce the processing done by the pipeline (which can be reproduced using SPICE). The only alternative for the user of SMART is to download from the archive a standard star observation and reduce it in exactly the same way.

  1. Now that we are satisfied that things are working O.K., we are ready for some batch action. Close the IDEA window and answer "no" to the questions. In the Dataset Manager, click in all the datasets, while pressing the Control key. Then select "Extract" and "Automatic Column Point Source/AutoSky1". This will extract the spectra using a linear fit to the background in each spectral element. During the processing, some pop-up windows will show up: "Smart Sky Subtraction - Caution!!!". Do not worry about them! These should apply only to the full slit subtraction, but for some reason they show up here. The default is "None". Leave it as is and click on "Exit".
  2. At the end, the IDEA window will pop-up again. Select "All" in  BCD, Order, Slit Pos, and Module, and then click "plot". You will get a plot with all your spectra. It is for these applications that the IDEA facility is best. You can zap bad pixels and combine the spectra. Let's trim the edges, get rid of the bonus order and median-combine the spectra. First get rid of the two leftmost pixels: use the left mouse button to make a box around the left side of the spectrum. This will zoom in. With the right mouse button, make a box around the two leftmost pixels. The "Applications" window will appear.

Applications

  1. Select "Mask". The pixels in the box will be ignored in further analysis (you can undo the last step by pressing "Undo" in the top of the IDEA window). Mask also the pixels in order "3". Now, you are ready for averaging. With your right hand mouse button, make a square encompassing all the data. On the Applications window, select "Average". Another window will pop-up, with a lot of options for averaging. Let's just select "Median (no clip)". Then click on "Exit". You'll end up with a single spectrum. If the spectrum is satisfactory, click on "Store-Prime" in the top of the IDEA window. THIS IS VERY IMPORTANT. If you don't do it, the spectrum that you obtain after masking the bad pixels and averaging WILL NOT be stored. IDEA image

  1. There are different options you can use to save it. Click on "Store". You'll be presented with an array of choices. The ones with "_off" at the end of their names are extractions of the off-source slit. You can use these as sky measurements. You'll also see the precessed dataset, with a name like "Avg:M:M:M:". Select it and then select "Write to disk in...". Choose your favorite format. You have a spectrum! If, instead of doing this, you simply click "Quit" on the IDEA window, you'll be asked if you want to put the spectra in the Data Manager. From the Data Manager you can "Export to file", although your choices here are somewhat more reduced.


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.

·All this steps can be done in the IDL command line, bypassing the GUIs. This allows you to incorporate the routines in your own code.

·The error measurements for each wavelength are not trustworthy. The current pipeline does not propagate the errors correctly. You are better off determining the errors from your own data.

·Extensive help regarding SMART is here.



Return to the Data Analysis Demos main page.

This page last updated: Wed, 3 Aug 2005 16:50:54 GMT