batsurvey-erebin - perform energy correction on survey data


batsurvey-erebin infile outfile calfile


batsurvey-erebin does energy scale correction on survey data. The benefit of this task is that it can do a batch of survey data at one time (multiple DPH files), and that it can do automatic selection of the correct gain/offset tables. The gain/offset maps must be located in the standard directory within the observation.

Since batsurvey-erebin has the capability of correcting multiple DPH files, one can specify a generic template output file name, and batsurvey-erebin will create the output file name from the template. batsurvey-erebin responds to two particular template strings, which are: "%root" - full path of input file, with suffxes removed; "%rootpath" - same as %root, with leading path components removed. For example, infile="test.dph" outfile="outdir/%rootfile_erebin.dph" would make an output file named "outdir/test_erebin.dph".


infile [filename]
Name of BAT survey file. If the name begins with an "@" symbol, then it is assumed that the file contains an ASCII list of files, one per line. Each listed file is corrected, and saved according to the file name listed in 'outfile'.

outfile [filename]
Name of corrected output files. It is also possible to specify a template filename, where portions of the input file are substituted into the template, as described above.

calfile [string]
Gain/offset file(s) to use. Either specify one explicit file name to be used for all input files; OR the name of a directory containing multiple gain/offset files; OR the word "QUERY" to indicate using the 'repoquery' task to find gain/offset files (this last option is for BAT team internal usage only). If specifying a directory, then each file is scanned for internal keywords which specify the time of the file. To speed up this indexing operation, the file name can contain the time, in the form, swOOOOOOOOOOObcboddddgdddd_mmmmmmmmm.fits, where mmmmmmmmmm is the time in mission elapsed time.

residfile="CALDB" [filename]
"Residual" gain/offset file to use. Passed directly to baterebin.

pulserfile="CALDB" [filename]
"Ground pulser to energy" calibration file to use. Passed directly to baterebin.

fltpulserfile="CALDB" [filename]
"Flight pulser to energy" calibration file to use. Passed directly to baterebin.

baterebin_opts="" [string]
Extra options to be passed to baterebin.

(clobber = NO) [boolean]
If the output file already exists, then setting "clobber = yes" will cause it to be overwritten.

(chatter = 2) [integer, 0 - 5]
Same as baterebin chatter option.

(history = YES) [boolean]
If history = YES, then a set of HISTORY keywords will be written to the header of the specified HDU in the output file to record the value of all the task parameters that were used to produce the output file.


1. List all survey files, and correct their energy scale, using the gain/offset files found in the housekeeping directory.

     ls 00035025015/bat/survey/*.dph* > mydphfiles.txt
     batsurvey-erebin infile=@mydphfiles.txt \
         outfile=output/%rootfile_erebin.dph calfile=bat/hk


baterebin, batsurvey


Jun 2008