NAME

sumpha -- Add individual RXTE .pha files and merge GTI extensions


DESCRIPTION

This script is designed to make it easy to combine a number of individual FITS spectra (.pha files) by calling mathpha to sum them and then appending a merged GTI extension to the final combined spectrum. The list of input .pha files can be given on the command line or in response to an interactive prompt and can be input in either case as an ascii list by prepending a '\@' to the name of the file containing the list of spectra. The script also helps to get around the filename restrictions imposed by mathpha so that using full pathnames or filenames containing '+' or '-' signs is permitted in sumpha.

The following parameters are used in the calls to mathpha:

            units=COUNTS exposure=CALC properr=yes errmeth=Gauss

The following keywords are copied from the spectrum extension of the chronologically first .pha file to the final combined .pha file:

        'CPIX','OBJECT','ROWID','ORIGIN','RA_OBJ','DEC_OBJ','EQUINOX'
        'RADECSYS','DATE-OBS','TIME-OBS','TIMESYS','GAINAPP'
        'TIMEUNIT','MJDREF','TSTART','TIMEDEL','DEADAPP'

and these from the chronologically last .pha file:

        'DATE-END','TIME-END','TSTOP'


INPUT PARAMETERS

filelist
Names of the .pha files to be added (or "\@filename", where "filename" is an ascii file containing the names of the .pha files, one per line)

outfile
Name of the output combined .pha file

(clobber = "no")
Overwrite existing output file?


EXAMPLES

sumpha
(the filelist and outfile parameters will be prompted for)

sumpha filelist=\@myfilelist outfile=combined.pha clobber=yes

                 (Non-interactive form, where myfilelist contains:
                         file1.pha
                         file2.pha
                         file3.pha
             
                         etc.)


NOTES

This tool does not verify that the input spectra were extracted using identical or consistent arrangements of detectors, layers, etc., or even that they correspond to the same object.

It does, however, insist on every input spectrum having a valid GTI extension (second extension) which conforms to OGIP standards. Any non-conforming file will result in a warning message to the screen and will not be included in the combined spectrum.

MATHPHA can be used in cases where this tool proves too restrictive.

CATEGORY

May00 ftools.xte