rex - Makes preliminary products and then extracts data; i.e. creates filter files, GTIs, lists of data files, background data files and lists, lc and pha files.
rex -d "Input path to proposal level data directory" -c "Channel range to extract for light curves; 0-27 by default" -l "Layers to extract: 1 (default), 2, 3, or all." -r "Root name for output" -p "Printmode: l for light curves, s for spectra; (default both)." -t "Target: give two digit target number for extraction." -x "To reduce HEXTE Archive mode instead, give cluster(0 1,a b)" -s "Flag to process slews instead; default is to ignore slews." -f "Flag to turn off filter file generation" -b "Flag to turn off background generation" -q "Flag to quell prompting for unspecified options." -n "Flag to use no saahfile (for bright source models)" -h "Print help"
Rex is a script designed to run through the basic data reduction steps for multiple observations of a given target. It can run with minimum input, but retains the flexibility to change the defaults for most basic options.
The user need only give the tool the path to the FITS database proposal level directory; the default procedure is then to extract both light curves and spectra from layer 1 using channels 0-27 (lc's only) and PCUs 0, 1, and 2. The script will create a set of subdirectories in the aux directory, one for for each observation's intermediate products (file lists, GTI files, background data files, logs, etc.), and another set in the working directory for the resulting lightcurves and/or spectra. For each obsid, the script will:
1) run xtefilt using the appidlist in the aux directory; -f option over-rides this; 2) run maketime to create a standard list of Good Time Intervals using expression found in aux/expression.txt; 4) run pcabackest to create modeled background data for PCA using models found in aux/model.files and aux/pca_saa_history; -b option over-rides; for HEXTE data, runs hxtback to separate source from offset data; 5) create lists of both the data and background files; 6) run saextrct to produce individual light curves and/or spectra; 7) run hxtdead to correct HEXTE spectra/light curves for deadtime; 8) subtract background light curve from data, and write background spectrum into BACKFILE keyword of data spectrum;
Additionally, the script will create merged products from all the observations in the given directory.
This script can be run from the command line using all default options (except the data directory) by specifying the -q flag to quell the prompting. If the -q flag is omitted, any option not specified on the command line will be prompted for, with the default taken if no value is then given.
Rex must be run from a working directory that contains the "aux" directory found on the RXTE ftp site at ftp://legacy.gsfc.nasa.gov/xte/software/rex/aux.tar In this tar file are the miscellaneous files that will be used by the script, namely the goodtime expression used in maketime, the column lists to be extracted, and the background model files. The text files can be edited, but the names of the text files must remain the same in order for the script to find them.
While this script is designed for ease of use rather than flexibility, the existence of several optional inputs and the ability to edit the tools in the aux directory give the user some control. To use use different model files, edit the model.files text list to point to the new files; to change the number of PCUs extracted, add to the column list files, etc. Time consuming steps which may have already been performed such as xtefilt and pcabackest can be bypassed using the flags -f and -b respectively. Changes to the channel boundaries and layers can be made using the -c and -l options, respectively. To limit extraction to only lightcurves or only spectra, us the -p option. Changes to the criteria for determining Good Time Intervals (GTIs) can be made by editing the expression in aux/expression.txt. By default, the script will only extract data from PCUs 0, 1, and 2, as PCUs 3 and 4 usually go on and off in the course of a long series of observations. To add PCUs 3 and 4 to the extraction, the user can edit the column files in the aux directory to add the additional columns. (The selection expression should then be modified to include a test to make sure these two PCUs are on.)
In a script this long, the possibilities for errors are numerous. Most should be trapped by the script, which will give a warning, write any error messages from the FTOOLS into a log in the aux directory, and either continue if possible or quit. When a warning appears, check the log file for the error message from the FTOOL; if this message does not enlighten, send the log file on to xtehelp\@athena.gsfc.nasa.gov along with the inputs you gave to Rex originally and any information about what you may have changed in the aux directory.
SAEXTRCT, PCABACKEST, XTEFILT, MAKETIME, LCMATH, HXTBACK, HXTDEAD, REBINLC, MATHPHA