MASK2GTI Name
MASK2GTI
Author
Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
craigm@lheamail.gsfc.nasa.gov Purpose
Convert a gridded set of times to a set of Good Time Intervals (GTIs)
Calling Sequence
GTI = MASK2GTI(TIME, MASK, COUNT, INDICES=INDICES, $
TIMEDEL=, GOOD=, BAD=, PRE=, POST=)
Description
The function MASK2GTI accepts an array of times and mask, and
converts valid data into corresponding good time intervals (GTIs).
Elements of the MASK array are clustered together according to
whether they are "good" or not. Contiguous segments of good
elements are converted to single good time intervals. Time
elements are considered to be regularly spaced, so any breaks in
the MASK values are considered to be discontinuities.
The time array *must* be evenly spaced and sorted in ascending
order. Each element of MASK must correspond to the same element
of TIME. The primary difference between GTISEG and MASK2GTI is
that GTI2SEG allows time values to be irregularly sampled and no
mask is passed. Also, MASK2GTI allows intervals to be enlarged or
shrunk.
It should be noted that this function is not constrained to
operation only on time arrays. It should work on any
one-dimensional quantity with intervals.
Inputs
TIME - an array of evenly spaced, ascending order, times.
MASK - an array of values matched to TIME.
COUNT - upon return, the number of resulting intervals. A value
of zero indicates no good time intervals.
Keywords
INDICES - upon return, a 2xCOUNT array of integers which give the
indices of samples which lie within each interval. The
times TIME(INDICES(0,i) : INDICES(1,i)) fall within the
ith interval.
TIMEDEL - a scalar value giving the time spacing of the array.
Default: TIME(1)-TIME(0)
PRE - the amount each interval should be enlarged from its leading
edge. A negative value indicates the interval should
shrink.
Default: 0
POST - the amount each interval should be enlarged from its
trailing edge. A negative value indicates the interval
should shrink.
Default: 0
GOOD - the value of "good" in the input mask array.
Default: 1b
BAD - the value of "bad" in the input mask array.
Default: 0b
Returns
A new GTI array containing the enlarged or shrunken intervals.
The array is 2xCOUNT where COUNT is the number of resulting
intervals. GTI(*,i) represents the start and stop times of
interval number i. The intervals are non-overlapping and
time-ordered.
If COUNT is zero then the returned array is a scalar value of
zero, indicating no good intervals were found.
See Also
GTI2MASK, GTITRIM, GTIMERGE, GTIWHERE
Modification History
Written, CM, 1997-2001
Documented, CM, Apr 2001