NAME

xrtpcgrade -- Calculates the PHA values and assigns event grades.

USAGE

xrtpcgrade infile outfile [parameter=value ... ]

DESCRIPTION

'xrtpcgrade' calculates the PHA values and assigns the grades for the Swift XRT Photon Counting (PC) mode data.
In PC mode each event has nine PHA values associated, stored in the column PHAS, corresponding to an array of 3x3 pixels, the central pixel and eight surrounding pixels. 'xrtpcgrade' reads the nine elements of the PHAS column, calculates a single PHA value for each event and writes the result in the PHA column of the output file. The PHA value is calculated by summing all the pixels with values above the split threshold. If the parameter 'thrfile' is set to CALDB, 'xrtpcgrade' reads the split threshold value stored in the calibration database file. By setting 'thrfile' to NONE, the task allows the user to set the split threshold using the parameter 'split'. The number of pixels above the split threshold is stored in the column named PixsAbove. The grade values are written in the GRADE column of the output file. All other columns of the EVENTS and the GTI extensions of the input file are copied unchanged to the output file.
The grades for the PC mode are assigned following a pattern definition stored in a CALDB file. The task also allows the user to assign also grades following the ASCA convention if the option 'ascagrade' is set to 'yes'. In this case the grade definition is done using the routine originally developed for the ASCA task 'faint'. The routine ignores the corner pixels in the computation of the PHA value, except in the case of grade 6 where a corner pixel is included. The results of this computation are included in the two columns ASCAPHA and ASCAGRADE. This option is included only for comparison purposes and, if selected, the XRT and ASCA grades are both included in the output file. Grade selection for the Swift XRT PC data should be done using the XRT pattern convention.
'xrtpcgrade' add the Data Subspace keywords in the header of the event file to record the event grade (DSVALn, DSTYPn, DSFORMn). These keywords are updated by other tasks to record the screening on grades.

PARAMETERS

infile [file name]
Name of the input event FITS file. Unix-compressed files are allowed, except when the output file is set to NONE and the input file is overwritten.

hdfile [file name]
Name of the input Housekeeping Header Packets FITS file.

outfile [file name]
Name of output event FITS file. The value 'NONE' will cause the input file to be overwritten.

(gradefile = CALDB )[file name]
Name of input GRADE file. If set to CALDB (default), use the file in the Calibration Database

thrfile [file name]
Name of the input file containing split threshold values as a function of the CCD substrate voltage. If the parameter is set to CALDB, the file is read from the calibration database. If the parameter is set to NONE, the split threshold value must be input via the parameter 'split'.

(split = -1) [integer]
Split threshold level. If set to a negative value, use the on-board split threshold values read from the input hdfile 'SplitThr' column. This parameter is used only if 'thrfile' is set to NONE.

(ascagrade = no) [boolean]
If ascragrade=yes the grades are calculated according to the ASCA patterns. The results are written in the 'ASCAPHA' and 'ASCAGRADE' columns.

(history=yes) [boolean]
If set to yes, write parameter values and other information in HISTORY blocks.

(clobber=no) [boolean]
If 'clobber'=yes and outfile=filename, the file with the same name will be overwritten, if it exists.

(chatter = 2) [integer]
Chatter Level (min=0, max=5).

EXAMPLES

  1. Calculate PHA and GRADE values for the Photon Counting mode event file sw00073232001xpcwnpouf.evt using the split threshold value stored in the CALDB file, assign also grades according to the ASCA convention (ASCAPHA and ASCAGRADE columns) and write the output in the file 'outfile.fits'.

     > xrtpcgrade infile=sw00106107000xpcw4po_uf.evt outfile=outfile.fits
       hdfile=sw00106107000xhdtc.hk  ascagrade=yes thrfile=CALDB 

BUGS

SEE ALSO

LAST MODIFIED

July 2007