pro violets3 ; csee, created 29 Oct 1998, last modified 7/14/00 ; This program prints a list of the violet measurements in the current ; directory to the file ~/violets.out. It is to be run from the test log. ; This version also prints out the header information. ;;n=10 ;default to average of each 10 points ;;;Read,'How many sets do you want to average together?: ',n ;;Print,'OK, n= ',sstr(n),' Please wait...' ;_____________________________ ;Input files... cd,'', current=cdir & cd,cdir DB="DB" cd,cdir+'\'+DB+'\Violet' ;files=findfile('*',count=nfiles) files=t_getfil('*.*') & siz=size(files) & nfiles=siz(1) ;for lots of files ;_____________________________ ;Output file... openw,1,cdir+'\violets3_'+DB+'.out' Print,'*** Outputing data to file: ',cdir+'~\violets3'+DB+'.out' printf,1,'Violet Data from: ', cdir+'\'+DB printf,1,'Vio# Seq# Cyc. Time (s) Type Time(min) DN Alt(km) Az. Lamps Tv Tea Tstrap Toptics Taux I_therm 12VDC 5VDC DispQ AlarmQ TlmQ SciProQ Stack' printf,1,'' ;______________________________________________________________ ;Read in data and print to file, also keep sum for averaging... for i=0,(nfiles-1) do begin ;;sum=0L ;;for j=0,n-1 do begin ;;if i*n+j eq nfiles then goto,exit ;;d_read,files(i*n+j),h,p d_read,files(i),h,p seq=d_value(h,87) cycle=d_value(h,89) time=d_value(h,88) type=mtype(files(i)) if type eq 6 then typ='DLV' else typ='ULV' alt=d_value(h,98) ;altitude in meters act_az=d_value(h,101) ;reported actual azimuth lamps=d_value(h,102) Vtemp=d_value(h,132) ;Violet Temperature EAtemp=d_value(h,134) StrapTemp=d_value(h,130) OpticsTemp=d_value(h,131) AuxTemp=d_value(h,133) temp_I=d_value(h,128) ;current through temperature sensor V12=d_value(h,136) V5=d_value(h,137) DispQ=d_value(h,140) AlarmQ=d_value(h,141) TlmQ=d_value(h,142) SciProQ=d_value(h,143) Stack=d_value(h,144) printf,1,i,seq,cycle,time,typ,time/60,p,alt/1000.,act_az,lamps,Vtemp,EAtemp,StrapTemp,OpticsTemp,AuxTemp,$ temp_I,V12,V5,DispQ,AlarmQ,TlmQ,SciProQ,Stack,format='(i5,i5,i5,f10.3,2x,a4,f9.3,i6,f10.3,f8.2,3x,a4,5F9.3,F10.6,F9.4,F9.5,4i6,i8)' ;;printf,1,i*n+j,time/60,temp,' ',typ,p ;;sum=sum+p ;;endfor ;;exit: ;;printf,1,'Average= ',sstr(float(sum)/j),' n= ',sstr(j) endfor close,/all print,'Done!' cd,cdir end