[GRASSLIST:4664] Re: sum in r.mapcalc

Martin Wegmann m.wegmann at web.de
Sun Oct 6 19:34:13 EDT 2002


In respond to Glynn's suggestion of further functions for r.mapcalc, it would be great if there would be more possibilities to analyse time series (each single cell of each 
raster in the series). 
An equivalent of r.neighbors (all functions for core and surrounding pixel) could be very useful for (my) time series analysis. 
Would it also be possible to add a linear regression model to r.mapcalc for time series, to analyse the tendency of each pixel over time (if the value is in- or decreasing)? 


thanks Martin



4/10/2002 10:45:24 PM, Glynn Clements <glynn.clements at virgin.net> wrote:

>
>Otto Dassau wrote:
>
>> > > I want to calculate the average and standard deviation of a image time
>> > > series. To calculate the average in r.mapcalc is no problem, but how
>> > > can I calculate s.d.? I couldn't find a sum sign in the manual. Or is
>> > > there already a command for calcualting s.d. of several images?
>> > 
>> > r.mapcalc doesn't include variance or standard deviation functions. It
>> > doesn't have a variadic "sum" operator either; you would need to write
>> > it as e.g. "a + b + c".
>> 
>> r.univar is a shell script calculating standard deviation from 
>> r.stats output. Maybe there you find a solution.
>
>r.univar provides overall statistics for a single map.
>
>Given the references to "time series" and r.mapcalc, I assumed that
>Martin was interested in computing a mean and standard deviation for
>each cell, from the corresponding cells of each raster in the series.
>
>Assuming that this is the case, currently he would need to write out
>the computation for standard deviation explicitly using the basic
>arithmetic operators.
>
>However, it isn't particularly hard to add new functions to r.mapcalc. 
>I'm open to suggestions from the list as to which functions should be
>added to future versions of r.mapcalc.
>
>The question also suggests that there might be some use for a tool
>which is specifically targeted at time series. Something similar to
>r.neighbors[1], but which computes aggregates of the corresponding
>cells of a sequence of maps rather than of the surrounding cells in a
>single map.
>
>[1] r.neighbors computes the aggregates: mean, median, mode, minimum,
>maximum, stddev, sum, variance, diversity and interspersion. Again,
>the list could be extended without much difficulty.
>
>-- 
>Glynn Clements <glynn.clements at virgin.net>
>
>













-------------------------------

Martin Wegmann
Tropical Ecosystem Research Center
PMB 44 Winnellie / Darwin
NT 0821
Australia

.......

priv.
4 Carpentier Cres.
Wagaman / Darwin
NT 0810
Autralia
0061 8 8927 1241









More information about the grass-user mailing list