NAME

xtdpi - Calculate pulse invariant (PI) values and assign grades for XRISM Xtend events

USAGE

xtdpi infile outfile hkfile

DESCRIPTION

The task xtdpi calculates a pulse invariant (PI), a value proportional to the X-ray energy, for each event in an Xtend event list by applying several pulse height corrections and a grade assignment. There are 5 major steps in this task:

   1. Video board temperature and even-odd column correction
   2. Charge trail correction
   3. Charge transfer inefficiency (CTI) correction
   4. Grade assignment and PHA summation
   5. PHA to PI conversion (gain correction)

In Step 1, differences in pixel PHAS between even and odd CCD columns are corrected. Each CCD chip is associated with two circuit boards ("Applicaton Specific Integrated Circuits", or ASICs), where the raw pixel output is amplified and digitized. To speed up the signal processing, one of the ASICs reads signals transferred from the even-RAWX pixels, while the other reads those from the odd-RAWX pixels. The conversion of analog to digital signal can differ for different ASICs, and this conversion further depends on the temperature of the video board at the location of the ASIC. This step removes those differences, correcting the pixel pulse height values to be on the same scale for a given event. The video board temperature is read from the HK file specified by the parameter 'hkfile', with other parameters 'hkext', 'hkcolstem', and 'hkvideoid' specifying where in the file that information is located. The Step 1 video board temperature correction can be turned on and off with the 'vtcor' parameter, and the even-odd column correction can be turned on and off with the 'evnoddcor' parameter.

In Steps 2 and 3, the task corrects the pulse height information of individual pixels to account for charge lost during the transfer. When the detected events are transferred for readout, some amount of charge is trapped by defects in the CCD chips, which are mainly caused by radiation damage. Some of the trapped charge is released immediately after a one-pixel transfer, resulting in a "trail" into the following pixel. Long-timescale charge traps release the charge in pixels outside of the event island, effectively losing this information. Charge injection was developed as a way to mitigate CTI by periodically filling traps with rows of sacrificial charge. As a result, the CTI strongly depends on the configuration of charge injection, and the task reads that configuration information from the event file header keywords. The magnitude of both the charge trail and CTI correction depends on the pulse height of the central event pixel, and this dependence can be adjusted with the 'phcut' parameter. Step 2 can be turned on and off with the 'chtrailcor' parameter, and Step 3 with the 'cticor' parameter.

The CTI calibration for Xtend depends on the event GRADE; however this information is not calculated until Step 4. If the parameter 'ctigrade=yes', the GRADE column of the input event list is used in the CTI correction. If 'ctigrade=no', the GRADE column is ignored. The 'usegoffset' parameter controls an additional GRADE-dependent correction to the central pixel pulse-height that is implemented along with the CTI correction, although controlled separately. If 'usegoffset=yes', this additive correction is applied. If 'usegoffset=no', it is not. Proper CTI correction requires an initial run of xtdpi with 'ctigrade=no' and 'usegoffset=no' to populate the GRADE column, and then a second run of xtdpi with 'ctigrade=yes' and 'usegoffset=yes' on the output file of the first run. The parameter 'copygrade' can be used to copy the original GRADE and PHA columns to GRADE_COPY and PHA_COPY columns before they are overwritten, in order to compare results with and without grade-dependent CTI correction.

In Step 4, a GRADE is assigned to each event based on the number and position of surrounding pixels whose pulse heights exceed the split threshold. These pulse heights are recorded for individual 3x3 pixels in the PHAS column, and the hit pattern of the outer 5x5 (16 pixel) ring is also used by way of the P_OUTER_MOST column. The total event pulse height amplitude (PHA) is calculated by summing up the PHAS in the pattern. Step 4 is always performed unless 'startcol=PHA', in which case the input file GRADE value is retained and written to the output file.

