[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

histogram question



Folks,
I am sure this problem must have an elegant solution
that is not obvious to me:

I have an array X. I need to make a histogram and throw away elements
of the array with a high count rate, say with count rate above 5 times
median count rate.
Brute force way is ugly and inefficient when array is not small:

plothist,X,xhist,yhist
bad=xhist[where(yhist gt 5*median(yhist),count)]
if count ne 0 then begin
   for ind=0,count-1 do begin
      X=X[where(X ne bad[ind])]
   endfor
endif


Any suggestions?


Gregory