NAME

xrttimetag -- Time tag events and calculate the DETX/DETY columns for the WT and PD modes

USAGE

xrttimetag [parameter = < value >]

DESCRIPTION

'xrttimetag' calculates the photon arrival time for data taken with the Swift XRT Windowed Timing (WT) and Photodiode (PD) modes and writes the DETX/DETY columns. Only for WT mode, the task also calculates the X/Y columns.

'xrttimetag' uses the readout time values stored in the ROTIME column and writes the calculated time value in the TIME column of the output file. A keyword XRTTIMES set to TRUE (T) is added to the header to indicate that the file has been already processed by the task. The columns TSTART and TSTOP in the GTI extension are updated by the task as are the keywords ONTIME, LIVETIME, DEADC and EXPOSURE.

The time tag of the events requires the knowledge of the source location on the CCD. This is usually determined using data collected when the instrument operates in imaging mode. Since the WT and PD have either a limited or no spatial resolution, it is not possible to discriminate between source and background events, and the time tagging is done assuming that all the events are from the source.

If the parameter 'usesrcdet' is set to no (default) the source detector coordinates (with the exception of DETX for the WT mode, see below) are calculated, and written in the DETX/DETY columns, using the celestial coordinates (J2000.0) of the source (specified through the parameters 'srcra' and 'srcdec'), the RA and Dec of the nominal pointing (parameters 'ranom' and 'decnom') and the attitude file (parameter 'attfile').
During the slews the time tag of the events assumes that all the events are at position (300,300) in detector coordinates and the input 'srcra' and 'srcdec' are ignored.
For the Windowed Timing mode, the RAWX coordinates are transformed to DETX using the teldef file stored in CALDB. If needed, the task corrects telemetered RAWX values using information from the file specified by the 'colfile' parameter.

The source detector coordinates, with the exception of DETX for the WT mode, can also be specified through the parameters 'srcdetx' and 'srcdety' if the parameter 'usesrcdet' is set to 'yes'. Note that this last option should not be used since it produces i) less accurate photon arrival times (both WT and PD modes) and ii) less accurate sky coordinates (WT mode only).

For the Windowed Timing mode only, xrttimetag also converts the detector coordinates into sky coordinates and writes their values in the X/Y columns of the output files. The sky coordinates calculation makes use of the the RA and Dec of the nominal pointing (parameters 'ranom' and 'decnom') and of the attitude file (parameter 'attfile').

The first frame taken in PD mode contains pixels which are not completely exposed. These pixels can be eliminated by setting the parameter 'npixels'. In addition, it is possible to exclude PD frames considered piled-up (parameter 'percent'), by calculating the percentage of events per frame that have a DN value above the on-board upper level discriminator. Non completely exposed pixels and piled-up frames are excluded from the GTI.

'xrttimetag' can be re-run on the same event file if a better source position is known and and the 'TIME', 'DETX', 'DETY', 'X' and 'Y' (WT only) columns are recalculated and overwritten.

All the other columns of the EVENTS extension of the input file are copied to the output file without changes.

PARAMETERS

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

outfile [file name]
Name of output FITS file. If set to NONE, the input file is overwritten.

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

trfile [file name]
Name of the input Housekeeping Trailer Packets FITS file.

attfile [file name]
Name of the input attitude file.

(usesrcdet=no) [boolean]
If set to 'no' the detector coordinates are calculated using the parameters 'srcra','srcdec', 'ranom','decnom' and 'attfile'. If set to 'yes' the detector coordinates are set to the fixed values specified through the parameters 'srcdetx' and 'srcdety'.

(usehkkey=no) [boolean]
If set to 'no', the parameters 'srcdetx, 'srcdety', 'srcra', 'srcdec', 'ranom', 'decnom' are set to the values provided in input. If set to 'yes', the 6 parameters are set to the values of the keywords 'XRTDETX', 'XRTDETY', 'XRA_OBJ','XDEC_OBJ','XRA_PNT', 'XDEC_PNT', respectively, contained in the Housekeeping Header Packets file.

srcdetx [integer]
Source detector coordinate x. Used if usesrcdet=yes and usehkkey=no.

srcdety [integer]
Source detector coordinate y. Used if usesrcdet=yes and usehkkey=no.

srcra [real]
RA coordinate (J2000.0) of the source (degrees). Used if usesrcdet=no and usehkkey=no.

srcdec [real]
Dec coordinate (J2000.0) of the source (degrees). Used if usesrcdet=no and usehkkey=no.

ranom [real]
RA coordinate (J2000.0) of nominal pointing (degrees) (if usehkkey=no).

decnom [real]
Dec coordinate (J2000.0) of nominal pointing (degrees) (if usehkkey=no).

(aberration=no)[boolean]
If set to no, the aberration correction is not applied to the data.

(attinterpol=no)[boolean]
If set to no, the attitude parameters correspond to the closest time value to the time of each event.

(teldef = CALDB) [filename]
Name of teldef file. If set to CALDB, use the file in the Calibration Database.

(colfile = CALDB) [filename]
Name of input WT offset file. If set to CALDB, use the file in the Calibration Database.

(npixels = 1850) [integer]
Number of pixels not completely exposed to be erased from the first frame taken in the Photodiode mode.

(percent = 50.0) [real]
Percentage of events with DN value over the on-board Upper Level Discriminator within one Photodiode frame. The percentage gives an indication of pile-up in the frame. Frames considered piled-up are then not included in the good time intervals.

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

(history=yes) [boolean]
If set to 'yes', write history keywords to the output file.

(chatter = 2) [integer]
Verbosity Level from 0 to 5

EXAMPLES

  1. Calculate the arrival time of the events assuming the source located at celestial coordinates (RA,Dec)=(43.5645,45.2048), using the maximum verbosity level and update the input file.

    > xrttimetag infile=sw00052100007xwtw2po_uf.evt outfile=NONE 
    attfile=sw00052100007sat.fits hdfile=sw00052100007xhdtc.hk trfile=sw00052100007xtr.hk
    srcra=166.13375 srcdec=38.21742 ranom=166.133 decnom=38.21  chatter=5 

BUGS

SEE ALSO

LAST MODIFIED

March 2006