In the default usage, the split threshold is energy-dependent and optimized depending on the tentative PHA value. A split threshold is optimized for each event in the following way: (1) a tentative GRADE is assigned using an initial fixed split threshold; (2) a tentative summed PHA is calculated; (3) the optimum split threshold is determined; and (4) the final GRADE assignment and PHA value are determined. There are 4 parameters related to this optimization process, 'spthiter', 'spthcaldb', 'spthoffset', and 'spthslope'. The default values of the first two parameters are both yes. In this case, the values in the last two parameters are ignored, and the split threshold optimization proceeds normally. In the case of 'spthcaldb=no', the values of 'spthoffset' and 'spthslope' are read and used for the optimization, instead of the CalDB values. If 'spthiter=no', the iteration described above is not performed and a constant split threshold from CalDB (if 'spthcaldb=yes') or 'spthoffset' (if 'spthcaldb=no') is used for the grade assignment. The 'spthslope' parameter is ignored in both cases when 'spthiter=no'.

In Step 5, PHA is converted to PI using the gain correction table. PI is directly proportional to the X-ray energy, 1 PI channel = 6 eV for Xtend. Step 5 can be turned on and off with the 'gaincor' parameter. If turned off, PHA is simply copied to PI.

Bad pixels in the surrounding 3x3 ring can alter the grade and final PI of an event, possibly causing bad (e.g. particle) events to migrate to good events, thus losing information about the true event pulse height. The 'badpixopt' parameter, along with the PHAS_MASK column (see the xtdflagpix help file), can be used to mitigate this by specifying how events with bad pixels should be graded and summed. There are three options which are listed in the parameter description below.

For debugging and calibration purposes, the corrections in Steps 1-3 and 5 can be turned on or off independently using the 'vtcor', 'evnoddcor', 'chtrailcor', 'cticor', 'usegoffset', and 'gaincor' parameters. Furthermore, the intermediate results from each correction can be included in the output by specifying 'debugcol=yes'. Any of these debugging columns or the PHAS or PHA column can then be used as the starting point for another run of xtdpi with the 'startcol' parameter. It is important to note that any corrections turned on with 'vtcor', 'evnoddcor', 'chtrailcor', 'cticor', 'usegoffset', or 'gaincor' are performed regardless of the value of 'startcol', therefore it is possible to perform the same correction twice. If 'startcol=PHA', then all corrections that are enabled are applied to the PHAS column, but the GRADE and PHA are not recalculated, and the gain correction in Step 5 is applied to the PHA column in the input file. For processing of normal science data, these features should not be used and these parameters should be kept at their default values of yes.

Different combinations of the parameters 'cticor', 'ctigrade', and 'usegoffset' are also useful for debugging and calibration. It is important to note that, although the goffest correction is related to CTI and is based on GRADE, the setting of 'ctigrade' has no impact on whether or not this correction is applied. If 'usegoffset=yes', it will be applied regardless of the 'cticor' and 'ctigrade' settings. Thus to ensure no GRADE-based corrections are applied, 'ctigrade' and 'usegoffset' must both be set to no.

This task sets the following STATUS flags if an event satisfies certain conditions, shown in the table below. See the xtdflagpix help file for a full list of STATUS flags.

===========================================================================
flag   description
===========================================================================
26     (xtdpi - general) PHAS[0] < event threshold
27     (xtdpi - vtevnodd) Video temperature is out of range
28     (xtdpi - vtevnodd) Lack of video temp HK at time close to the event
29     (xtdpi - chtrail/CTI) Correction value is negative
30     (xtdpi - general) Null value by correction process
---------------------------------------------------------------------------

PARAMETERS

infile [filename]
Name of input Xtend FITS event file.

outfile [filename]
Name of output Xtend FITS event file.

hkfile [filename NONE|file name]
Name of input Xtend housekeeping (HK) file. If set to NONE, this file is not used for the even-odd correction and results in an error unless 'vtcor=no' and 'evnoddcor=no'.

(hkext = HK_SXI_USR_USER_HK1) [string]
Name of HK extension from which the video temperature is read.

(hkcolstem = SXI_USR_HKTBL_) [string]
Column name stem where the video temperature is recorded in the HK file.

(hkvideoid = B,B,B,B) [string]
Video card IDs used for the video board temperature correction for CCD1, CCD2, CCD3, and CCD4. This parameter must consist of a comma-separated list of 4 characters A or B.

(vtevnoddfile = CALDB) [filename CALDB|NONE|file name]
Name of video temperature and even-odd column correction file. If set to CALDB, the file is read from the calibration database (CalDB). If set to NONE, the task does not use this calibration information and results in an error unless 'vtcor=no' and 'evnoddcor=no'.

