pro violets2 ; 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 average of every n violets. 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 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+'/violets.out' Print,'*** Outputing data to file: ',cdir+'~/violets.out' printf,1,'' printf,1,'Violet # Time (min) Temperature Type Reading' printf,1,'' ;______________________________________________________________ ;Read in data and print to file, also keep sum for averaging... for i=0,(nfiles-1)/n 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 time=d_value(h,88) temp=d_value(h,132) type=mtype(files(i*n+j)) if type eq 6 then typ='DLV' else typ='ULV' 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 if nfiles lt 100 then spwan,'more ~/violets.out' else $ print,nfiles,' violets printed in ~/violets.out' cd,cdir end