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.
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]'
batmaskwtevt, batdrmgen-multi, calc_express