<div dir="ltr"><div><div><br><br></div>Thank you very much. It is much easy to understand the kernel function options now.<br><br></div>Thanks once again.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Dec 4, 2015 at 1:44 PM, Glynn Clements <span dir="ltr"><<a href="mailto:glynn@gclements.plus.com" target="_blank">glynn@gclements.plus.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><br>
Uttam Kumar wrote:<br>
<br>
> 4.) Which one of the above GRASS commands would be best suited to perform<br>
> window operation (high pass filtering) along with cell padding?<br>
<br>
</span>One caveat to my previous reply:<br>
<br>
Ignoring nulls often doesn't work so well for kernels with a zero sum<br>
(e.g your high-pass filter). You can't use r.neighbors method=average<br>
with weights which sum to zero (as that results in division by zero),<br>
and method=sum introduces a bias if some weights are ignored (at the<br>
edges, you'll have a single cell with a weight of 24 and fewer than 24<br>
cells with a weight of -1, meaning that a constant map would produce a<br>
positive value near the edges).<br>
<br>
I would suggest using two passes, e.g.<br>
<br>
        r.neighbors size=5 method=average input=band5 output=band5_average<br>
        r.mapcalc 'band5_highpassfilter = band5 - band5_average'<br>
        g.remove raster=band5_average<br>
<br>
This returns the value of the centre cell minus the average of the<br>
surrounding non-null cells. The average value is still meaningful if<br>
the filter window overlaps null cells or the edges.<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Glynn Clements <<a href="mailto:glynn@gclements.plus.com">glynn@gclements.plus.com</a>><br>
</font></span></blockquote></div><br></div>