Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado
Well, you could replace all of your -9999 values with the not-a- number !values.f_nan (called NaN), and then selectively replace each NaN using mean(w,/nan) in windows whose indices are specified by w. (When nan is set in the mean function, any array elements with an NaN are skipped.) How big the window must be depends on how closely spaced the -9999 values are, and how much averaging you wish to do. There may be "canned" routines that will do the entire job for you, but I don't know of any myself. Ed Schmahl d.po...@gmail.com wrote: > Folks > I have a problem. I have an image with some -9999 data I want to > replace these pixels by average of four neighbours. Any help? How come > do this if -9999s are in the edges? > Cheers
Thank you very much. Cheers On Mar 11, 6:09 pm, ed.schm...@gmail.com wrote: > Well, you could replace all of your -9999 values with the not-a- > number !values.f_nan (called NaN), and then selectively replace each > NaN using mean(w,/nan) in windows whose indices are specified by w. > (When nan is set in the mean function, any array elements with an NaN > are skipped.) How big the window must be depends on how closely spaced > the -9999 values are, and how much averaging you wish to do. > > There may be "canned" routines that will do the entire job for you, > but I don't know of any myself. > > Ed Schmahl > > d.po...@gmail.com wrote: >> Folks >> I have a problem. I have an image with some -9999 data I want to >> replace these pixels by average of four neighbours. Any help? How come >> do this if -9999s are in the edges? >> Cheers