NAME

xrtevtrec -- Reconstruct events, calculate PHA and assign grade for the WT and PD modes

USAGE

xrtevtrec infile outfile [parameter=]

DESCRIPTION

'xrtevtrec' processes the Swift XRT event files containing data taken with the Windowed Timing (WT) and Photodiode (PD) modes to reconstruct events, calculate their PHA values and assign to each one a grade.
The event reconstruction is carried out by searching for the local maximun in the neighborhood of a 7x1 pixel array. The PHA value of a 'reconstructed' event is obtained by summing up the PHA of the central pixel to that of the surrounding pixels above the split threshold and the result is written in the PHA column. The event grade is assigned using pre-defined patterns for the charge distribution and its value is stored in the column GRADE. A calibration file included in CALDB contains the charge distribution patterns of the different grades.
If the parameter 'addcol' is set to 'yes', the columns PHAS, containing the 7x1 pixel array used for the event reconstruction, and PixsAbove, containing the number of pixels above split threshold, are added to the output file. All the other columns present in the events extension of the input file are copied to the output file. The original PHA value of each pixel is copied into a column named EVTPHA.
After the event reconstruction only a subset of pixels is recognized as event. All pixels associated with a local maximum that have contributed to the reconstruction of one event have the GRADE and PHA columns assigned to NULL. These pixels are by default kept in the output file. However it is possible to exclude them from the output by setting the parameter 'delnull' to 'yes'.
If the parameter 'thrfile' is set to CALDB, 'xrtevtrec' reads the event and split threshold values stored in the calibration database file. By setting 'thrfile' to NONE, the task allows the user to set event and split thresholds using the parameters 'event' and 'split'.
In addition for the Windowed Timing mode, it is possible to flag a reconstructed event for which the 7x1 pixel array contains a bad column. This is obtained by setting the parameter 'flagneigh' to yes and causes the column STATUS to be updated.
'xrtevrec' adds the keyword XRTEVREC in the file header set to 'T' to indicate that the event reconstruction has been done. The values of the event threshold and split threshold used in the calculation are recorded in the keywords XRTEVTHR and XRTSPLIT. The percentage of saturated events, the percentage of pixel not included in the reconstruction and the percentage of pixel with PHA set to NULL are recorded in the keywords XRTSATEV, XRTNOREC, XRTNULEV respectively. The Data Subspace convention (DS keywords) recording the event grade values present in the file (DSVALn, DSTYPn, DSFORMn ) are also added to the output file.

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 the grade file. If the parameters is set to CALDB, the file is read from the calibration database.

thrfile [file name]
Name of the input file containing event and 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 event and split threshold values must be input via the parameters 'event' and 'split'.

(addcol=no) [boolean]
If set to 'yes', adds 'PHAS' and 'PixsAbove' columns.

(delnull=no) [boolean]
If set to 'yes', deletes NULL events.

(flagneigh = no) [boolean]
If set to 'yes' the STATUS column will be updated.

event [integer]
Event Threshold Level. If negative the hdfile 'EvtLLD' column values are used. This parameter is used only if 'thrfile' is set to NONE.

split [integer]
Split Threshold Level. If negative the hdfile 'EvtLLD' column values are used. This parameter is used only if 'thrfile' is set to NONE.

(clobber=no) [boolean]
Overwrite the output file if it is set to 'yes'.

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

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

EXAMPLES

  1. Recontruct events for the WT event file 'sw00111063000xlrb1po_uf.evt' using an event threshold of 70 and a split threshold of 40. Write the output in the file 'outfile.fits'.

    xrtevtrec  infile=sw00111063000xlrb1po_uf.evt hdfile=sw00111063000xhd.hk  
    thrfile=NONE event=70 split=40 outfile=outfile.fits
    

BUGS

SEE ALSO

LAST MODIFIED

July 2007