NAME

hxisgdpha - Calibrates the Hitomi HXI or SGD PHA for each signal in the SFF event file

USAGE

hxisgdpha infile outfile gainfile badpixfile

DESCRIPTION

The hxisgdpha task flags events in the STATUS column and computes the energy-proportional pulse-height (EPI) from the PHA column in the SFF (second FITS file) for HXI and SGD. The hxisgdpha task checks, for each event in the SFF, whether the event is set to bad in the 'badpixel' calibration file, using the information stored in CALDB.

For bad events, a flag is set in the STATUS column, and the EPI is set to NULL. A flag is set in the STATUS column for SGD events that have the FLAG_LCHK column value set to 1, and that have a PHA value that is either 1022 or 1023. For these events, the EPI is calculated.

The hxisgdpha task then subtracts the common-mode noise from each PHA (PHA_NSUB hereafter) and if requested, outputs the subtracted PHA in the column PHA_NSUB (see parameter 'outnsubco'). If PHA_NSUB is negative, a flag is set in the STATUS column, but the event is still processed.

The EPI is calculated using the gain coefficients stored in a calibration file. If PHA_NSUB is positive but outside of the range of the calibration interval in CALDB, a flag in the STATUS column is set and the EPI is NULL.

For the SGD only, there are two gain tables, one for a trigger in silicon, (normal gain) and the other for a trigger in the CdTe (alternative gain). If an event in the SGD has the FLAG_TRIGPAT set to 1, hxisgdgain uses the normal gain, otherwise it uses the alternative gain, and a flag is set in the STATUS column.

PARAMETERS

infile [filename]
Input second FITS file (SFF) from HXI or SGD.

outfile [filename]
Output SFF. If 'outfile' is the same file as 'infile', 'clobber' must be set to yes (or by prepending "!" to the output file name), otherwise the task exits with an error.

gainfile [filename CALDB|file name]
Gain calibration of PHA for the HXI or SGD camera. If the parameter is set to CALDB, the file is read from the calibration database.

badpixfile [filename CALDB|file name]
Active and bad channels (pixels) file of the HXI or SGD camera. If the parameter is set to CALDB, the file is read from a file in the calibration database.

(outnsubcol = no) [boolean yes|no]
Flag to output the PHA_NSUB column. This column contains the value of the PHA minus the ASIC common-mode noise (ASIC_CMN column in the SFF).

(randomize = no) [boolean yes|no]
If set to no, the task does not randomize the fractional part of PHA before calibration.

(seed = 0) [integer]
Random number generator seed. If 'seed=0', system time is used.

(datamode = NONE) [string]
If 'datamode' is not set to NONE (or an empty string), 'datamode' is used in place of the value of the keyword DATAMODE that is in the input event file.

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

(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 tool parameters in HISTORY.

EXAMPLES

  1. Calibrate the PHA, updating the input file in-place.
       hxisgdpha infile=sgd_skel_sff.fits outfile="!sgd_skel_sff.fits" gainfile=CALDB badpixfile=CALDB
    
  2. Calibrate the PHA, creating a new output file, and adding the PHA_NSUB column.
  3.    hxisgdpha infile=sgd_skel_sff.fits outfile=sgd_skel_sff-cal.fits gainfile=CALDB badpixfile=CALDB outnsubcol=yes
    

    SEE ALSO

    hxisgdsff

    LAST MODIFIED

    November 30, 2018