NAME
xrtwtcorr -- Correct on-ground the bias subtraction and identify trailing charge pixels for data taken in Windowed Timing mode
USAGE
xrtwtcorr [parameter = < value >]
DESCRIPTION
For Windowed Timing mode the bias is subtracted on-board.
The bias value subtracted on-board to each column is telemetered (Bias Row in the
trailer file). With the new version of the on-board software (v. 8.9) the last twenty
pixels of each frame are stored in the housekeeping header file.
The ground software estimates the bias by calculating the median value of the
last twenty pixels telemetered. If the bias value obtained differs from the one
subtracted on-board more than a quantity set by the user through the parameter
'biasdiff', the bias correction is adjusted.
Two different methods are available for the bias adjustment and can be chosen through the parameter 'biasmode':
- SP: the bias difference is calculated between the on-ground estimated bias and the bias value of the related
Bias Row subtracted on-board to each column.
- M20P: the bias difference is calculated between the on-ground estimated bias and the median of the last 20 pixels
of the related Bias Row.
For both methods it is possible to set the number of consecutive frames used for the on-ground bias calculation via the
parameter 'nframe'.
The on-ground bias adjustment is not applicable if the target source is located close to the right hand size
of the WT window since it may contaminate the charge values of the last twenty pixels telemetered. As a rule, the
'xrtwtcorr' task should not be used if the source is located at a detector X coordinate DETX>350.
By default (input parameter 'flagtrailing' set to 'yes'), the task also identifies and removes pixels due to trailing
charge released from detector charge traps. As a first step, the task identifies distinct groups of event file rows
which are consecutive in time with the same RAWX value. As a second step, the task flags pixels due to trailing charge
release. To this end two distinct methods are available. In the first method (parameter 'usetrailingthr=yes'),
a pixel is flagged as associated to trailing charge if its PHA value is below a fixed threshold given by the parameter
'trailingthr'. The first pixel of each group is not considered in this PHA selection. In the second method
(parameter 'usetrailingthr=no', default choice) a pixel is flagged as associated to trailing charge if its PHA value is
lower than the PHA value of the previous one. Some variance in the PHA values to account for statistical variability is
allowed and the tolerance on the PHA statistical fluctuations in term of standard deviations is provided in input
through the parameter 'nsigmastat'.
For both methods, the minimum and maximum number of consecutive trailing pixels can be set through the parameters
'ntrailingmin' and 'ntrailingmax', respectively. Also, the task allows for the presence of temporal gaps within a given group of
pixels through the input parameter 'trailingdist'. Finally, the STATUS column for pixels associated to trailing charge release
is updated using the value 'STATUS=b0000000000100000'.
PARAMETERS
- infile [file name]
- Name of the input event FITS.
- hdfile [file name]
- Name of the input Housekeeping header Packets FITS file. This file contains the pixels used to calculate the bias on-ground.
- outfile [file name]
- The output file name. The value 'NONE' will cause the input file to be overwritten.
- thrfile [file name]
- Name of the input file containing the bias threshold value 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 bias threshold value must be input
via the parameter 'biasth'.
- trfile [file name]
- Name of the input Trailer header Packets FITS file. This file contains the Bias Row used on board
- (colfile = CALDB) [filename]
- Name of input WT offset file. If set to CALDB, use the file in the Calibration
Database. This file contains for a given waveform the values of the 1st pixel used in
the CCD for the WT mode (WM1STCOL), the number of columns (WMCOLNUM), and the offset
required to align the PC coordinates system to the WT.
- (nevents = 20) [integer]
- Minimum number of Windowed Timing events included in the last twenty pixels.
- (nframe = 20) [integer]
- Number of consecutive frames included in the on-ground bias median calculation.
- (biasdiff = 2) [integer]
- Threshold value for bias adjustment (DN).
- (biasmode = M20P) [string]
- Method to calculate module bias difference ([SP|M20P]). In SP mode the bias difference
is calculated between the on-ground computed bias median and the bias value subtracted on-board to each column;
in M20P mode the bias difference is calculated between the on-ground computed bias median and the last 20
pixels median of the related Bias Row.
- (biasth = 200) [integer]
- Threshold value for the DN of the pixels used to calculate the bias median of the last twenty pixels.
This parameter is used only if 'thrfile' is set to NONE.
- (npixels = 20) [integer]
- Minimum number of pixels used to calculate the bias median of the last twenty pixels.
- (flagtrailing = yes) [boolean]
- Search and flag spurious events due to trailing charge?(yes/no)
- (trailingthr = 1000) [integer]
- PHA threshold for trailing events identification (used only if usetrailingthr=yes)
- (usetrailingthr = no) [boolean]
- Use PHA threshold for the trailing events identification?(yes/no)
- (trailingdist = 2) [integer]
- Allowed temporal gap for trailing events charge release (expressed in RAWY values)
- (ntrailingmin = 2) [integer]
- Minimum number of consecutive events for trailing charge identification
- (ntrailingmax = 30) [integer]
- Maximum number of consecutive events for trailing charge identification
- (nsigmastat = 1) [real]
- Number of standard deviations used to account for statistical variability (used only if usetrailingthr=no)
- (clobber = no) [boolean]
- If set to yes, overwrite the output file.
- (history = yes) [boolean]
- If set to yes, write parameter values and other information in HISTORY blocks.
- (chatter = 2) [integer]
- Chatter Level (min=0, max=5).
EXAMPLES
- Calculates bias for the input file sw00030352007xwtw2po_uf.evt and
adjust the bias subtraction if the difference between the bias subtracted
on-board and the one calculated on-ground is larger than 2 DN.
To calculate the bias on-ground 30 consecutive frames are used. The bias
is adjusted with the 'M20P' method. The output file is named
sw00030352007xwtw2po_uf_corr.evt. In addition, spurious events identified as due
to trailing charge effects are flagged and removed.
> xrtwtcorr infile=sw00030352007xwtw2po_uf.evt
hdfile=sw00030352007xhdtc.hk trfile=sw00030352007xtr.hk
biasdiff=2 nframe=30 biasmode=M20P thrfile=CALDB
outfile=sw00030352007xwtw2po_uf_corr.evt
BUGS
SEE ALSO
LAST MODIFIED
March 2019