NAME

ftaddspec -- adds spectrum files and, optionally, associated files


USAGE

ftaddspec infiles sumtype outfile backfiles arffiles rmffiles clobber

DESCRIPTION

This task adds spectrum files and, optionally, their associated background, arf, and rmf files. It operates in two modes which are controlled by the sumtype parameter. If sumtype=time then the exposure times are added and the effective areas averaged. This is most appropriate when adding together spectra from the same detector taken at different times. If sumtype=area then the effective areas are added and the exposure times averaged. This second option is for the case of parallel observations made using different detectors (eg NuSTAR A and B).

The infiles parameter can be either a list of spectrum files separated by spaces or the name of a text file from which the list will be read. In this second case the text file name should be preceeded by @ (e.g. infiles=@files.txt).

If all the input spectra have Poisson errors then the result will also have Poisson errors. If any of the spectra have non-Poisson errors then the errors of all spectra will be added in quadrature.

The backfiles, arffiles, rmffiles parameters can all be list of files to add, NONE in which case the corresponding keyword in the output file is set to NONE, or % in which case the keywords will be read from the input spectrum files to find the background, arf, and, rmf files and these will be combined.

The names of the summed associated files will be constructed from the outfile parameter used to specify the name of the output spectrum file. For instance, if outfile=test.pha then if requested the summed background file will be test_bg.pha, the summed arf will be test.arf, and the summed rmf test.rmf.

If the rmf files include the effective areas then the arffiles parameter should be set to NONE and ftaddspec will add or average the rmf files as required.

PARAMETERS

infiles [character string]
Either a list of spectrum files to add with the names separated by spaces or the name of a text file from which the list can be read. In this second case the parameter should start with @.
sumtype [character string]
Either TIME in which case exposure times will be summed and effective areas averaged or AREA in which case exposure times will be averaged and effective areas summed.
outfile [character string]
The name of the output file to be written containing the summed spectrum. The name of the output file cannot be the same as an existing file unless clobber=yes or the output filename is preceeded by !. If output background, arf, and rmf files are required then their names will be derived from this parameter.
backfiles [character string]
Can be either a list of filenames separated by spaces, the name of text file (preceeded by @) from which to read the list, the string NONE to indicate that background files are to be ignored, or % to indicate that the background files should be given by the BACKFILE parameter in the input files.
arffiles [character string]
Can be either a list of filenames separated by spaces, the name of text file (preceeded by @) from which to read the list, the string NONE to indicate that arf files are to be ignored, or % to indicate that the background files should be given by the ANCRFILE parameter in the input files.
rmffiles [character string]
Can be either a list of filenames separated by spaces, the name of text file (preceeded by @) from which to read the list, the string NONE to indicate that arf files are to be ignored, or % to indicate that the background files should be given by the RESPFILE parameter in the input files.
clobber [boolean]
Flag specifying whether or not to overwrite a pre-existing file with the same name as the output file. If the output file name is preceeded by ! then the existing file will be overwritten whatever the value of the clobber parameter.