NAME

hxisgdexpand - Expand HXI and SGD SFF occurrences to have one signal in each row

USAGE

hxisgdexpand infile outfile remapfile badpixfile

DESCRIPTION

The hxisgdexpand task expands the occurrence(s) from an input HXI or SGD SFF (second FITS file), such that each output row contains only one signal (for the definition of occurrence and signal, see below). The input file is the output from the hxisgdpha task.

The output file consists of a copy of the input file with several added columns. For both instruments, the columns READOUT_ID_INDEX, RECO_STATUS, and PI (energy) are added. In the case of an HXI input file, the task also adds the columns LAYER, RAWX, and RAWY. In the case of an SGD input file, the task only adds one extra column, MATTYPE, containing an integer identifying the type of originating layer (1 for the Si Layer and 2 for the CdTe layer). The column PI may be populated by either the PHA or the EPI values (see parameter 'expandcol'). If EPI is selected, the value is converted to PI.

A row in the SFF for both HXI and SGD corresponds to an "occurrence" or a possible photon event. Each occurrence contains one or more "signals", each with a given amount of energy deposited in an instrument readout or pixel.

For the task to work, the input file must contain the following columns: TIME, OCCURRENCE_ID, CATEGORY, LIVETIME, STATUS, PROC_STATUS, FLAG_SEU, FLAG_LCHK, FLAG_TRIG, FLAG_TRIGPAT, FLAG_HITPAT, FLAG_FASTBGO, READOUT_ID_RMAP, NUM_ASIC, and EPI (or PHA). In addition, for SGD, the task requires the following additional columns: FLAG_LCHKMIO, FLAG_HITPAR_CC, FLAG_CALMODE, and FLAG_CCBUSY.

PARAMETERS

infile = sff.evt [filename]
Input file name. This is the output of the hxisgdpha task.

outfile = out.evt [filename]
Output file name.

remapfile = CALDB [filename CALDB|file name]
FITS file containing the remapping of ASIC and READOUT numbers. If the parameter is set to CALDB, the file is read from a the calibration database.

badpixfile = CALDB [filename CALDB|file name]
FITS file containing the energy threshold defining a real signal for each readout. If the parameter is set to CALDB, the file is read from the calibration database.

(occurrenceid = -1) [integer]
If greater than zero, the task only expands this single occurrence.

(expandcol = EPI) [string EPI|PHA]
Energy column to output in expand mode. If 'expandcol=PHA', the signal PHA values are output. If 'expandcol=EPI', the signal EPI value is converted to PI and output. Any value other than EPI or PHA defaults to EPI.

(buffer = -1) [integer -1|N|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. Expand all occurrences from the input file to one row per signal and convert EPI to PI.
  2.    hxisgdexpand infile=HXI_SFF.fits outfile=HXI_output.fits remapfile=CALDB badpixfile=CALDB 
    
  3. Expand only occurrence 2 from the input file to one row per signal and write PHA in the PI column.
  4.    hxisgdexpand infile=HXI_SFF.fits outfile=HXI_output.fits remapfile=CALDB badpixfile=CALDB occurrenceid=2 expandcol=PHA
    

SEE ALSO

hxisgdsff, hxisgdpha, hxievtid, sgdevtid, gainfit

LAST MODIFIED

February 22, 2024