SSC Home Page

FAQs: SMART


SPITZER HOME || SPITZER SCIENCE || INSTRUMENTS || SCIENCE USER SUPPORT || SEARCH

+ - General Information
- Spitzer News
- Research Categories
- Science Schedules
- Advisory Groups
- Observing Rules
- Legacy Program
- First-Look Survey
+ - Observatory & Instruments
- Overview
- PCS
- IRAC
- IRS
- MIPS
- AOTs
+ - Science User Support
- Proposal Kit
- Documents
- Tools
+ - Approved Programs
- Observing Schedules
+ - Data Archives / Analysis
- Science Archive Access
- Post-BCD Tools
+ - Data Analysis Funding
- Information
+ - FAQ
- Search site

See also SMART web pages.


Table of Contents:
                         Q:   How is SMART different from SPICE?
                         Q:   I have installation problems. What do I do ?
                         Q:   Does SMART work on Mac OSX ?
                         Q:   Are there any issues with installing SMART for Macs?
                         Q:   How do I calculate the coordinates of the source depending on where I do the extraction within the slit ?
                         Q:   In the interactive extraction mode, the size of the extraction window appears to be insensitive to the manually defined extraction width.
                         Q:   Why is the extracted spectrum that I get different between SMART and SPICE ?
                         Q:   How do I script the extraction of multiple sources in SMART ?
                         Q:   Is there a data reduction cookbook for SMART ?
                         Q:   How do I bypass the usage of masks during extraction with SMART?

Q:   How is SMART different from SPICE?

A:   After the data are processed by the BCD pipeline (bias-corrected, flat-fielded, etc), they go through the Extraction pipeline. The later extracts the spectrum from the images (without subtracting the sky) and writes the result to the spect.tbl files, which are provided to the user. SPICE, developed by the SSC, is simply a wrapper for this extraction pipeline. Given an image or a set of images, SPICE will extract the spectra (individually or in batch mode). A new button is being added to allow the user to obtain an image with a rectified version of the input image, one in which the trace is exactly along the columns.

To use SPICE, the astronomer first needs an image processing program (like IDL or IRAF) to combine the images and subtract the sky, if applicable. The result is then fed to SPICE. If the default extraction apertures are used (tapered apertures for the low resolution modules, full-slit extraction for the high-resolution ones) the result will be a flux-calibrated spectrum. The astronomer can then use a plotting program (IDL or Supermongo,for example) to display the result. Because it does very little, SPICE is easy to use.

SMART, developed by the IRS group at Cornell University, is contributed software (therefore not developed by the SSC), and provides one stop-shopping. Within it, you can combine images (average them, subtract them, etc), display the result (using a simplified version of ds9), mask the bad pixels, extract the spectrum and plot it. Because of its large number of features, it has a somewhat steep learning curve. The user should be aware that, if extracting low-resolution spectra, the resulting flux calibration will NOT be correct (see below: Why is the extracted spectrum that I get different between SMART and SPICE?).

Should you use SPICE or SMART? If you do not know how to use the fits processing routines in IDL, or IRAF, SMART is the way to go, and is the only piece of software you will need to learn. On the other hand, if you are IDL- or IRAF-savvy, SPICE is easier to use and it will get you from the downloaded files to the flux-calibrated spectrum faster.

Q:   I have installation problems. What do I do ?

A:   Read the SMART installation documentation carefully. In almost all cases, problems have been because of the order of directories in the IDL_PATH or a missing "+" sign or the absence of the IDL astro library in the IDL_PATH. Make sure you have the most recent IDL astro library installed. For example, if you have the idl astro libraries installed somewhere other than /usr/local/lib then you should change the setenv IDL_PATH statement to setenv IDL_PATH +/home/john/smart:+/home/john/IRS_Calibration:+/home/somewhere/astrolib:+/usr/local/lib

Q:   Does SMART work on Mac OSX ?

A:   Yes - all SMART requires is IDLv5.6 or greater. The setup for SMART under a Mac is identical to that given in the SMART installation guide.

Q:   Are there any issues with installing SMART for Macs?

