[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: filtering problem
Once again thanks for the help.
However, life is not quite as simple as I imagined. Previously I said :
>In detail: 'the algorithm should correct the pixel value by a
>multiplicative factor found by dividing the global mean by the window
>A further problem is I want the ability to set a threshold where data
>below the threshold are not included in the statistics and not corrected
>by the algorithm.
I have later found that this is not entirely correct.
Although any value below the thershold should not be included in the
statistics, pixels below the threshold should be corrected by the algorithm.
Therefore is it possible to change the code:
pro thresh, a, n, t
m = a ge t
wh = where(m,cnt)
if cnt eq 0 then return
a[wh] = a[wh] * mean(a[wh]) * (smooth(float(m),n,/EDGE) / $
to allow this.
After scratching my head for a while I can't think of a simple solution without
going back to my clunky method where I manually scan through the data and
threshold the window each time. There must be a better way!!
Any help would be greatly appreciated!!