NAME 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. USAGE 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" DESCRIPTION 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. PARAMETERS (SWITCHES/FLAGS) -d [path] - Input the path to the proposal level of your FITS database, e.g. /local/data/P30402. -c [l-u] - Give the desired channel range for the resulting light curves, e.g. 5-30. If nothing is specified, 0-27 will be extracted. -l [layer] - Specify the layer to be extracted: 1, 2, 3, or all are the possible entries. Anything else will be ignored and the default used. If nothing is specified, layer 1 only will be extracted. -r [root] - Root name for output. Files will be named with this root, if specified, followed by layerN, chX-Y (lc's only), and bkg for background files. -p [mode] - Specify printmode, l for light curves only, s for spectra only. Default is both. -t [targ] - Give two digit target number, e.g. "03". Default is all found. -x [cl] - To reduce HEXTE Archive mode data instead of PCA Standard2, give the cluster you wish to analyze. This option works with all options except the layer option. -s - Flag to include processing of slew data. By default, the script will ignore slew observations, i.e. those whose ObsIds end in A, Z, C, or D. -f - Flag to skip filter file regeneration. If the filter files have already been made and include all the necessary columns in aux/expression.txt and those needed by pcabackest (PCUn_ON, BKGD_THETA, BKGD_PHI), this time consuming step can be avoided by specifying this flag. The filter files must exist in the FITS database, in the stdprod directories for each obsid, and they must be refered to by the FIST index file. (If made by xtefilt with the -s option, all should be well.) -b - Flag to bypass the making of the background files. Use this option only if the script has already been run successfully and you simply want to re-extract light curves and spectra. -n - Flag to use no SAA history file in pcabackest; this is only for use with other models than the Faint L7 models. It is only necessary when there is no current SAA history for the data. -q - Flag to quell prompting for options not specified on the command line. Anything not specified will be set to the default. EXAMPLES 1) rex Prompts for data, target, printmode, channel, layer, and root name. 2) rex -d /local/data/P30402 -q Runs using all defaults. 3) rex -bfd /local/data/P30402 -p l -l 3 -c 30-50 -q Runs without generating new filter files, using existing background files, printing only light curves, and extracting only layer 3 and channels 30-50. SEE ALSO SAEXTRCT, PCABACKEST, XTEFILT, MAKETIME, LCMATH, HXTBACK, HXTDEAD, REBINLC, MATHPHA