[GRASS-dev] v.cellstats script [+new module: r.out.xyz]

Glynn Clements glynn at gclements.plus.com
Tue Nov 21 16:41:32 EST 2006


Martin Wegmann wrote:

> > > how does this script's function differ from the new r.resamp.stats
> > > module?
> >
> > yes it looks the same and it's much faster, but it variance is missing.
> 
> I added in the main.c file of r.resamp.stats these lines to be able to 
> calculate variance and stddev:
> 
> [..]
> 	{c_sum,    w_sum,    "sum",       "sum of values"},
> 	{c_var,    w_var,    "variance",  "variance value"},
> 	{c_stddev, w_stddev, "stddev",    "standard deviation"},
> 	{NULL,     NULL,        NULL}
> [...]
> 
> it seems to work so far - if that is ok, shall I submit it to cvs?

What's the point?

BTW, sum is already there. I added it after it was pointed out that it
might be useful: if the values in the source map are the number of
"items" in each source cell, then the sum aggregate makes sense, as
the result will be the number of "items" in the output cell.

OTOH, I don't really see the point of computing stddev/variance over
the values which happen to fall into a given output cell. That's why I
chose to omit them (and initially to omit sum).

[The original version only included the aggregates which produced a
result which was "representative" of the input values (i.e. those
where, if the input cells all had the same value, the output would be
that value).]

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




More information about the grass-dev mailing list