pro histogram ; This program plots the histograms for all the files in the current ; directory. It waits 3 seconds between plots. ; spawn files ; find size ; loop i ; read file ; find histogram ; plot ; next i spawn,'lsf',files,/noshell fs=size(files) nfiles=fs(3) pmax=fltarr(nfiles) pmin=fltarr(nfiles) ave=fltarr(nfiles) pmed=fltarr(nfiles) for i=0,nfiles-1 do begin d_read,files(i),h,p ; shutter=d_value(h,H_CAL_SHUT) ; if shutter='open' then go to endfor ; px=max(p) ; pmax(i)=px ; pn=min(p) ; pmin(i)=pn ; tp=total(p) ; sp=size(p) ; ave(i)=tp/sp(4) ; pmed(i)=median(p) a=histogram(p) plot, a, xtitle='Counts', ytitle='Occurrences', Title='Histogram of file #'+sstr(i) wait, 3 endfor end