pro heaters,log ; This program prints and plots the data from the heater test datasets. ; log is the testlog of interest, the default is the current log. ; The heater test samples every 15 seconds for 2 minutes ; The data is in the pixel portion of the file in two rows, p=intarr(10,2) ; P(0,0) is 1, P(0,1) is 2, P(1:9,0) is the strap data, P(1:9,1) is the aux brd data ;______________________________________________________________ ;Setup and initilization... cd,'',current=cdir & cd,cdir ;establishes cdir as current directory if n_params() eq 0 then log = cdir ;test for # of input parameters label='' print,'Enter label text which discribes this test log: '+log read,label print,'Log = ',log print,'Today is: ',systime(0) hardcopy=0 ;the default is output to the screen again: cd,log+'/DB/HeatTest' files=findfile('*', count = nfiles) ;The F1 data is used for comparison... f1data=fltarr(10,2) f1data(*,0)=[1,263.77975,265.36920,267.05798,268.54807,269.74014,270.93225,271.82629,272.72037,273.61441] f1data(*,1)=[2,285.03851,285.03851,285.43588,285.83322,286.42926,286.92596,287.62134,288.11804,288.81342] time=[0,.25,.5,.75,1.,1.25,1.5,1.75,2.] ;These are the times when the thermistors are read, in minutes. ;______________________________________________________________ ;Read in the data... ; p is an intarr(10,2) containing the strap and aux board data. for i=0,nfiles-1 do begin d_read,files(i),h,p ;stop Date=strmid(d_value(h,15),4,21) ;date and time ;Data converted from DN to deg K... data=fltarr(10,2) data(0,0)=1 & data(0,1)=2 data(1:9,*)=0.09934*p(1:9,*)+23.973 ;conversion from DN to deg K if hardcopy eq 1 then goto,plot ;______________________________________________________________ ;Print out the data... print,'Test: '+label+' # ',sstr(i+1),' Date: ',date print,' 1 is Strap TC data, 2 is Aux. Board TC data...',string(10b) print,'Raw Data:' print,p print,'' print,'Converted Data:' print,data, format='(i8,9f8.2)' print,'' ;rate1 is the CCD rate... fpheat=4.91733 ;the standard strap heater rate from F1 rate1= 0.09934*(p(9,0)-p(1,0))/2 ; Scale factor = 0.09934 deg/dn, (DISR 03) print,rate1,format='("Focal Plane Heater Rate:",T30,f7.3," deg/min")' print,fpheat,format='("Typical FP Heater Rate:",T30,f7.3," deg/min")' print,100*(rate1-fpheat)/fpheat,format='("Difference:",T30,f7.3," %",/)' ;rate2 is the aux board rate... auxheat=1.88746 ;the standard aux. board heater rate from F1 rate2= 0.09934*(p(9,1)-p(1,1))/2 ; Scale factor = 0.09934 deg/dn, (DISR 03) print,rate2,format='("Aux Board Heater Rate:",T30,f7.3," deg/min")' print,auxheat,format='("Typical Aux Board Rate:",T30,f7.3," deg/min")' print,100*(rate2-auxheat)/auxheat,format='("Difference:",T30,f7.3," %",/)' ;______________________________________________________________ ;Plot the data... plot: ymax=max(data(1:9,0)-data(1,0)) if i eq 0 then plot,time,data(1:9,0)-data(1,0),title='Strap Heater from '+sstr(log),$ xtitle='Minutes', ytitle='Temp. Rise (C)',xrange=[0,2],yrange=[0,ymax] $ else oplot,time,data(1:9,0)-data(1,0),linestyle=i ; add a legend entry... ypos=0.4+(i+1)*0.4 ;y position of legend entry xyouts,1.35,ypos,label+' ('+sstr(i)+')' ;label (i) is used to identify data oplot,[1.0,1.3],[ypos,ypos],linestyle=i ;overplot the f1 data... oplot,time,f1data(1:9,0)-f1data(1,0),linestyle=4 xyouts,1.35,.4,'F1 Data' oplot,[1.0,1.3],[0.4,0.4],linestyle=4 ans='' if hardcopy eq 0 then read,'Hit Return to Continue',ans ymax=max(data(1:9,1)-data(1,1)) if i eq 0 then plot,time,data(1:9,1)-data(1,1),title='Aux. Board Heater from '+sstr(log),$ xtitle='Minutes', ytitle='Temp. Rise (C)',xrange=[0,2],yrange=[0,ymax] $ else oplot,time,data(1:9,1)-data(1,1),linestyle=i ; add a legend entry... ypos=0.2+(i+1)*0.2 ;y position of legend entry xyouts,1.35,ypos,label+' ('+sstr(i)+')' ;label (i) is used to identify data oplot,[1.0,1.3],[ypos,ypos],linestyle=i endfor ;overplot the f1 data... oplot,time,f1data(1:9,1)-f1data(1,1),linestyle=4 ;xyouts,1.35,f1data(9,1)-f1data(1,1),'F1 Data' xyouts,1.35,.2,'F1 Data' oplot,[1.0,1.3],[0.2,0.2],linestyle=4 cd,cdir ;stop ;______________________________________________________________ ;Output Data to File... ans='' if hardcopy eq 0 then read,'Do you want to create an output file? (y or n): ',ans if ans ne 'y' then goto,printing close,5 openw,5,log+'/heaters.out' printf,5,'This is the heater data from: ',log printf,5,'Today is: ',systime(0),string(10b) printf,5,' Time Strap Aux. Board' for i=1,9 do printf,5,time(i-1),data(i,0),data(i,1),format='(3f10.2) close,5 printing: ;______________________________________________________________ ; Printing the plots... ans='' if hardcopy eq 0 then read,'Do you want to print the plots? (y or n): ',ans if ans eq 'y' then begin set_plot,'ps' device,filename = '~/idl.ps',/palatino,/landscape !p.font=0 ;device fonts hardcopy=1 goto,again endif if hardcopy eq 1 then begin device,/close_file spawn,'lp ~/idl.ps' set_plot,'x' ;returns to X windows environment !p.font=-1 ;vector drawn fonts (default) endif close,/all !p.font=-1 ;vector drawn fonts (default) set_plot,'x' ;returns to X windows environment end