NAME

ftcmppha -- converts a type 2 pha file to a type 1 pha file.

USAGE

ftcmppha [infile=]filename1 [outfile=]filename2 [cmpmode=]squish/expand (rows="-") (datacol=" ") (backfile="%") (corrfile="%") (arfile="%") (rmfile="%") (clobber=yes/no)

DESCRIPTION

This task converts a type II pha file to a type I pha file. A type II pha file contains one extension with one or more spectra stored on separate rows. A type I pha file contains only one spectrum in an extension. This task has two modes: squish and expand. Squish compresses (adds) all the type I spectra to form one spectrum, and writes it to the output file. Expand writes each spectrum to its own extension.

PARAMETERS

infile [filename]
The name of the pha file to be compressed or expanded.

outfile [filename] The name of the file to be written containing the pha dataset(s)

cmpmode [character string]
The conversion mode to be used. Squish or expand are the options. Squish will sum all the pha spectra in one extension of a type II pha file, into one spectrum. Expand writes a seperate extension for each spectrum.

(rows="-") [character string]
The range of rows to squish/expand. The default of - means operate on all rows. The first ten rows could be specified as rows="1-10". To operate on the first three rows and all rows from 11, use rows="1-3,11-". rows="3,5,7" will select only these three rows.

(datacol=" ") [character string]
The column name to read in the input file. By default (" "), ftcmppha will use either the COUNTS or RATE column, as specified in the Type II PHA file standard. This hidden parameter can be used to force it to operate on an additional column that is present in the input file (such as the BACKGROUND_UP column in a Chandra grating pha2.fits file).

(backfile="%") [character string]
Associated background filename to be written in the output file, as the value of the BACKFILE keyword. The default value "%" indicates that the BACKFILE keyword value will be copied from the input file.

(corrfile="%") [character string]
Associated correction filename to be written in the output file, as the value of the CORRFILE keyword. The default value "%" indicates that the CORRFILE keyword value will be copied from the input file.

(arfile="%") [character string]
Associated ancillary response filename to be written in the output file, as the value of the ANCRFILE keyword. The default value "%" indicates that the ANCRFILE keyword value will be copied from the input file.

(rmfile="%") [character string]
Associated redistribution matrix filename to be written in the output file, as the value of the RESPFILE keyword. The default value "%" indicates that the RESPFILE keyword value will be copied from the input file.

(clobber = false) [boolean]
Flag specifying whether or not a pre-existing file with the same name as that requested as the output file from this task will be overwritten.

EXAMPLES

1. Add together spectra in a type II file.

ftcmppha type2.pha type1.pha squish
2. Extract the first four spectra in a type II file into their own extensions.

ftcmppha type2.pha type1.pha expand rows="1-4" clobber=yes

LAST MODIFIED

January 2022