PRO plot_tlog,year,month,day,camera ; ; Look for specified temperature log file ; If found, open it and read the contents ; Prompt the user for the temperature data to plot ; Set up the plot window ; Plot the data ; infile=STRING(year,month,day,camera, $ FORMAT='("/jasper/cnsr3_data1/tlog/tlog.",3I2.2,".",I1)') dummy=FINDFILE(infile,COUNT=num) ; IF num GT 0 THEN BEGIN OPENR,unit,infile,/GET_LUN dummy='' FOR i=0,1 DO READF,unit,dummy ; inline=FLTARR(22) nlines=0 REPEAT BEGIN READF,unit,inline nlines=nlines+1 IF nlines GT 1 THEN indata=[indata,TRANSPOSE(inline)] $ ELSE indata=TRANSPOSE(inline) ENDREP UNTIL EOF(unit) indata=TRANSPOSE(indata) ; this array looks like the input file CLOSE,unit & FREE_LUN,unit ; ut=((indata(5,*)/60.)+indata(4,*))/60.+indata(3,*) mindelt=MIN(ABS(ut-SHIFT(ut,1))) ; min interval between images utinterp=ut(0)+mindelt*FINDGEN((ut(nlines-1)-ut(0))/mindelt+1) filtei=SMOOTH(SPLINE(ut,indata(11,*),utinterp),10./(60*mindelt)) ; again=1 REPEAT BEGIN PRINT,'Enter the numbers of the temperatures/statuses you wish to plot:' PRINT,'0 Filter wheel temperature 3 External temperature' PRINT,'1 Internal temperature 4 CCD temperature' PRINT,'2 Dome temperature 5 Heater status' instring='' READ,instring ; nvals=nwrds(instring) outdata=FLTARR(1,nlines) heaterflag=0 curves=0 FOR i=0,nvals-1 DO BEGIN val=getwrd(instring,i) f=isnumber(val,n) IF f NE 0 THEN BEGIN IF ABS(n) GT 5 THEN RETURN start=6+3*ABS(n) IF ABS(n) LT 5 THEN BEGIN outdata=[outdata,indata(start,*)] curves=[curves,ABS(n)] ENDIF ELSE heaterflag=1 ENDIF ENDFOR outdata=outdata(1:*,*) curves=curves(1:*) ; utrange=[MIN(ut,MAX=utmax),utmax] temprange=[MIN(outdata,MAX=odmax),odmax] IF heaterflag EQ 1 THEN outdata=[outdata,indata(start,*)] PRINT,'Available times span '+STRTRIM(utrange(0),2)+' - '+ $ STRTRIM(utrange(1),2)+' UT;' PRINT,'Enter time range to plot' READ,utrange PRINT,'Available temperatures span '+STRTRIM(temprange(0),2)+ $ ' - '+STRTRIM(temprange(1),2)+' C;' PRINT,'Enter temperature range to plot' READ,temprange ; ; plot dat and error bars, distinguishing heater status from temperatures ; sym=[1,3,4,5,6] label=['T!ifw!n','T!iint!n','T!idome!n','T!iext!n','T!iCCD!n'] offset=(MAX(temprange,MIN=tmin)-tmin)/20. PLOT,utrange,temprange,XRANGE=utrange,YRANGE=temprange,/NODATA, $ XTITLE='Universal Time (hours)',YTITLE='Temperature (!9%!X C)', $ XSTYLE=1,YSTYLE=1,TITLE=STRING(year,month,day,camera, $ FORMAT='("Polar Camera Temperatures, ",2(I2.2,"/"),I2.2,", Camera ",I1)') FOR i=0,N_ELEMENTS(curves)-1 DO BEGIN j=8+curves(i)*3 OPLOT,ut,indata(j,*),PSYM=sym(curves(i)) XYOUTS,ut(0),TOTAL(indata(j,*))/nlines+offset,label(curves(i)), $ ALIGNMENT=0.0,CHARSIZE=2.0 IF j EQ 11 THEN OPLOT,utinterp,filtei ENDFOR IF heaterflag THEN BEGIN IF (!Y.CRANGE(0) LT 10) AND (10 LT !Y.CRANGE(1)) $ THEN base=10 ELSE base=!Y.CRANGE(1)-2 OPLOT,ut,base+indata(21,*),PSYM=10 XYOUTS,ut(0),base+1.5,'Heater',ALIGNMENT=0.0 ENDIF ; PRINT,'Do you want to plot some of the data again? (1=yes,0=no)' READ,again ENDREP UNTIL again EQ 0 ; ; done ; ENDIF ELSE PRINT,'File not found - returning' RETURN END