(chtrailfile = CALDB) [filename CALDB|NONE|file name]
Name of charge trail correction file. If set to CALDB, the file is read from the CalDB. If set to NONE, the task does not use this calibration information and results in an error unless 'chtrailcor=no'.

(ctifile = CALDB) [filename CALDB|NONE|file name]
Name of CTI correction file. If set to CALDB, the file is read from the CalDB. If set to NONE, the task does not use this calibration information and results in an error unless 'cticor=no' and 'goffset=no'.

(spthfile = CALDB) [filename CALDB|NONE|file name]
Name of split threshold values file. If set to CALDB, the file is read from the CalDB. If set to NONE, the task does not use this calibration information and results in an error unless 'spthcaldb=no'.

(gainfile = CALDB) [filename CALDB|NONE|file name]
Name of gain file for PHA to PI conversion. If set to CALDB, the file is read from the CalDB. If set to NONE, the task does not use this calibration information and results in an error unless 'gaincor=no'.

(patternfile = CALDB) [filename CALDB|file name]
Name of file for grade hit pattern. If set to CALDB, the file is read from the CalDB.

(startcol = PHAS) [string PHAS|PHAS_EVENODD|PHAS_TRAILCORR|PHAS_CTICORR|PHA]
The column name with which to start the corrections. Note: PHAS_EVENODD, PHAS_TRAILCORR, and PHAS_CTICORR are only present if the event file has already been processed with xtdpi using 'debugcol=yes'.

(vtcor = yes) [boolean yes|no]
If set to yes, the video board temperature correction is enabled.

(evnoddcor = yes) [boolean yes|no]
If set to yes, the even-odd column correction is enabled.

(chtrailcor = yes) [boolean yes|no]
If set to yes, the charge trail correction is enabled.

(cticor = yes) [boolean yes|no]
If set to yes, the CTI correction is enabled.

(gaincor = yes) [boolean yes|no]
If set to yes, the gain correction is enabled.

(ctigrade = yes) [boolean yes|no]
If set to yes, use of grade information in the CTI correction is enabled.

(usegoffset = yes) [boolean yes|no]
If set to yes, use of grade-based central-pixel offset (goffset) correction is enabled. This setting is independent of both 'cticor' and 'ctigrade'.

(copygrade = no) [boolean yes|no]
If set to yes, the existing GRADE and PHA columns to are copied to GRADE_COPY and PHA_COPY respectively, before overwriting the original columns with the newly calculated values.

(phcut = CALDB) [string]
Pulse height [ADU] below which the charge trail and CTI corrections use a fixed pixel pulse height value equal to 'phcut' to determine the amount of correction. If set to CALDB, the values from the TRAIL_PHCUT column of the charge trail CalDB file ('chtrailfile') and CTI_PHCUT column of the CTI CalDB file ('ctifile') are used.

(badpixopt = 2) [integer 1|2|3]
Option specifying how to process events that contain bad pixels. The parameter value must be an integer in the range 1-3. If set to 1, bad pixels are not flagged in the 3x3 event island and all PHAS values are used to grade and calculate the summed PHA; this method is used by Suzaku/XIS. If set to 2, the task applies PHAS_MASK to mask out bad pixels in the 3x3 island and set them to NULL. Grading and PHA summation are then calculated normally, effectively ignoring these pixels. If set to 3, the task applies PHAS_MASK to mask out bad pixels in the 3x3 island and set them to NULL. Then, the GRADE, PHA, and PI values are also set to NULL and these are considered bad events. This is the most conservative option, ensuring better fidelity at the expense of fewer counts.

(spthiter = yes) [boolean yes|no]
If set to yes, the grade assignment is iterated to optimize the split threshold.

(spthcaldb = yes) [boolean yes|no]
If set to yes, the split threshold values found in the 'spthfile' file are used.

(spthoffset = 15.0) [double]
Split threshold offset value, used when 'spthcaldb=no'.

(spthslope = 0.0) [double]
Split threshold slope value, used when 'spthcaldb=no'.

(evtthre = DEFAULT) [string]
Event threshold value. If set to DEFAULT, the task uses the values in the 'infile' header keyword EVENTTHR, which contains a comma-separated list of values for each CCD_ID and SEGMENT combination. Otherwise, a single numerical floating-point value can be specified and is used for all CCD_IDs and SEGMENTs.

