[GRASS-dev] v.cellstats script [+new module: r.out.xyz]
Glynn Clements
glynn at gclements.plus.com
Thu Nov 23 11:45:43 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).
>
> we wanted to know how much data is lost in a low res. map compared to a high
> res. map hence we are interested in the variance presented inside one low
> res. pixel of various high res. pixel.
>
> well stddev can be omitted but so far I have some use for variance - but I can
> keep my modified local version and work with it, thats fine for me. ,-)
Maybe this should be an additional option, to allow a variance map to
be generated in addition to the resampled map. E.g.
"r.resamp.stats method=... variance=..."?
If that were done, would it be better to compute the deviation from
the mean (i.e. variance) or the deviation from the result (in case an
aggregate other than the mean is used)?
--
Glynn Clements <glynn at gclements.plus.com>
More information about the grass-dev
mailing list