[GRASSLIST:7636] r.statistics method=variance gives NAN

Hello,

when using r.statistics with method "variance" I receive NAN as output values,
however if I use "average" or "stddev" the ouput looks reasonable.

I tried it with GRASS 6.1-cvs a few weeks ago and GRASS 6.0 from the debian
repository but both produced the same result.

Any idea what the problem might be?

r.statistics base=loc_july05 cover=topo_resample method=variance
output=test.var

thanks in advance, Martin

--
Martin Wegmann

DLR - German Aerospace Center
German Remote Sensing Data Center
@
Dept.of Geography
Remote Sensing and Biodiversity Unit
University of Wuerzburg
Am Hubland
97074 Würzburg

phone: +49-(0)931 - 888 4797
fax: +49-(0)931 - 888 4961
http://www.biota-africa.org
http://www.biogis.de

Martin Wegmann wrote:

when using r.statistics with method "variance" I receive NAN as output values,
however if I use "average" or "stddev" the ouput looks reasonable.

I tried it with GRASS 6.1-cvs a few weeks ago and GRASS 6.0 from the debian
repository but both produced the same result.

Any idea what the problem might be?

The m_var() function fails to initialise the local variable "s".

Fixed in CVS, or apply the attached patch.

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

(attachments)

r.statistics.diff (283 Bytes)

On Fri, Jul 22, 2005 at 06:12:15AM +0100, Glynn Clements wrote:
Content-Description: message body and .signature

Martin Wegmann wrote:

> when using r.statistics with method "variance" I receive NAN as output values,
> however if I use "average" or "stddev" the ouput looks reasonable.
>
> I tried it with GRASS 6.1-cvs a few weeks ago and GRASS 6.0 from the debian
> repository but both produced the same result.
>
> Any idea what the problem might be?

The m_var() function fails to initialise the local variable "s".

Fixed in CVS, or apply the attached patch.

I have also fixed it in 6.0-CVS (for 6.0.1).

Markus

thanks!

regards, Martin

On Friday 22 July 2005 07:12, you wrote:

Martin Wegmann wrote:
> when using r.statistics with method "variance" I receive NAN as output
> values, however if I use "average" or "stddev" the ouput looks
> reasonable.
>
> I tried it with GRASS 6.1-cvs a few weeks ago and GRASS 6.0 from the
> debian repository but both produced the same result.
>
> Any idea what the problem might be?

The m_var() function fails to initialise the local variable "s".

Fixed in CVS, or apply the attached patch.

--
Martin Wegmann

DLR - German Aerospace Center
German Remote Sensing Data Center
@
Dept.of Geography
Remote Sensing and Biodiversity Unit
&&
Dept. of Animal Ecology and Tropical Biology
University of Wuerzburg
Am Hubland
97074 Würzburg

phone: +49-(0)931 - 888 4797
fax: +49-(0)931 - 888 4961
http://www.biota-africa.org
http://www.biogis.de