Re: Satellite Image "noise" reduction

From: Paul Scorer <paul.scorer01_at_nyahnyahspammersnyahnyah>
Date: Thu Apr 12 2012 - 15:46:18 MDT

I have had some success in another application using a simple "low pass
filter" applied in 2 directions. Choice of filter coefficients is an
endless game ... I do not comment further.

Maybe this will be worth a try:
[code]
; Spatially filter the data
; Here you can choose your filter :-)
; Only FIR filters supported
; N_coeffs should be odd, to avoid shift

; Filter coeffs in increasing "severity"
; wgt = (/ 1, 1, 1, 1, 1/) ; Simple (1/n, 1/n, ... ) filter
; wgt = (/1, 2, 1/)
; wgt = (/1., 4., 6., 4., 1 /)
wgt = (/1., 6., 15., 20., 15., 6., 1. /)

; Ensure coeffs sum to 1.0 to avoid scale change
wgt = wgt / sum(wgt)

; Filter Horizontally
; data = wgt_runave(data, wgt, -1) ; Cyclic conditions
data = wgt_runave(data, wgt, 0) ; Unsmoothed beginning and end pts to FillValue
; data = wgt_runave(data, wgt, 1) ; Reflective (symmetric) conditions

; Transpose array
data!0 = "x"
data!1 = "y"
data = data(y|:, x|:)

; Filter transposed array (i.e. vertically)
data = wgt_runave(data, wgt, 0)

; Transpose back again
data!0 = "x_T"
data!1 = "y_T"
data = data(y_T|:, x_T|:)

; data is now "LP filtered"
[/code]

HTH

PaulS

On Thu, 2012-04-12 at 07:31 -0600, Dennis Shea wrote:
> There is no "morphological close" function in NCL.
>
> The poisson_grid_fill function could be used. It performs well
> in bounded areas (eg, satellite swath interior regions). However, there
> are often missing values or values of low quality at the boundaries that
> one should not use (set to _FillValue). The poisson_grid_fill
> function will also 'fill' these points. This is extrapolation and
> extrapolation is always dangerous and any values should be used
> with caution.... or, better, ignored.
>
>
> ==
>
> In NCL, use the 'stat_dispersion' function
> to examine satellite data Turn the printing option on.
>
> http://www.ncl.ucar.edu/Document/Functions/Contributed/stat_dispersion.shtml
>
> Looking at the output, you could set some bounds on acceptable values.
> Generally, satellite swath data should be prefiltered for outliers.
> A crude 'filter'
>
> xBIG = ...
> xSMALL = ...
> x = where (x.lt.xSMALL .or x.gt.xBIG, x@_FillValue, x)
>
>
> http://www.ncl.ucar.edu/Document/Functions/Built-in/poisson_grid_fill.shtml
> http://www.ncl.ucar.edu/Applications/grid_fill.shtml
>
> Then, smoothing the data via (say) smth9 (repeatedly)
> will reduce the noise.
>
> No matter what ... if boundary points are missing, you'
> will have issues.
>
> http://www.cgd.ucar.edu/~shea/JAKOB_TEST.png
> See attached script as an example. The data are not satellite data
> but you will get the idea.
>
> Good luck
>
>
> On 4/11/12 8:53 AM, Jakob Tendel wrote:
> > Hello,
> >
> > I am working on an application that combines model data fields with
> > satellite products. My problem is that the sat fields are very noisy,
> > with lots of small specks of data. I need to smoothe/filter those out to
> > get the larger contiguous areas that I can compare to the model data.
> > Does anyone know of a way to "remove all areas with fewer than x
> > pixels". I was thinking of something like a morphological close
> > operation, but I don't think that exists in ncl.
> >
> > Thanks for any hints,
> >
> > Jakob
> >
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Apr 12 15:46:36 2012

This archive was generated by hypermail 2.1.8 : Fri Apr 13 2012 - 13:37:52 MDT