A:   We have had this report: A user tried to install SMART on Mac OS X 10.3.9 under Bash. To get it working he needed to tell smart in its /smart/utility/misc/sm_list_files.pro file on line 46

if !version.os eq 'linux' or !version.os eq 'darwin' then begin
.... Thus putting the extra !version.os eq 'darwin'. The same change needs to be done in line 81 of /smart/scripts/pro/sc_read_fits_bcd.pro

Q:   How do I calculate the coordinates of the source depending on where I do the extraction within the slit ?

A:   The values that are relevant are RA_SLT, DEC_SLT, PA_SLT. RA_SLT and DEC_SLT are different for different nod positions while RA_FOV and DEC_FOV remain the same between nods. So lets say your PA_SLT is 0 degrees (that means the long axis of the slit is rotated 0 degs east of north and the top of the slit is due north of the bottom of the slit). If PA_SLT is 90 degs, then the top of the slit is due E of both the slit center and the bottom of the slit. Now to map this onto a BCD.

For SH and SL, the source is first at the slit bottom and then the top (for the two nod positions). The bottom of the slit is mapped to the left of the BCD and the top of the slit is mapped to the right of the BCD. For LL and LH, the source is first at the top of the slit and then at the bottom. The top of the slit is mapped to the right of the BCD and the bottom of the slit to the left.

Now you want to calculate the coordinates of your source. Lets say your source is at pixel x. Then its offset from the slit center is alpha = (x-xcen)*pixscale in arcsec (you can look this up in the wavesamp_offset file or you can read x and xcen off with your cursor)

This has to be projected in RA and DEC.

delta_RA = alpha*sin(PA_SLT) in arcsec

delta_DEC = alpha*cos(PA_SLT) in arcsec

note that alpha is negative to the left of the center of the slit and positive to the right of center of the slit. So for all PA_SLT values between 0 and 90, delta_RA is -ve. For PA_SLT values between 0 and 180, delta_DEC is -ve.

Since cos(DEC) is pretty much constant over the length of even the longest subslit:

true_RA = RA_SLT +/- (abs(delta_RA)/3600.)*sec(DEC_SLT)

true_DEC = DEC_SLT +/- (abs(delta_DEC)/3600.)

where you use +/- depending on which quadrant you are in. Of course, to save you all this trouble, you can just extract a spectrum in SMART and save the extracted spectrum and it will give you the coordinates of the source you extract.

Q:   In the interactive extraction mode, the size of the extraction window appears to be insensitive to the manually defined extraction width.

A:   This is a known problem and is being fixed.

It has been reported by a user that selecting 'fixed column' extraction in the 'interactive extraction' will perform a fixed column extraction and will use the user-defined extraction width if you manually set the user-parameter !sm_fwhmfactor=+1 in the calibration setup. Or alternatively this can be done by typing !sm_fwhmfactor=1.0 at the IDL prompt, within the SMART environment. You will need to set this back to -1 when doing any other type of extraction. The effect of doing a fixed column extraction with !sm_fwhmfactor=-1 is to use the standard SSC-defined extraction windows (i.e. 4.25 pixels wide at 16 um in LL2), but without scaling with wavelength, i.e. a fixed width of 4.25 pixels for LL2.

Q:   Why is the extracted spectrum that I get different between SMART and SPICE ?

A:   For a full slit extraction, SMART and SPICE should provide very similar or identical spectra. However, because the calibration files were created for a point source using a particular extraction width which is defined in the psf_fov file in the cal directory, the flux calibration is valid only if the source is a point source. In other words, the Decin models provide the spectrum of the star while the extraction is done in a 4-7 pixel wide aperture. So the calibration takes into account the flux loss outside the 4-7 pixel wide aperture as well as any slit loss correction terms provided the source is a point source. The extraction width is different when you use automatic column or automatic point source extraction in SMART and so the flux loss correction terms would be different which is why the extracted spectra have different flux levels. If the point source extraction width used for calibration is inappropriate for your source, you will have to download the calibration stars from the data archive and redo the extraction in the same way that you find is appropriate for your source.

Q:   How do I script the extraction of multiple sources in SMART ?

