pro get_t0,t0_file,dir,n_start_line,wgse_to_gps_offset,wgset0,t0 ; v2, 12/8/98, B. Rizk ; retrieves the wgse t0 from the idx file of ; the supplied test log, converts to seconds ; and adds the offset to correct to GPS time ; in seconds ; v4 3/9/4 works on a PC without grep ; v5b 11/9/4 works on checkout directories time0='string' openw,ol,t0_file,/get_lun cd,dir openr,ol_in,'idx',/get_lun listcnt=0 halt=0 if n_start_line ne -1 then begin while not (eof(ol_in) or halt eq 1) do begin readf,ol_in,time0 junk=strpos(time0,'START_SCENARIO') if junk ne -1 then halt=1 endwhile print,time0 parse=strsplit(time0,'-',/extract) print,'WGSE Start Time = ',parse(1) printf,ol,'WGSE Start Time = ',parse(1) time_extract,parse(1),hr,mn,sec,wgset0 endif else begin wgset0=0.0 endelse print,'WGSE Start Time = ',wgset0,' seconds' printf,ol,'WGSE Start Time = ',wgset0,' seconds' print,'GPS/WGSE Offset = ',wgse_to_gps_offset,' seconds' printf,ol,'GPS/WGSE Offset = ',wgse_to_gps_offset,' seconds' t0=wgset0+wgse_to_gps_offset print,'GPS Start Time = ',t0,' seconds' printf,ol,'GPS Start Time = ',t0,' seconds' close,/all return end