; TELE520.PRO ; ; DPS, 20 August 1992 ; wavelength=627.0 & filename='' ; read file of wavelengths, common to both zenith angles OPENR,unit,'wl.520',/GET_LUN READF,unit,nw w=FLTARR(nw) FOR i=0,nw-1 DO BEGIN READF,unit,wavelength w(i)=wavelength ENDFOR CLOSE,unit & FREE_LUN,unit ; read file of image file names for 0 deg z.a. images OPENR,unit,'lite0',/GET_LUN READF,unit,n0 IF (n0 NE nw) THEN BEGIN PRINT,STRING(n0,nw, $ FORMAT='(I2," images at 0 deg doesn''t match ",I2," wavelengths!")') STOP ENDIF za0f=STRARR(n0) FOR i=0,n0-1 DO BEGIN READF,unit,filename za0f(i)=STRCOMPRESS(filename,/REM) ENDFOR CLOSE,unit & FREE_LUN,unit ; read file of image file names for 57 deg z.a. images OPENR,unit,'lite57',/GET_LUN READF,unit,n57 IF (n57 NE nw) THEN BEGIN PRINT,STRING(n57,nw, $ FORMAT='(I2," images at 57 deg doesn''t match ",I2," wavelengths!")') STOP ENDIF za57f=STRARR(n57) FOR i=0,n57-1 DO BEGIN READF,unit,filename za57f(i)=STRCOMPRESS(filename,/REM) ENDFOR CLOSE,unit & FREE_LUN,unit ; read file of image file names for 0 deg z.a. dark frames OPENR,unit,'dark0',/GET_LUN READF,unit,nd0 za0d=STRARR(nd0) FOR i=0,nd0-1 DO BEGIN READF,unit,filename za0d(i)=STRCOMPRESS(filename,/REM) ENDFOR CLOSE,unit & FREE_LUN,unit ; read file of image file names for 57 deg z.a. dark frames OPENR,unit,'dark57',/GET_LUN READF,unit,nd57 za57d=STRARR(nd57) FOR i=0,nd57-1 DO BEGIN READF,unit,filename za57d(i)=STRCOMPRESS(filename,/REM) ENDFOR CLOSE,unit & FREE_LUN,unit ; read file of pixels showing illuminated screen at 0 deg z.a. OPENR,1,'mask0.dat' & READF,1,nm0 & wm0=INTARR(nm0) READF,1,wm0 & CLOSE,1 ; read file of pixels showing illuminated screen at 57 deg z.a. OPENR,1,'mask57.dat' & READF,1,nm57 & wm57=INTARR(nm57) READF,1,wm57 & CLOSE,1 ; define minimum (i.e., spikefree) dark frame for 0 deg z.a. FOR i=0,nd0-1 DO BEGIN rdkimg,za0d(i),h,dkf IF (i EQ 0) THEN dk0=dkf $ ELSE BEGIN wl=WHERE(dkf LT dk0) dk0(wl)=dkf(wl) ENDELSE ENDFOR ; define minimum (i.e., spikefree) dark frame for 0 deg z.a. FOR i=0,nd57-1 DO BEGIN rdkimg,za57d(i),h,dkf IF (i EQ 0) THEN dk57=dkf $ ELSE BEGIN wl=WHERE(dkf LT dk57) dk57(wl)=dkf(wl) ENDELSE ENDFOR ; calculate mean and standard deviation of screen brightnesses versus ; wavelength at 0 deg z.a. m0=FLTARR(n0) & sd0=m0 FOR i=0,n0-1 DO BEGIN rdkimg,za0f(i),h,im0 im0=im0-dk0 m0(i)=TOTAL(im0(wm0))/N_ELEMENTS(wm0) sd0(i)=STDEV(im0(wm0)) ENDFOR ; calculate mean and standard deviation of screen brightnesses versus ; wavelength at 57 deg z.a. m57=FLTARR(n57) & sd57=m57 FOR i=0,n57-1 DO BEGIN rdkimg,za57f(i),h,im57 im57=im57-dk57 m57(i)=TOTAL(im57(wm57))/N_ELEMENTS(wm57) sd57(i)=STDEV(im57(wm57)) ENDFOR OPENW,7,'signal.za' out=[TRANSPOSE(w),TRANSPOSE(m0),TRANSPOSE(sd0),TRANSPOSE(m57), $ TRANSPOSE(sd57)] PRINTF,7,5,nw PRINTF,7,out CLOSE,7 PRINT,'Enter the nominal center wavelength (nm) of the filter' READ,ncw PRINT,STRING(MIN(w,MAX=wmx),wmx, $ FORMAT='("Data span wavelengths from ",F5.1," nm to ",F5.1," nm;")') PRINT,'Enter limits for wavelength axis' READ,wlo,whi !p.title="Passband of 520 nm Filter in PoCa Optics Module" !x.title="Wavelength ( nm )" !y.title="Average Signal from Center of Illuminated Screen ( DN )" PLOT,w,m0,XRANGE=[wlo,whi],YRANGE=[0,MAX([m0+sd0,m57+sd57])],XSTYLE=1 ERRPLOT,w,m0-sd0,m0+sd0 OPLOT,w,m57,line=2 ERRPLOT,w,m57-sd57,m57+sd57 top=!Y.CRANGE(1) wrange=whi-wlo PLOTS,[wlo+0.05*wrange,wlo+0.10*wrange],[0.95*top,0.95*top] XYOUTS,wlo+0.12*wrange,0.95*top,'0 !9%!x zenith angle' PLOTS,[wlo+0.05*wrange,wlo+0.1*wrange],[0.9*top,0.9*top],linestyle=2 XYOUTS,wlo+0.12*wrange,0.9*top,'57 !9%!x zenith angle' ; pbold=FINDFILE('/wesson/user/steele/PAC/filter/calib/*/*.spl',COUNT=nold) PRINT,'You can overplot one of the following old passband curves for comparison:' FOR i=0,nold-1 DO PRINT,STRING(i,pbold(i),FORMAT='(I1,2X,A)') rfilter,wold,sold nsold=sold*(MAX(m0)/MAX(sold)) OPLOT,wold,nsold,PSYM=4 PLOTS,[wlo+0.05*wrange,wlo+0.10*wrange],[0.85*top,0.85*top],PSYM=4 XYOUTS,wlo+0.12*wrange,0.85*top,'0 !9%!x z. a. (old)' END