NAME

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

USAGE

hxisgdexpand infile outfile remapfile badpixfile

DESCRIPTION

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

The output file consists of a copy of the input file with several added columns. For both instruments, the columns called 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, RAWY. In the case of an SGD input file, the task only adds one extra column, MATTYPE, containing an integer identifying the 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, EPI (or PHA). In addition, for the SGD, the task requires the following additional columns: FLAG_LCHKMIO, FLAG_HITPAR_CC, FLAG_CALMODE, FLAG_CCBUSY

PARAMETERS

infile [filename]
Input filename. This is the output of the tool hxisgdpha.

outfile [filename]
Output filename.

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

badpixfile = CALDB [filename]
FITS file containing the energy threshold defining a real signal for each readout. If the parameter is set to CALDB, the default, 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]
Energy column to output in expand mode. If expandcol=PHA, then 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 default to EPI.

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

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

(chatter = 1) [integer]
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]
Log filename. If set to DEFAULT uses the name of the task and, if preceded by '!', overwrite the file if it exists. If set to NONE no log file is created.

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

(history = yes) [boolean]
Records tool parameters in HISTORY ([yes]/no).

(mode = ql) [string ql|hl|q]
Mode to query the parameter file. Acceptable values include: 'ql' (query and learn/remember), 'hl' (hidden and learn/remember), 'q' (query but don't remember), 'h' (hidden).

EXAMPLES

1. Expand all occurrences from the input file to one row per signal and convert EPI to PI
hxisgdexpand infile=HXI_SFF.fits outfile=HXI_output.fits remapfile=CALDB badpixfile=CALDB 
2. Expand only occurrence 2 from the input file to one row per signal and write PHA in the PI column.
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 2016