[GRASS-user] About r.neighbors weight usage

Dear list,

i’m trying to use r.neighbors with the weight option along with the sum function;
maibe i do not get how it’s supposed to work…

this is what i’m using:

Neighborhood operation: sum
Neighborhood size: 3

Weight:

0 0 0
-1 0 1
0 0 0

and i get a null result.

This second filter i’ve tested seems to work:

Neighborhood operation: sum
Neighborhood size: 3

Weight:

0 0 0
1 0 1
0 0 0

tested on GRASS 6.4.3 both on windows and ubuntu

thanks,

roy.

m roy wrote:

i'm trying to use r.neighbors with the weight option along with the sum function;
maibe i do not get how it's supposed to work...

this is what i'm using:

Neighborhood operation: sum
Neighborhood size: 3

Weight:

0 0 0
-1 0 1
0 0 0

and i get a null result.

You get a null result if the total number of values is zero. For a
weighted sum, "the total number of values" is the sum of the weights,
which in this case is zero.

I'd suggest that r.mfilter may be more appropriate for implementing
discrete convolution (FIR) filters.

--
Glynn Clements <glynn@gclements.plus.com>

Thanks Glynn!

with r.mfilter.fp i got the expected result,
anyway i find a bit strange it does not works
with r.neighborhood…

From: glynn@gclements.plus.com
Date: Tue, 3 Jun 2014 06:11:44 +0100
To: royroge@outlook.com
CC: grass-user@lists.osgeo.org
Subject: Re: [GRASS-user] About r.neighbors weight usage
You get a null result if the total number of values is zero. For a
weighted sum, “the total number of values” is the sum of the weights,
which in this case is zero.

I’d suggest that r.mfilter may be more appropriate for implementing
discrete convolution (FIR) filters.


Glynn Clements glynn@gclements.plus.com