A:   Scripted autosky extraction hasn't yet been programmed into SMART and is on the to do list. However, you could look into the IDL source code to identify the subroutines which perform source extraction and write an IDL program which has just these routines (without the widget calling interface). For example the following segment provided by a user if incorporated inside an IDL routine would perform a basic extraction:

sc_read_fits_bcd, bcd_dir='/here/bcd' , ptr_bcd, filetype='bcd3p'

; Set calibration

sm_wavesamp, cal ;, /restore_cal, /save_cal

; difference the images by subtracting the image of the

sc_bcd_diff, ptr_bcd, newptr_bcd, debug=debug

; Set relevant SMART required keywords in BCD FITS headers

sm_preset_bcd, newptr_bcd

; Pre-process data for Column extraction

sm_auto_all, newptr_bcd, sigma=sigma, /column, /debug

; local sky extraction

sm_bcd_isap, cal, newptr_bcd, ptr_aar, 1, debug=1

Q:   Is there a data reduction cookbook for SMART ?

A:   Unfortunately not but there are illustrations of data reduction with SMART at this link.

Q:   How do I bypass the usage of masks during extraction with SMART?

A:   To do it you need to make your own extraction mask. The simplest way to do this is to write an IDL routine which makes a 128X128 array, sets the array elements to the values you want them to be and then writes out to a file. Mask files can be either ".fits" (binary) or ".txt" (ASCII) and for the SMART files we continue the file types used by SSC. Do NOT replace ".fits" file with a ".txt" or vice versa. SMART will crash if you try.

For example, suppose you want to change a bad pixel mask. In any of the SMART "bpm" files there is a 128X128 array where the elements corresponding to good pixels in the detector array are set to "1" and bad pixels are set to "0". During extraction the data array is multiplied by the bpm array. The good data points are unchanged, the bad ones set to zero.

If you do not want any data array pixels set to zero simply set all elements in the multiplying array to "1".

Add a header to your file by copying the one from the corresponding SMART supplied file and edit the comments to make it clear that this is a special file you have made yourself. SMART expects file headers and will crash without them.

Having made your file, give it a name that fits in with the SMART calibration file naming convention. This is described in detail here

So for a new (long low for example) bpm file, the name would be something like "irs_ll_bpm_b1.fits".

The string "irs_ll_bpm" is what allows SMART to find the file. The "_b1" (or similar) is the version number. Do NOT give any file you make the same name/number as an existing file. Further all desingantions beginning "_v", "_s" and "_e" are reserved for future SMART and/or SSC file releases. Pick something completely different, like "_b" (for Ben).

Once you have made your file add it to SMART by putting it in the directory :

..../IRS_Calibration/type

Where "IRS_Calibration" is the top of the calibration files directory tree in your installation of SMART and "type" is the directory for the type of file you are adding. (For bpm the directory for this is "mask".)

DO NOT UNDER ANY CIRCUMSTANCES CHANGE, RE-NAME, MOVE, DELETE OR OVERWRITE ANY EXISTING SMART CALIBRATION FILE.

If you do this SMART will crash.

Once you have added the file to the calibration directory tree invoke SMART. Go to the SMART Calibration selection window. Description is available here .

From the Project Manager window click "Calibration" and "Setup". On the list of "SubDirs" pick the directory to which you have just added the new calibraion file. For a bpm file this will be "mask". Scroll down to the relevant module and mask type (EG. "ll_bpm") and click on the file displayed. Assuming you have added the new file with the right name and directory it will then appear on the drop down list of selectable calibration files for that type. Select it as default. It will display as the selected file. Then click on "Exit with this". The Calibration window will disappear and the default will be set to the new file you have added.

You can then run extractions using the file you have made. It may be best to run a few test extractions to check. At any time you can switch back to the original SMART supplied ones by returning to the Calibration Selection window and clicking on "Exit with SYS". This will re-set your defaults back to the SMART supplied original.


Go back to FAQ page.


SPITZER HOME || SPITZER SCIENCE || INSTRUMENTS || SCIENCE USER SUPPORT || SEARCH

help@spitzer.caltech.edu
http://ssc.spitzer.caltech.edu/faq/smart.html
This file was last modified on Fri Mar 30 11:34:52 2007.

California Institute of Technology Jet Propulsion Laboratory NASA