Spitzer Documentation & Tools
SPICE User's Guide

A.6    Optimum

Runs the Optimal extraction algorithm. To run, type:

unix% optimum <option flag> <specification>

 

Where the options are as follows:       

 

-p                     Input stellar profile template FITS file.

 

 -I                     The input 2D spectrum from which you wish to extract a 1D spectrum.

 

 -u                                The name of the uncertainty file that goes with the input 2D spectrum. If you do not specify an uncertainty file, the extraction will be profile-weighted only, and will use the default uncertainty value set by the flag –default_unc (see below) for all pixels.

 

 -b                                The name of the mask FITS file that goes with the input 2D spectrum.

 

 -w                   The name of the *wavsamp.tbl file. This file specifies the location of the spectral orders on the array in x-y coordinates. It consists of pseudorectangles, which describe the fractional pixels that comprise each wavelength in the spectrum. You should choose the appropriate file in the cal/ subdirectory of your SPICE installation. The file you choose should match both the Spitzer pipeline version with which your data were processed and the IRS module with which you are working.

 

 -ridge              The name of the output table from running the Ridge module.

 

 -o                                The name of the output extraction table file.

 

 -r                     The name of the output rectified flux FITS file.

 

 -r_unc             The name of the output rectified uncertainty FITS file. This is an optional intermediate product. SPICE will not write out this file unless an output filename is specified by the user.

 

 -r_bmask        The name of the output rectified BMASK FITS file. This is an optional intermediate product. SPICE will not write out this file unless an output filename is specified by the user.

 

 -r_wave          The name of the output rectified wavelengths FITS file. This is an optional intermediate product. SPICE will not write out this file unless an output filename is specified by the user.

 

 -r_ord             The name of the output rectified order numbers FITS file. This is an optional intermediate product. SPICE will not write out this file unless an output filename is specified by the user.

 

 -r_offset         The name of the output rectified offsets FITS file. This is an optional intermediate product. SPICE will not write out this file unless an output filename is specified by the user.

 

 -ow                 The name of the output wavsamp file of rectified image.

 

 -op                  The name of the output 2D profile FITS file.

 

 -ox                  The name of the output profile ASCII file.

 

-fatal                The Fatal Bit Pattern for the input mask file. See Appendix B for more information on calculating the Fatal Bit Patterns, and §1.6 for the mask bit definitions. Default = 0.

 

 -area_width     Width of the rectification area in pixels. Must be an odd integer.

 

 -pct_center      Location of the center of the source, in percent. default: -100.0, which uses the output from Ridge instead.

 

 -keepnans       Set this to 1 if you wish a rectified pixel to be set to NaN if any of the corresponding pixels in the original image are NaNs. Default is 0, which approximates the output value of the pixel with remaining non-NaN pixels (see the replprofnan parameter below).

 

 -replprofnan    Replace NaNs in profile. If  N <= 0 then leave alone. If N > 0, estimate the value of the output pixels from N neighbors. Default = 3.

 

 -height1          Sets the wavsamp height. Set to 1 to force the wavsamp height to be set to 1 pixel. Set to 0 to use the actual height.

 

 -resamp           Method of computing pixels in the rectified image. Default is "weighted bilinear":

·         0 = nearest neighbor

·         1 = weighted bilinear

·         2 = unweighted bilinear

 

 -v                    Verbosity level of printed messages. Default = 1.

 

 -n                    Name of a namelist file listing all the input parameters. This can be used instead of specifying all of the flags on the command line. Default is optimum.nl.

 

 -clip_width     Width (in pixels of the original non-rectified image) of the extraction aperture at the reference wavelength. Default is half the width of the order.

 

 -clip_lambda0             Reference wavelength (in microns) of the aperture width specified with the "-clip_width" flag. Default is to use a constant width extraction aperture.

 

 -default_unc   Sets the default uncertainty value if there is no input uncertainty file specified, or if a pixel value in the input file is NaN. Default is 1.0. Input units are electrons per second.

 

 -unc_tune       Adjustment applied to the uncertainties in rectified space to compensate for the fact that they are correlated. 0.0=none. Default = 1.0.

 

 -norm              Normalize the fluxes. Default = 0:

·         0 = no normalization

·         1 = divide by height of wavsamp rectangle

·         2 = divide by area of wavsamp rectangle

Set this to 1 for S18.7 SL,LL,LH, 0 for SH for compatibility with S18.7 flux calibration.

Set this to 1 for S17.2 LH, 0 for SL,LL,SH.

Set this to 0 for all other CAL_SET versions.

 

-minorder         Minimum order number to extract. Default = 0.

           

 -maxorder       Maximum order number to extract. Default: 99

 

 -xnfine            Number of fine subsample points in x direction. Default = 1.

 

 -ynfine            Number of fine subsample points in y direction. Default = 1.

 

 -nanDrop        Wavelength bins with NaNs will be removed from the output spectrum if this is set to 1. Default is 0, with the NaN fluxes set to -9999.

 

 -pixel_scale    Pixel size in input image (for rec_offset file). Units are in arcsec/pixel and the default = 0.0. 

A.7    IRS_Tune

IRS_Tune is run for both Point Source and Extended Source tuning. To run Extended Source tuning, you must include the –recom option, which calls the IRS_Retune module.

 

To run, type:

unix% irs_tune <option flag> <specification>

 

Where the options are as follows:       

 

-I             Name of input table.

 

-t             Name of tuning table.

 

-o            The desired name of the output flux-calibrated spectrum, which is written out in units of Jy.

 

-m           Tuning mode (tune_up OR tune_down). Virtually all users will wish to use the "tune_down" option. The "tune_down" value means to apply the fluxcon table in the normal way, dividing by the factors. The "tune_up" value means to multiply by the factors. If you run irs_tune with tune_down on untuned data, you get tuned data. If you run irs_tune with tune_up on tuned data, you get the untuned data back.

 

-noise0    Only for generating “untuned” spectra for testing purposes. Sigma of offset noise to add. Default: 0.0.

 

-noise1    Only for generating “untuned” spectra for testing purposes. Sigma of gain noise to add. Default: 0.0.

           

-v            Verbosity level of printed messages. Default = 1.

 

-a            Tuning components from the *_fluxcon.tbl to apply. Default = 3. “Fluxcon” is the conversion factor from electrons per second to Jy, while “tune” applies the remaining calibration factors. Users will usually want to apply both to their data.

·         1 = fluxcon,

·         2 = tune,

·         3 = both

 

-recom    Calls the IRS_Retune module (see below), which allows tuning for extended sources. Do not use this if you are tuning for point sources. The value of this option must be the full path to the irs_retune executable.

 

-retab      Input retuning table. Only used when –recom is turned on

 

-reout      Retune output file. Only used when –recom is turned on.

 

-retab2    Second input retune table. Only used when –recom is turned on.

 

-reout2    Second retune output file. Only used when –recom is turned on.

 

-n               Name of a namelist file listing all the input parameters. This can be used instead of specifying all of the flags on the command line. Default is namelist.nl.

 

A.8    IRS_Retune

Usually this module is called from within IRS_Tune with the –recom flag. To run as a stand-alone, type:

unix% irs_retune <option flag> <specification>

 

Where the options are as follows:       

 

-i             Name of input table.

 

-t             Name of tuning table.

 

-o            Name of output table

 

-v            Verbosity level of printed messages. Default = 1.