SSC Home
Page

Calibration Observations of ksi Draconis:
IRS Short-High

Requirements:

Outline of the demo:

ksi Dra is a K2 giant, which is observed about once a month, as part of routine calibration observations. It is generally observed in the LL, SH, and LH modules.  Here we will concentrate in SH. 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 P01418-_calsfx-18C-ksiDra_2.zip
unix% unzip P01418-_calsfx-18C-sky_2.zip
  1. This will create a directory with the name corresponding to the AORKEY (r13195008 and r13196544) 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 demo we will only use the ch1 subdirectory. An explanation of the contents of each can be found in the IRS Data Handbook. You may also find the IRS Pipeline Handbook useful.

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

    unix% ls r13195008/ch1/bcd/SPITZER_S1_13195008_000*bcd.fits

  2. you'll get the list of bcd files. Some insight on to the content is provided by the information given in Leopard, regarding this AOR. From it, we see that there were three repetitions (cycles) in the SH module. So we should have six science images (because there are two nods per cycle).
detail

  1. Before attempting any data reduction, visualize your AOR on the data of your observations 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, and by using "Overlay AORs in current image", we see that the sky observations are indeed in an empty region.


 Leopard
The bcd.fits files are the ideal ones to start. The file names (as explained in this page) have the form SPITZER_S1_13195008_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_S1_13195008_XXXX_YYYY_Z_func.fits, SPITZER_S1_13195008_XXXX_YYYY_Z_bmask.fits, SPITZER_S1_13195008_XXXX_YYYY_Z_spect.tbl, etc.
  1. 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 ksiDra_X_Y_*.  Also, change the names in r13196544 to sky_X_Y. Use your favorite Unix script or word processor to do this. Now you can invoke SMART. Here we will assume that we are in directory /home, and that below are the directories r13195008 and r13196544.
unix% smart/smart

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

Project Manager

  1. Although it is not strictly necessary, it will help to 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 example assumes that the data tree is on a directory called.
IDL> make_3plane,dirname='r13195008/ch1/bcd'
IDL> make_3plane,dirname='r13196544/ch1/bcd'

  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.

Data Manager

Click on "Browse" and put in all the files that you want to reduce. In this case, we want all the bcd3p files, both in the target and sky directories. 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 ksiDra_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 first nod position, after adjusting the Min and Max parameters. 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. We should also 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.

smtv

 

  1. At this point we should decide how to combine the images. The combination can be done at the image level or at the spectrum level. Given that this is a demo, let's try a little bit of both. Here are the steps:
  1. Details on the way to combine images can be found in the relevant section of the SMART manual. Select all the images ksiDra_2_Y in the Data Manager, click on "ImOps". On the "Image Operations" window, click on "Combine", and select "Median". You will be asked if you want to check the result (in which case a SMTV window will appear. If you select this option, upon closing the SMTV you'll also be asked what name do you want to give the image. If you decide you don't want to check the result, the image will be named "Combined_median" and will be placed at the bottom of the Data Manager. You can change the name by selecting it and clicking on "Rename File". Be aware that each of these steps takes some time, and if you rush it by closing the "Image Operations" window before it closes by itself, SMART is likely to crash.
comb1
comb2
comb3
  1. At this point we should have four images that we have called here ksiDra_2 (median combination of ksiDra_2_0, ksiDra_2_1, and ksiDra_2_2), ksiDra_3 (median combination of ksiDra_3_0, ksiDra_3_1, and ksiDra_3_2), sky_2 (median combination of sky_2_0, sky_2_1, and sky_2_2), sky_3 (median combination of sky_3_0, sky_3_1, and sky_3_2).
  2. Before going any further, let's save the project in the "Project" menu of the project window. Save it with extension smp. When you save the project, all the images that you created are saved too.
  3. We will now subtract each image from the corresponding sky, resulting in ksiDra_nosky_2 and ksiDra_nosky_3. The "2" and "3" at the end of the names are relics from the pipeline processing, but we will keep them. Use ImOps to do this: select for example ksiDra_2 and sky_2, click on "ImOps", and on the "Image Operations" window, click on "Arithmetics". In the output window, type im1-im2 and then "Execute". Change the name of the resulting file to ksiDra_nosky_2. Do the same for ksiDra_3 and sky_3
  4. Time to extract the spectrum. Press "Extract". You'll be confronted with a series of possibilities. Given that we have already subtracted the sky, let's select "Full/NoSkySub". Then click on "Exit".
 extract



  1. The SMART-IDEA window will appear. On "Order", select "All". The click on "Plot". The spectrum will appear. You can select "Style" and then "Connected" to have a continuous line.
IDEA


Notice that there are bad pixels and order mismatches. By the way, if you extract the full slit spectrum before doing the sky subtraction (i.e. using for example ksiDra_2_0_bcd3p.fits), you'll get the spectrum given as part of the bcd products ksiDra_2_0_spect.tbl.
  1. The first spectrum you produce will be your "Prime Dataset". Without closing the IDEA window, go to the Data Manager, select ksiDra_nosky_3, and extract the spectrum in the same way as you did for ksiDra_nosky_2. A window will acknowledge that the IDEA dataset has been updated. Click on "Store": you'll see the stored datasets. The top one is your prime dataset. Select the second one, and the click on "Choose and Apply Function: Merge with Prime Dataset".
  2. Now is time to clean up the spectra. There are multiple ways of doing this. Here we will just plot every order and mask the outliers. In "Order", select 11 and then plot. With the right mouse button, make a square around the pixels you want to mask. The Applications window will appear.

Applications

  1. Select "Mask". You can either "Zap" or "Mask". The difference is explained here. 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 all the bad pixels in each order.  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)". After, click on "Exit". You'll end up with a single spectrum. When 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.
IDEA2
  1. There are different options you can use to save it. Click on "Store". You'll be presented with an array of choices. You'll see the original datasets and the modified, chopped-up spectrum (with a lot of "M"s in its name). Let's just select the modified spectrum and then select "Write to disk in...". Choose your favorite format. You have a spectrum! If, instead of doing this, you simply click on "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 27:20:54 GMT