This is the command r.seriesgrass that can be run in the OnWorks free hosting provider using one of our multiple free online workstations such as Ubuntu Online, Fedora Online, Windows online emulator or MAC OS online emulator

**PROGRAM:**

**NAME**

**r.series**- Makes each output cell value a function of the values assigned to the

corresponding cells in the input raster map layers.

**KEYWORDS**

raster, aggregation, series

**SYNOPSIS**

**r.series**

**r.series**

**--help**

**r.series**[-

**nz**] [

**input**=

__name__[,

__name__,...]] [

**file**=

__name__]

**output**=

__name__[,

__name__,...]

**method**=

__string__[,

__string__,...] [

**quantile**=

__float__[,

__float__,...]] [

**weights**=

__float__[,

__float__,...]]

[

**range**=

__lo,hi__] [--

**overwrite**] [--

**help**] [--

**verbose**] [--

**quiet**] [--

**ui**]

**Flags:**

**-n**

Propagate NULLs

**-z**

Do not keep files open

**--overwrite**

Allow output files to overwrite existing files

**--help**

Print usage summary

**--verbose**

Verbose module output

**--quiet**

Quiet module output

**--ui**

Force launching GUI dialog

**Parameters:**

**input**=

__name[,name__,...]

Name of input raster map(s)

**file**=

__name__

Input file with one raster map name and optional one weight per line, field separator

between name and weight is |

**output**=

__name[,name__,...]

**[required]**

Name for output raster map

**method**=

__string[,string__,...]

**[required]**

Aggregate operation

Options:

__average,__

__count,__

__median,__

__mode,__

__minimum,__

__min_raster,__

__maximum,__

__max_raster,__

__stddev,__

__range,__

__sum,__

__variance,__

__diversity,__

__slope,__

__offset,__

__detcoeff,__

__tvalue,__

__quart1,__

__quart3,__

__perc90,__

__quantile,__

__skewness,__

__kurtosis__

**quantile**=

__float[,float__,...]

Quantile to calculate for method=quantile

Options:

__0.0-1.0__

**weights**=

__float[,float__,...]

Weighting factor for each input map, default value is 1.0 for each input map

**range**=

__lo,hi__

Ignore values outside this range

**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:

· average: average value

· count: count of non-NULL cells

· median: median value

· mode: most frequently occurring value

· minimum: lowest value

· maximum: highest value

· range: range of values (max - min)

· stddev: standard deviation

· sum: sum of values

· variance: statistical variance

· diversity: number of different values

· slope: linear regression slope

· offset: linear regression offset

· detcoeff: linear regression coefficient of determination

· tvalue: linear regression t-value

· min_raster: raster map number with the minimum time-series value

· max_raster: raster map number with the maximum time-series value

Note that most parameters accept multiple answers, allowing multiple aggregates to be

computed in a single run, e.g.:

r.series input=map1,...,mapN \

output=map.mean,map.stddev \

method=average,stddev

or:

r.series input=map1,...,mapN \

output=map.p10,map.p50,map.p90 \

method=quantile,quantile,quantile \

quantile=0.1,0.5,0.9

The same number of values must be provided for all options.

**NOTES**

**No-data**

**(NULL)**

**handling**

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.

**Minimum**

**and**

**maximum**

**analysis**

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.

**Range**

**analysis**

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**

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).

**Quantiles**

__r.series__can calculate arbitrary quantiles.

**Memory**

**consumption**

Memory usage is not an issue, as

__r.series__only needs to hold one row from each map at a

time.

**Management**

**of**

**open**

**file**

**limits**

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. See also the Wiki page Hints for large raster data processing.

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 character "|" must be used.

**EXAMPLES**

Using

__r.series__with wildcards:

r.series input="`g.list pattern=’insitu_data.*’ sep=,`" \

output=insitu_data.stddev method=stddev

Note the

__g.list__script also supports regular expressions for selecting map names.

Using

__r.series__with NULL raster maps (in order to consider a "complete" time series):

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):

# Approach for shell based systems

r.series input=`g.list rast pattern="temp_2003_???_avg" sep=,` \

output=temp_2003_days_over_25deg range=25.0,100.0 method=count

# Approach in two steps (e.g., for Windows systems)

g.list rast pattern="temp_2003_???_avg" output=mapnames.txt

r.series file=mapnames.txt \

output=temp_2003_days_over_25deg range=25.0,100.0 method=count

Use r.seriesgrass online using onworks.net services