PRO getfiledates,filedates,n,year,month,day,fhour,fminute,fsecond ; This little procedure takes a STRING array of lines from a log ; file generated by /usr/local/bin/novarestor, and extracts the ; unique year/month/day combinations, returning the years, months, ; and days in INTEGER arrays. It also returns the UT hour, minute, ; and second of the first file from each day. nlines=N_ELEMENTS(filedates) READS,filedates(0),year,month,day,hour,minute,second $ ,FORMAT='(I4,5(1X,I2))' julian=[julday(month,day,year)] year=[year] month=[month] day=[day] first=[(hour*60L+minute)*60+second] FOR i=1,nlines-1 DO BEGIN READS,filedates(i),y,mo,d,h,mi,s,FORMAT='(I4,5(1X,I2))' jd=julday(mo,d,y) seen=WHERE(jd EQ julian) IF (seen(0) EQ -1) THEN BEGIN julian=[julian,jd] year=[year,y] month=[month,mo] day=[day,d] first=[first,(h*60+mi)*60+s] ENDIF ELSE BEGIN seen=seen(0) uts=(h*60L+mi)*60+s IF uts LT first(seen) THEN first(seen)=uts ENDELSE ENDFOR n=N_ELEMENTS(day) first=LONG(first) fsecond=first MOD 60 fminute=first/60 MOD 60 fhour=first/3600 IF n GT 1 THEN BEGIN ds=SORT(julian) year=year(ds) month=month(ds) day=day(ds) fhour=fhour(ds) fminute=fminute(ds) fsecond=fsecond(ds) ENDIF RETURN END