NAME

ftascii2pha -- Creates an OGIP standard PHA file from a text file

USAGE

ftascii2pha infile outfile chanpres datatype qerror rows fchan tlmin detchans pois headfile exposure clobber

DESCRIPTION

This tool creates an OGIP standard PHA FITS file from an ascii text file. The user can apply Poisson errors if desired. This task creates a basic PHA file, it does not allow the user to define a grouping, systematic errors, or add any quality flags. An additional text file allows keywords to be added to the PHA file.

PARAMETERS

infile [filename]
The name of the text file containing the spectrum.

outfile [filename]
The name of the output FITS file.

chanpres [bool]
If channel numbers are present in the input file, enter yes.

datatype [string]
The PHA dataset can be defined in counts or rate (counts/sec). This parameter is a flag to allow the user to define what datatype the input dataset is in. COUNTS for counts and RATE for rate.

qerror [bool]
yes if errors are present in dataset.

rows [string]
The range of rows to be read from the ascii file. The default "-" means read all the rows. This enables users to skip comments in the ascii file. rows="-10" specifies rows up to and including 10, and similiarly rows="10-" specifies rows 10 to the last row.

fchan [int]
This parameter is only used if chanpres=no, it is the first channel number in the ascii file.

tlmin [int]
This is the first legal Detector channel. NOTE: This is not the same as fchan.

detchans [int]
The number of legal Detector channels.

pois [bool]
yes if Poisson errors are to be applied to the dataset.

headfile [filename]
A text file containing keywords to be added to the output file. It line in the file should contain the the keyword name, the keyword value, and optionally a comment.

exposure [real]
Exposure time in seconds.

hduclas2) [string]
HDUCLAS2 keyword value. This should be TOTAL, NET, or BKG.

chantype [string]
The channel type. This should be PHA or PI.

clobber [bool]
If yes then an existing file can be overwritten.

EXAMPLE

ftascii2pha ftascii2pha_input1.txt ftascii2pha_test1.pha chanpres=yes datatype="COUNTS"
qerror=no rows="3-" fchan=4 tlmin=1 detchans=16 pois=yes headfile=ftascii2pha_input1.hdr
exposure=1200.0 hduclas2="TOTAL"
where ftascii2pha_input1.txt contains
this is a test of ftascii2pha
the first column is channel number and the second counts
4 5
5 7
6 11
7 15
8 6
9 10
10 3
11 2
12 2
13 1
and ftascii2pha_input1.hdr contains
TELESCOP   Test
INSTRUME = TestInstr
DETNAM     TestDet
FILTER = Testfilt
AREASCAL=1.0
BACKSCAL=1.0
CORRSCAL=1.0
CORRFILE=NONE
EQUINOX=2000.0    /  Equinox used for any positions

SEE ALSO

Spectrum standard document.

LAST MODIFIED

Sep 2022