;+ ; NAME: ; GTIENLARGE ; ; ; AUTHOR: ; Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770 ; craigm@lheamail.gsfc.nasa.gov ; ; PURPOSE: ; Enlarge (or shrink) each Good Time Interval (GTI) by fixed amounts ; ; CALLING SEQUENCE: ; NEWGTI = GTIENLARGE(GTI, COUNT=COUNT, PRE=PRE, POST=POST) ; ; DESCRIPTION: ; ; The function GTIENLARGE accepts an existing valid Good Time ; Interval (GTI) array and creates a new GTI array in which the ; intervals have been enlarged (or shrunken) by a fixed amount. ; ; The keywords PRE and POST are used to specify the enlargement. ; Given an existing good interval such as this one: ; ; 100 200 GTI=[[100,200]] ; <------------|===================|-------------> ; ; a positive value of PRE will enlarge the lead edge of the interval ; and a positive value of POST will enlarge the trailing edge of the ; interval. Thus PRE=10 and POST=20 will create a new interval from ; the above example: ; ; 90<-- --->220 NEWGTI=[[ 90,220]] ; <---------|==.===================.====|--------> ; PRE=10 POST=20 ; ; Negative values of PRE and POST are allowed, which will shrink the ; interval from the leading and trailing edges respectively. ; ; Users should be aware that the number of intervals may shrink ; under this operation, since it is possible either for two ; intervals to be merged if they are enlarged and overlap, or if ; they are shrunken to a size of zero. ; ; 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: ; ; GTI - a 2xNINTERVAL array where NINTERVAL is the number of ; intervals. GTI(*,i) represents the start and stop times of ; interval number i. The intervals must be non-overlapping ; and time-ordered (use GTITRIM to achieve this). ; ; A scalar value of zero indicates that the GTI is empty, ie, ; there are no good intervals. ; ; KEYWORDS: ; ; 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 ; ; COUNT - upon return, the number of resulting intervals. A value ; of zero indicates no good time intervals. ; ; 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: ; ; GTITRIM, GTIENLARGE ; ; MODIFICATION HISTORY: ; Written, CM, 1997-2001 ; Documented, CM, Apr 2001 ; ; $Id: gtienlarge.pro,v 1.3 2001/04/30 16:03:03 craigm Exp $ ; ;- ; Copyright (C) 1997-2001, Craig Markwardt ; This software is provided as is without any warranty whatsoever. ; Permission to use, copy, modify, and distribute modified or ; unmodified copies is granted, provided this copyright and disclaimer ; are included unchanged. ;-