NAME
cmppha -- Converts a TYPE II to a TYPE I OGIP pha file
USAGE
cmppha infile outfile cmpmode
DESCRIPTION
This task converts an OGIP standard TYPE II pha file to a TYPE I pha
file. A TYPE II pha file contains one extension with one or more
spectra stored as 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 an extension for each
spectrum.
The resultant output file can then be used by other ftools (eg GRPPHA)
that expect a TYPE I pha file as input.
SUPPORTED FITS FORMATS
Currently only the following OGIP standards are supported by this task:
- HDUCLAS1/HDUVERS1 = 'SPECTRUM'/'1.*.*'
-
(commonly also known as "PHAVERSN=1992a")
- HDUCLAS2 = 'TOTAL'/'NET'/'BKG'
-
- HDUCLAS3 = 'COUNT'/'RATE'
-
- HDUCLAS4 = 'TYPE:II'
-
PARAMETERS
infile [character string]
The name of the FITS PHA file to be compressed or expanded.
outfile [character string]
The name of the FITS 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 compress 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, or just
ROWS=-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 (" "), cmppha will
use either 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 BACKGROUND_UP
column in a Chandra grating pha2.fits files).
(backfile="%") [character string]
Associated background filename to be written in o/p file, as the value of
the BACKFILE keyword. The default value "%" indicates that the BACKFILE keyword value will be copied from the input file.
file.
(corrfile="%") [character string]
Associated correction filename to be written in o/p 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 o/p 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 o/p file, as the
value of the RESPFILE keyword. The default value "%" indicates that the
RESPFILE keyword value will be copied from the input file.
(chatter = 9) [integer]
Flag to indicate how chatty the task is at execution. A value of 9 is the
default, with lower/higher values producing quieter/verbose output
respectively.
(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.
BUGS
The routine to parse the ROWS parameter only has a primitive error handling
capabilities; an incorrect input here could cause unexpected behaviors.
Otherwise, none known.
SEE ALSO
Arnaud etal, 1992. Legacy, 2, 65 (OGIP/92-007)
LOG OF SIGNIFICANT CHANGES
- v1.0.0 (1995 Aug)
-
Beta test version
- v1.1.0 (2000 Sep)
-
Updated to make it useful for Chandra grating spectra.
- v1.1.1 (2000 Oct)
-
Added datacol parameter and a few history keywords.
PRIMARY AUTHOR
Rehana Yusaf
HEASARC
NASA/GSFC
http://heasarc.gsfc.nasa.gov/cgi-bin/ftoolshelp
(301) 286-6115
CATEGORY
Aug95 ftools.caltools