;+ ; NAME: ; vu_is_sequence ; PURPOSE: ; Check whether a 'hdr' array refers to a sequence from a time-dependent ; tomography run. ; CATEGORY: ; Tomography ; CALLING SEQUENCE: FUNCTION vu_is_sequence, hdr, silent=silent ; INPUTS: ; hdr ; OPTIONAL INPUTS: ; silent=silent scalar; type: integer ; 0,1,2: suppresses informational messages ; OUTPUTS: ; Result scalar; type: integer ; 0: not a sequence ; 1: is a sequence; returned if hdr is an array with more ; than 1 element and all marker values have the same ; non-zero value. ; INCLUDE: @compile_opt.pro ; On error, return to caller ; CALLS: ; vu_get, TimeOp, TimeUnit, InitVar ; PROCEDURE: ; If more than one hdr is present, check whether it is from a single time-dependent ; tomography run (i.e. whether all markers have the same non-zero value). ; MODIFICATION HISTORY: ; APR-2001, Paul Hick (UCSD/CASS) ; JUL-2002, Paul Hick (UCSD/CASS; pphick@ucsd.edu) ; Added check for sorted time sequence. This is now used to identify ; a sequence rather than a single marker value for all headers. ;- InitVar, silent, 0 nn = n_elements(hdr) is = nn GT 1 IF is THEN BEGIN is1 = vu_get(hdr, /uttime) is1 = (where(sort(TimeOp(/subtract,is1,is1[0],TimeUnit(/day))) NE indgen(nn)))[0] EQ -1 is2 = hdr[0].marker is2 = is2 NE 0 AND (where(is2 NE hdr.marker))[0] EQ -1 IF is2 THEN IF silent LE 1 THEN message, /info, 'single time-dependent tomography run' CASE is1 OF 0: IF is2 THEN message, 'time-dependent tomography run is not sorted' 1: IF NOT is2 THEN IF silent LE 1 THEN message, /info, 'time-sorted sequence' endcase is = is1 ENDIF RETURN, is & END