(negthre = -5000) [integer]
Minimum value of any PHAS array element allowed for a normal event.

(deltatime = 8) [integer]
Acceptable time gap [s] to search for video temperature in the HK file. If a time entry is not found within this 'deltatime' of the event, an error flag is assigned in the STATUS column (flag number 28).

(debugcol = no) [boolean yes|no]
If set to yes, the intermediate values after each correction step are written to 'outfile'. This option can be used for debugging and calibration. The columns written are PHAS_EVENODD, PHAS_TRAILCORR, PHAS_CTICORR, PHA_SPTH, and GRADE_SPTH.

(randomize = yes) [boolean yes|no]
If set to yes, randomization is used to convert the input integer PHAS or PHA column to floating point. If 'startcol' is PHAS_EVENODD, PHAS_TRAILCORR, or PHAS_CTICORR, this parameter is ignored, since those columns already contain floating point values.

(seed = 2) [integer]
Random number generator seed. The system time is used if seed=0.

(buffer = -1) [integer -1|0|N]
Rows to buffer (-1=auto, 0=none, N>0=number of rows).

(clobber = no) [boolean yes|no]
Overwrites the existing output file if set to yes.

(chatter = 1) [integer 0|1|2|3]
Chatter level for output. Set to 0 to suppress output, or to 1, 2, or 3 for increasing the chatter of the output.

(logfile = !DEFAULT) [string DEFAULT|NONE|file name]
Log file name. If set to DEFAULT, uses the name of the task and, if preceded by "!", overwrites the file if it exists. If set to NONE, no log file is created.

(debug = no) [boolean yes|no]
Diagnostic output is printed to the screen if set to yes.

(history = yes) [boolean yes|no]
Records task parameters in HISTORY.

EXAMPLES

  1. Run xtdpi on XRISM observation 100050020 Xtend event file with default parameters.
  2.    xtdpi infile=xa100050020xtd_p0100004b0_uf.evt outfile=xtd_out.evt hkfile=xa100050020xtd_a0.hk
    
  3. Run xtdpi on XRISM observation 100050020 Xtend event file, disabling the CTI correction.
  4.    xtdpi infile=xa100050020xtd_p0100004b0_uf.evt outfile=xtd_out.evt hkfile=xa100050020xtd_a0.hk cticor=no
    
  5. Run xtdpi on XRISM observation 100050020 Xtend event file using a constant split threshold of 20.0
  6.    xtdpi infile=xa100050020xtd_p0100004b0_uf.evt outfile=xtd_out.evt hkfile=xa100050020xtd_a0.hk spthiter=no spthcaldb=no spthoffset=20
    
  7. Run xtdpi on XRISM observation 100050020 Xtend event file with debugging columns output.
  8.    xtdpi infile=xa100050020xtd_p0100004b0_uf.evt outfile=xa100050020xtd_p0100004b0_uf_debug.evt hkfile=xa100050020xtd_a0.hk debugcol=yes
    
  9. Run xtdpi on XRISM observation 100050020 from previous output, starting with and only applying the charge trail correction. This requires that the debugging columns are present in the input file, therefore xtdpi must have been run previously.
  10.    xtdpi infile=xa100050020xtd_p0100004b0_uf_debug.evt outfile=xtd_xtdpi2_debug_onlychtrail.evt hkfile=xa100050020xtd_a0.hk startcol=PHAS_EVENODD \
          vtcor=no evnoddcor=no chtrailcor=yes cticor=no debugcol=yes
    
  11. Run xtdpi on XRISM observation 100050020 skipping the even-odd, charge trail, and CTI corrections. This would be useful for verifying the gain (PHA to PI conversion) calibration quality alone. Debug columns are also output to determine whether the proper corrections were made.
  12.    xtdpi infile=xa100050020xtd_p0100004b0_uf.evt outfile=xtd_out_onlygain.evt hkfile=xa100050020xtd_a0.hk vtcor=no evnoddcor=no chtrailcor=no \
          cticor=no debugcol=yes
    

SEE ALSO

xtdphas, xtdflagpix, xtdrmf

LAST MODIFIED

June 2, 2023