NAME

battsplit - split a good time interval into smaller parts

USAGE

battsplit infile outfile tolerance=...

DESCRIPTION

The battsplit task is able to split an existing good time interval into smaller part, according to a user specified splitting criterium. By default, the intervals are split whenever the Swift spacecraft has slewed more than X degrees, where X is given by the 'tolerance' parameter.

For this method to work, the 'infile' parameter should be set to the auxiliary ray trace file produced by batbinevt. The user should also probably enter a 'gtifile', specifying some time intervals of interest.

Upon output, a new GTI file will be created. The original time intervals may be broken up into smaller adjoining pieces according to the user-set criterium. The criterium is satisfied when the 'expr' differencing expression changes by more than 'tolerance' (both 'expr' and 'tolerance' are parameters).

For the purposes of calculating the expression, the values in the input table are assumed to be constant at the corresponding TIME value, until the the time of the next row. I.e. the input file is treated as piecewise-constant. IMPORTANT NOTES: For BAT data, care must be taken when feeding the output of this task to the 'mgtime' task, or any other task that merges GTIs. Most tasks will attempt to combine adjoining GTIs, and thus the splitting operation will be erased. It is expected that the user will feed this GTI directly into the 'batbinevt' task, for use with 'user'-style time binning. Also, users should make sure that the input file has enough time sampling to well-cover each of the good time intervals specified in 'gtifile'. If the input file is too coarsely sampled, the split times may be inaccurate.

The default expression computes the angular distance traveled by the Swift spacecraft, in degrees. Any other expression can be used, in the CFITSIO calculator style, so long as it computes the difference between two rows. For example, if one is interested in changes in the single column called "VALUE", the difference expression would be written as,


  expr='ABS(VALUE-VALUE{-1})
The 'VALUE{-1}' expression is CFITSIO calculator notation to use the value from the previous row. Thus, the difference expression simply computes the linear change between rows. battsplit will take care of calculating the accumulated difference over multiple rows, and determining when the 'tolerance' has been crossed.

PARAMETERS

infile [filename]
Input file name. For BAT operation, this should be the auxiliary raytrace file produced by batmaskwtevt.

outfile [filename]
Output file name. The output will contain a set of good time intervals.

(gtifile = 'NONE') [string]
Name of input good time interval file, or 'NONE'. battsplit will split up the 'gtifile'. If no 'gtifile' is specified, then battsplit will split the time interval (-infinity,+infinity).

(tolerance = 5.0) [real]
Amount of change in the difference expression required before an interval is split.

(expr = 'SQRT((IMX-IMX{-1})^2 + (IMY-IMY{-1})^2)/#deg') [string]
The difference expression, which should compute the difference between two rows, as described above. The default expression computes the angular difference between two rows in the BAT auxiliary ray trace file, based on the tangent plane coordinates IMX and IMY, with the result expressed in units of degrees.

(diffcol = '_DIFF') [string]
Name of difference expression column, created in scratch file.

(cleanup = 'YES') [boolean]
Boolean which determines whether temporary scratch files are cleaned up or not.

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

(chatter = 2) [integer, 0 - 5]
Controls the amount of informative text written to standard output. Setting chatter = 1 produces a basic summary of the task actions; chatter = 2 (default) additionally prints a summary of input parameters; chatter = 5 prints debugging information.

(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.

EXAMPLES

1. Split the T90 time interval in dur.gti into 5 degree intervals. The result is placed in split.gti.

     battsplit sw00340895000b_all.evaux split.gti tolerance=5.0 \
       gtifile=dur.gti'[GTI_T90]'

SEE ALSO

batmaskwtevt, batdrmgen-multi, calc_express

LAST MODIFIED

Feb 2009