PRO pareja,date,list,time,dtim ; ;Selects IR frames closest in time to WL frames. ;INPUT: "restore" files 'log' (IR) and 'wlog' (WL). ; DATE is either 23 or 25 ;OUTPUT: string array LIST with names of IR frames ; float array TIME with times UT (seconds) of IR frames ; float array DTIM with time differences WL - IR (seconds) ; ;2 July 1999, Michal on_error,1 n=0 if (date ne 23) and (date ne 25) then $ message,'Sorry, I do not know how to handle this dataset' dat=strtrim(date,2) ;paths for calling from the directory irdata restore,'../wldata/wlog'+dat restore,'log'+dat if date eq 23 then begin wlist=wlist23 ilist=list23 wtime=wtime23 itime=time23 endif else begin wlist=wlist25 ilist=list25 wtime=wtime25 itime=time25 endelse ;fit the IR time range to that of WL limit=max(wtime,wlast) ;wlast is the last subscript of wtime w=where(itime gt limit) ilast=w(0) ;ilast is the last subscript to be searched ; in itime w=lonarr(wlast+1) ;loop over WL frames, look for the IR frame closest in time for i=0,wlast do begin mi=min(abs(itime(0:ilast)-wtime(i)),pos) w(i)=pos ;subscript of the closest IR frame endfor list=ilist(w) ;resulting arrays time=itime(w) dtim=wtime-time END