PRO shglow,year,month,day,smoothed=smoothed date=STRING(year MOD 100,month,day,FORMAT='(3I2.2)') ilist=STRARR(2) ilist(0)='/wesson/user/steele/PAC/field/SAO/'+date+'.0.ilist' ilist(1)='/wesson/user/steele/PAC/field/SAO/'+date+'.1.ilist' iname=STRARR(4,100,2) nsets=INTARR(2) s='' t=1.0 PRINT,'Getting image file names...' FOR i=0,1 DO BEGIN OPENR,unit,ilist(i),/GET_LUN READF,unit,n nsets(i)=n FOR j=0,n-1 DO BEGIN FOR k=0,3 DO BEGIN ; OH, bg, OH dk, bg dk READF,unit,t,s iname(k,j,i)=STRTRIM(s,2) ENDFOR ENDFOR ENDFOR n=MAX(nsets) iname=iname(*,0:n-1,*) itime=STRARR(2,n) hmsms=BYTARR(4) PRINT,n,FORMAT='(I3," image pairs found.")' ohsets=INTARR(256,128,n) bgsets=ohsets PRINT,'Getting image files...' t0=SYSTIME(1) FOR j=0,n-1 DO BEGIN FOR i=0,1 DO BEGIN rdkimg,iname(0,j,i),hb,ohim h=gethd(hb) FOR k=0,3 DO hmsms(k)=h.misc.tm.(k) itime(i,j)=STRING(hmsms(0),hmsms(1),hmsms(2) $ ,FORMAT='(I2.2,":",I2.2,":",I2.2)') rdkimg,iname(1,j,i),hb,bgim rdkimg,iname(2,j,i),hb,ohdk rdkimg,iname(3,j,i),hb,bgdk ohim=REBIN(ohim,128,128) ohdk=REBIN(ohdk,128,128) IF KEYWORD_SET(smoothed) THEN BEGIN ohim=MEDIAN(ohim,3) ohdk=MEDIAN(ohdk,3) ENDIF ohsets(i*128,0,j)=(ohim-ohdk)>0 bgim=REBIN(bgim,128,128) bgdk=REBIN(bgdk,128,128) IF KEYWORD_SET(smoothed) THEN BEGIN bgim=MEDIAN(bgim,3) bgdk=MEDIAN(bgdk,3) ENDIF bgsets(i*128,0,j)=(bgim-bgdk)>0 ENDFOR PRINT,j,FORMAT='(I3,$)' IF ((j+1) MOD 25 EQ 0) OR (j EQ n-1) THEN PRINT,'' ENDFOR t1=SYSTIME(1) PRINT,(t1-t0)/n $ ,FORMAT='("Average time to process one image pair = ",F4.1," seconds")' f=[0.08,0.092] WINDOW,2,XSIZE=256,YSIZE=140 resp='' PRINT,'Getting ready to show a movie...' !ORDER=1 timefield=BYTARR(128,12) REPEAT BEGIN PRINT,'Do you want a colour display (Y/[N]; default is greyscale)' READ,resp IF STRUPCASE(resp) EQ 'Y' THEN loadct,13 ELSE loadct,0 PRINT,'Enter background subtraction factors' READ,f PRINT,'Enter a ceiling DN level to display, if desired' READ,resp flag=isnumber(resp,ceiling) IF ceiling EQ 0 THEN ceiling=255 delay=0.5 PRINT,"S for slower, F for faster, Q to quit." go_on=1 j = 0 WHILE go_on DO CASE STRUPCASE(GET_KBRD(0)) OF '': BEGIN go_on=1 TV,BYTSCL(ohsets(0:127,*,j)-f(0)*bgsets(0:127,*,j) $ ,MIN=0,MAX=ceiling,TOP=!D.N_COLORS-1),0,0 TV,timefield,0,128 XYOUTS,64,129,itime(0,j),/DEVICE,ALIGNMENT=0.5 TV,BYTSCL(ohsets(128:255,*,j)-f(1)*bgsets(128:255,*,j) $ ,MIN=0,MAX=ceiling,TOP=!D.N_COLORS-1),128,0 TV,timefield,128,128 XYOUTS,192,129,itime(1,j),/DEVICE,ALIGNMENT=0.5 WAIT,delay j=j+1 IF j EQ n THEN j=0 ENDCASE 'S': delay=delay*1.5 'F': delay=delay/1.5 'Q': go_on=0 ELSE: ENDCASE PRINT,'Try other factors? (Y/[N])' READ,resp ENDREP UNTIL STRUPCASE(resp) NE 'Y' STOP RETURN END