The cleat start for solving this program is to invoke IDL's WHERE function, as in:
outlyingDataSubscripts = where(bandData gt 0.8, nOutliers)
This returns in 'outlyingDataSubscripts' the indexes of all 'bandData' elements that have value greater than 0.8. It returns in 'nOutliers' the number of elements that were returned by WHERE. Syntax like the following:
bandData[outlyingDataSubscripts] = myReplacementValue
is the way you could assign one constant replacement value to all the elements in 'bandData' that are currently greater than 0.8..
If you want to modify each element returned by WHERE with a function based on the neighbors in all directions around the WHERE elements, then you will also want to study the function ARRAY_INDICES. WHERE, namely, returns just the one-dimensional subscript into 'bandData' (as it the programmer had reformed 'bandData' into one long vector array). ARRAY_INDICES can be used to give you back the 2D subsciript that maps to the 1D value returned by WHERE.
James Jones
|