NAME

sxsextend -- Calculate the extended PI for the SXS event files

USAGE

sxsextend inuffile outuffile outclfile driftfile gtigenfile gtitelfile gtimxsfile

DESCRIPTION

The baseline PI column populated by the pipeline has a maximun number of channels of 32768. Each channel is 0.5 eV and the maximun energy in the spectrum is about 16.4 keV. The SXS may have signal collected up to 32 keV. 'sxsextend' allows to extend the range of channels and therefore the range of energy. The result is stored in a column named PIE.

'sxsextend' is a script that starting from the unfiltered event file run in sequence 'sxspha2pi', 'sxsperseus' (only for early Perseus data) and re-screen the data. Several files are required as input to 'sxsextend': the ufiltered event file, several gti files and the drift correction file. All these files are present in the archive. To extend the energy the parameters 'eminin', minimum energy in eV, 'dein', bin size in eV, and 'nchanin', number of channels, are set to default value to produce a spectra up to 32 keV with a bin size of 1 eV. The output are the unfiltered event file where the column PIE is populated and the cleaned event file obtained by screening the unfiltered data using the input GTI and event screening criteria stored in CALDB.

If the input event file has already the EPI column, it is possible to calculate the PIE by setting the parameter 'driftfile' to NONE and provide the value for the energy range in the 'eminin', 'offset' and 'nchanin'. This is a useful short cut when the driftfile is identical to that used to calculate the EPI column (see 'sxspi' and 'sxsgain'). In this case the

PARAMETERS

inuffile [filename]
Input SXS event file name. This file maybe be the _uf.evt or the _cl.evt.

outuffile [filename]
Name of the output unfiltered event file with the column PIE populated. If the input is the _cl.evt the output is the _cl.evt with the PIE column populated.

outclfile [filename]
Name of the output cleaned event file with the column PIE populated. Event and GTI screening are applied. If the input file is the _cl.evt and not GTI are applied this file is identical to the 'outffile'.

driftfile [filename]
Input file containing drift correction file. This is the output of sxsgain. If set to NONE the code uses the input file and calcultes the PIE column from the EPI using the values in the parameters 'eminin', 'offset' and 'nchanin'.

gtigenfile [filename]
Input file containing the general gti. This file is archived with the data and has the suffix _gen.gti. If the paramater is set to NONE no tel GTI is used.

gtitelfile [filename]
Input file containing the good telemetry gti. This file is archived with the data and has the suffix _tel.gti If the paramater is set to NONE no tel GTI is used.

gtimxsfile [filename]
Input file containing the gti to exclude the MXS (modulated X-ary source). This file is archived with the data and has the suffix _mxfn.gti. If the paramater is set to NONE no mxs GTI is used.

gtiadroff [filename]
Input file containing the gti to exclude the time when the ADR is on. This GTI is an extention of the unfiltered archived event file. If the paramater is set to DEFAULT the task read these GTI from the extension.

gtimkf [filename]
Input file containing the gti to include time when the housekeeping are within the expected values This GTI is an extention of the unfiltered archived event file. If the paramater is set to DEFAULT the task read these GTI from the extension.

gtiehk [filename]
Input file containing the gti to include time when the orbital parameters are within the expected values This GTI is an extention of the unfiltered archived event file. If the paramater is set to DEFAULT the task read these GTI from the extension.

gtiextra [filename]
Input file containing the user gti to exclude other unwanted times. If the paramater is set to NONE no extra GTI file is used.

eminin = 0.0 [double]
Minimum energy in eV. Default is set to 0.0 eV.

offset = 1.0 [double]
Offset for first PIE for extended energy range [eV]. Default is set to 1.0 eV

nchanin = 32768 [int]
Maximum number of PIE channel for extended energy range.Default is set to 32768.

(gainfile = CALDB) [filename]
Input file containing SXS energy scale (gain) coefficients, or CALDB.

(scalefile = CALDB) [filename]
Input file containing SXS gain adjustments for each individual pixels, or CALDB. This adjustment is only valid if the gain has been calculated using the pixel 12. There are two allowable formats for the scalefile. The first format has two columns, PIXEL and HP, and the scale factors are applied to the event grades as specified in the scalegrade parameter. The second format has three columns, PIXEL, HP, M, and L, giving the specific scale factors for each grade. The scalegrade parameter is ignored when the task is given a scalefile with the second format.

(dgfile = REFDATA) [file]
Input gain coefficients file. This file is read from the REFDATA area of HEAsoft and should not be changed.

(offsetfile = REFDATA) [file]
Input calibration offset file. This file is read from the REFDATA area of HEAsoft and should not be changed.

(selectfile = CALDB) [file]
Name of the select file or user input label file with labels and expressions. If the parameter is set to CALDB, the file is read from the calibration database. If the parameter is set to NONE, the task does not use this calibration information.

(leapsecfile = REFDATA) [file]
Name of the input leap second file. If set to CALDB or REFDATA uses the leapsecond file in either CALDB or REFDATA area.

(secphacol= PHA) [string]
Input column name to use for the gain correction. The default is PHA containing the telemetered values. If the secondary were corrected (see task sxsseccor) a new PHA column is present in the file (default PHA2) and the user may specified this new column name to apply the gain.

(method = FIT) [string]
Correction method (FIT or AVERAGE). If FIT, the TEMP_FIT column in the driftfile is used; if AVERAGE the TEMP_AVG column is used.

(scaleepi= no) [boolean]
Scale EPI for each pixel using the values in the CALDB file entered in the parameter scalefile (yes/[no]).

(scalegrade= 0) [string]
Grade to which the scaling factor per pixel is applied. By default the task applies the scaling factor only to grade 0. Other grades maybe be specified by a comma separated list, e.g. "0,1,2". This parameter is only used when the scalefile contains a single column (HP).

(itypecol = ITYPE) [string]
Column containing event grade in infile.

(gapdt = -1.) [double]
Time [s] between events to define a gap (or <0). Events must have entries appropriate to its pixel value in driftfile within this interval; otherwise, EPI and PI are set to their null values.

(ntemp = 3) [int]
Number of temperatures from gain file to use in interpolation. The energy at each of these temperatures is calculated from the PHA of the event, and used to derive the event energy by ntemp-point interpolation.

(writetemp = no) [boolean]
Write temperature used for each event to output event file (yes/[no]).

(extrap = no) [boolean]
Allow extrapolation when determining drift temperature (yes/[no]).

(randomize = yes) [boolean]
If randomize = 'yes', decimal randomization is applied to PHA (an integer) before applying the gain to obtain energy (a double).

(seed = 0) [integer]
Random number generator seed; uses system time for seed=0.

(outrange = NULL) [string]
Define how to handle events with TIMEs outside of the driftfile TIME range. If outrange = NULL, then assign EPI=PI=NULL; if outrange=CONST, then use the gain correction from the first or last time in driftfile; if outrange=EXTRAP, then extrapolate the gain correction from driftfile.

(expr [string])
User-input expression applied to input file used to create GTI.

(label = NONE) [string]
Labels to read from label file specified by 'selectfile'. To input multiple labels, use a comma-separated list.

(cleanup = yes) [boolean]
Delete intermediate files ([yes]/no).

(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. Assign PIE for events in event_uf.fits and screen the data

      sxsexdent  event_uf.fits event_uf_out.fits event_cl_out.fits driftfile gti_gen.gti gti_tel.gti
      gtimxsfile=NONE eminin=0.0 dein=1 nchain=32768

SEE ALSO

sxspha2pi, sxsperseus, sxsgain, sxssecid

LAST MODIFIED

December 2016