; PLOTCALS.PRO ; Get name of calibration results file to plot PRINT,'Enter calibration results file name' fname='' READ,fname ; get camera and filter numbers cam=FIX(STRMID(fname,1,1)) filt=FIX(STRMID(fname,3,1)) ; open file OPENR,unit,fname,/GET_LUN ; define data structures to be filled with input data inline='' texp=0 meanct=0.0 sdct=0.0 tccd=0.0 text=0.0 js=0L REPEAT BEGIN ; read a line from the file and fill the data structures READF,unit,inline cname=getwrd(inline,0) texp=[texp,FIX(STRMID(cname,STRLEN(cname)-7,3))] meanct=[meanct,FLOAT(getwrd(inline,1))] sdct=[sdct,FLOAT(getwrd(inline,2))] tccd=[tccd,FLOAT(getwrd(inline,3))] text=[text,FLOAT(getwrd(inline,4))] js=[js,LONG(getwrd(inline,5))] ; until the last line has been read ENDREP UNTIL EOF(unit) ; close the file CLOSE,unit & FREE_LUN,unit ; drop the empty (place-holding) elements from the front texp=texp(1:*) meanct=meanct(1:*) sdct=sdct(1:*) tccd=tccd(1:*) text=text(1:*) js=js(1:*)/86400.+1. ; express time in day number of year ; what month are we in? IF MAX(js) LT 32 THEN maintitle='Field Calibration Data, January 1993' $ ELSE maintitle='Field Calibration Data, February 1993' ; complete main title maintitle=maintitle+STRING(cam,filt, $ FORMAT='(" (Camera ",I1,", Filter ",I1,")")') ; locate the 60-s, 10-s, and 1-s images w60=WHERE(texp EQ 60,n60) w10=WHERE(texp EQ 10,n10) w1=WHERE(texp EQ 1,n1) nn=[n1,n10,n60] ww=LONARR(MAX(nn),3) ww(0,0)=w60 ww(0,1)=w10 ww(0,2)=w1 ; Print out statistics for various exposure times sd60=stdev(meanct(w60),m60) PRINT,m60,sd60, $ FORMAT='("60-s exposures: ",F6.0," DN +/- ",F4.0," DN")' sd10=stdev(meanct(w10),m10) PRINT,m10,sd10, $ FORMAT='("10-s exposures: ",F6.0," DN +/- ",F4.0," DN")' sd1=stdev(meanct(w1),m1) PRINT,m1,sd1, $ FORMAT='(" 1-s exposures: ",F6.1," DN +/- ",F4.1," DN")' ; decide what data to plot out i0=0 ; index of first row of ww to plot IF m60 GT 16127. THEN i0=1 IF m10 GT 16127. THEN i0=2 ; plot out the data xp=!X.MARGIN(0)*!D.X_CH_SIZE/FLOAT(!D.X_SIZE) yp=1-!Y.MARGIN(1)*!D.Y_CH_SIZE/FLOAT(!D.Y_SIZE) syms=[-2,-4,-5] PLOT,js(ww(*,i0)),meanct(ww(*,i0)),PSYM=syms(i0),XTITLE='Day Number of 1993', $ YTITLE='DN (MPP, gain 4, dark-subtracted)', $ TITLE=maintitle,POSITION=[[xp,.45],[yp,yp]],/YNOZERO, $ YRANGE=[MIN(meanct(ww(*,i0:*))-sdct(ww(*,i0:*))),MAX(meanct(ww(*,i0:*))+sdct(ww(*,i0:*)))] IF i0 LT 2 THEN FOR i=i0+1,2 DO $ OPLOT,js(ww(0:nn(i)-1,i)),meanct(ww(0:nn(i)-1,i)),PSYM=syms(i) FOR i=i0,2 DO FOR j=0,nn(i)-1 DO BEGIN xx=js(ww(j,i)) yy=meanct(ww(j,i)) zz=sdct(ww(j,i)) PLOTS,[xx,xx],[yy-zz,yy+zz] ENDFOR items=['60-s exposures','10-s exposures','1-s exposures'] items=items(i0:2) psym=-syms(i0:2) legend,items,psym=psym,position=[xp,yp] PLOT,js(w60),tccd(w60),XTITLE='Day Number of 1993', $ YTITLE='Temperature (!9%!XC)',TITLE=maintitle, $ POSITION=[[xp,.07],[yp,.34]],/NOERASE,YRANGE=[-50,0] OPLOT,js(w60),text(w60),LINESTYLE=1 maxccd=MAX(tccd,loc) ccdmaxtim=js(loc) XYOUTS,ccdmaxtim,maxccd+1,'CCD',ALIGNMENT=0.5 minext=MIN(text,loc) extmintim=js(loc) XYOUTS,extmintim,minext-6,'EXT',ALIGNMENT=0.5 END