NAME

ftgcorpha - Remaps PHA channels from SPECTRUM extension

USAGE

ftgcorpha infile shftfile outfilel clobber

DESCRIPTION

This task remaps PHA channels according as defined by user.

Given an OGIP-approved FITS format input file, this task provides the facility to move the user-defined PHA channel elements (columns) of the array to the left or right (ie down or up in channel-space) by a user-defined number of channels.

The shift to be applied to each channel of the input PHA channels must be specified by an ASCII input file. The format of each row of this input ASCII file must be

MINCHAN MAXCHAN NCHAN

denoting all 'columns' of the i/p PHA channels between detector channels MINCHAN and MAXCHAN (inclusive) are to be shifted by NCHAN. The shift, NCHAN, can be a positive or negative integer or real number of channels (or zero). Any channel ranges "implied" by their exclusion from the ASCII file will be shifted by zero channels. Note that should the shift applied to two or more 'columns' result in those columns being in the same o/p detector channel, then their respective probabilities (that an incident photon of a given energy will be detected in that detector channel) WILL BE SUMMED. Similarly, should the applied shifts result in an o/p detector channel 'column' NOT being populated, then the probability (that an incident photon of a given energy will be detected in that detector channel) will be set to zero. However, shifts below the minimum, and above the maximum legal channel number for the instrument will result in those probabilities being excluded.

PARAMETERS

infile [filename]
The name of the PHA file to be remapped.

shftfile [filename]
The name of a text file giving the channel remapping information. Each line should contain 3 or 4 numbers, the first two listing the minimum and maximum channels to be remapped, the third the additive shift, and the optional fourth the multiplicative factor.

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

clobber [bool]
If clobber = yes then overwrite the output files if a file of the appropriate name already exists.

EXAMPLES

Shift all channels by half a channel using the file shift.txt containing

1 128 0.5
and the command
ftgcorpha file1.pha shift.txt fileout.pha

SEE ALSO

LAST MODIFIED

Sep 2016