Spitzer Documentation & Tools
SPICE User's Guide

 

 


Appendix A.                  SPICE on the Command Line

A.1    Why use the command-line version of SPICE?

If you have only a handful of spectra to extract, we suggest that you use the GUI version of SPICE. The GUI version provides visualization features (2D spectrum display, profile plots, ridge overlays, etc.) which can help you ensure that your extraction is going as desired.

 

If you have a large number of spectra that must all be reduced in an identical way, one option is to use the SPICE GUI in batch mode. However, if you have a huge number of spectra and/or limited memory, batch mode may be insufficient to reduce all of your spectra in one batch. In that case, you may either choose to run multiple batches, or to use the command-line version of SPICE to write a script to reduce your spectra. The command-line version also makes it possible to call SPICE from within other programs (e.g. IDL).

 

If you choose to write a script, we recommend that you first use the GUI on a few of your spectra to experiment with your extraction parameters. You can then use the command line to script the remainder of your extractions using the same, optimized parameters. Every time the GUI runs, it writes out the corresponding command-line parameters in the spice*.log files in your ~/.spot/ directory. For each module, the input parameters are listed on separate lines for improved readability. To execute these on the command line, you will have to reformat them into one line. In addition, you must make sure that the SPICE binaries (in the bin/ subdirectory of your installation) are in your path.

A.2    Running SPICE on the Command Line

The SPICE modules are run on the command line using the following syntax. We assume that you are in the directory containing the data to be reduced.

unix% <module> <option flag> <specification>

where the option flags can be used to specify input and output files and parameters, and must be matched with a corresponding specification. e.g. to run the PROFILE module on the file SPITZER_S0_7130112_0002_6_A14567688_bksub.fits with the corresponding mask files and calibration files, you would type the following (long!) one-line command:

profile -i SPITZER_S0_7130112_0002_6_A14567688_bksub.fits -b SPITZER_S0_7130112_0002_6_A14567689_bkmsk.fits -fb 28800 -o SPITZER_S0_7130112_0002_6_A14567688_bksub.profile.tbl -q SPITZER_S0_7130112_0002_6_A14567688_bksub.profile.qa -t /Applications/spice/spice.app/Contents/Resources/platform/mac/cal/C15.0PRE25/b0_psf_fov.tbl -w /Applications/spice/spice.app/Contents/Resources/platform/mac/cal/C15.0PRE25/b0_wavsamp.tbl -c 1000

 

The available modules are listed in the following sections, along with an explanation of their option flags.