DESCRIPTION

r.series makes each output cell value a function of the values assigned to the corresponding cells in the input raster map layers. Following methods are available:

NOTES

With -n flag, any cell for which any of the corresponding input cells are NULL is automatically set to NULL (NULL propagation). The aggregate function is not called, so all methods behave this way with respect to the -n flag.

Without -n flag, the complete list of inputs for each cell (including NULLs) is passed to the aggregate function. Individual aggregates can handle data as they choose. Mostly, they just compute the aggregate over the non-NULL values, producing a NULL result only if all inputs are NULL.

The min_raster and max_raster methods generate a map with the number of the raster map that holds the minimum/maximum value of the time-series. The numbering starts at 0 up to n for the first and the last raster listed in input=, respectively.

If the range= option is given, any values which fall outside that range will be treated as if they were NULL. The range parameter can be set to low,high thresholds: values outside of this range are treated as NULL (i.e., they will be ignored by most aggregates, or will cause the result to be NULL if -n is given). The low,high thresholds are floating point, so use -inf or inf for a single threshold (e.g., range=0,inf to ignore negative values, or range=-inf,-200.4 to ignore values above -200.4).

Linear regression (slope, offset, coefficient of determination, t-value) assumes equal time intervals. If the data have irregular time intervals, NULL raster maps can be inserted into time series to make time intervals equal (see example).

Number of raster maps to be processed is given by the limit of the operating system. For example, both the hard and soft limits are typically 1024. The soft limit can be changed with e.g. ulimit -n 1500 (UNIX-based operating systems) but not higher than the hard limit. If it is too low, you can as superuser add an entry in

/etc/security/limits.conf
# <domain>      <type>  <item>         <value>
your_username  hard    nofile          1500
This would raise the hard limit to 1500 file. Be warned that more files open need more RAM. For each map a weighting factor can be specified using the weights option. Using weights can be meaningful when computing sum or average of maps with different temporal extent. The default weight is 1.0. The number of weights must be identical with the number of input maps and must have the same order. Weights can also be specified in the input file.

Use the file option to analyze large amount of raster maps without hitting open files limit and the size limit of command line arguments. The computation is slower than the input option method. For every sinlge row in the output map(s) all input maps are opened and closed. The amount of RAM will rise linear with the number of specified input maps. The input and file options are mutually exclusive. Input is a text file with a new line separated list of raster map names and optional weights. As separator between the map name and the weight the charachter | must be used.

EXAMPLES

Using r.series with wildcards:
r.series input="`g.mlist pattern='insitu_data.*' sep=,`" \
         output=insitu_data.stddev method=stddev

Note the g.mlist script also supports regular expressions for selecting map names.

Using r.series with NULL raster maps:

r.mapcalc "dummy = null()"
r.series in=map2001,map2002,dummy,dummy,map2005,map2006,dummy,map2008 \
         out=res_slope,res_offset,res_coeff meth=slope,offset,detcoeff

Example for multiple aggregates to be computed in one run (3 resulting aggregates from two input maps):

r.series in=one,two out=result_avg,res_slope,result_count meth=sum,slope,count

Example to use the file option of r.series:

cat > input.txt << EOF
map1
map2
map3
EOF

r.series file=input.txt out=result_sum meth=sum

Example to use the file option of r.series including weights. The weight 0.75 should be assigned to map2. As the other maps do not have weights we can leave it out:

cat > input.txt << EOF
map1
map2|0.75
map3
EOF

r.series file=input.txt out=result_sum meth=sum

Example for counting the number of days above a certain temperature using daily average maps ('???' as DOY wildcard):

r.series input=`g.mlist rast pat="temp_2003_???_avg" sep=,` \
         output=temp_2003_days_over_25deg range=25.0,100.0 method=count

SEE ALSO

g.mlist, g.region

AUTHOR

Glynn Clements

Last changed: $Date$