Skip to content

t.rast.aggregate.seasons

Calculates seasonal data according to astronomical seasons.

t.rast.aggregate.seasons [-nm] input=name [output=name] [years=string [,string,...]] basename=string method=string [nprocs=integer] [--overwrite] [--verbose] [--quiet] [--qq] [--ui]

Example:

t.rast.aggregate.seasons input=name basename=string method=average

grass.tools.Tools.t_rast_aggregate_seasons(input, output=None, years=None, basename, method="average", nprocs=1, flags=None, overwrite=None, verbose=None, quiet=None, superquiet=None)

Example:

tools = Tools()
tools.t_rast_aggregate_seasons(input="name", basename="string", method="average")

This grass.tools API is experimental in version 8.5 and expected to be stable in version 8.6.

grass.script.run_command("t.rast.aggregate.seasons", input, output=None, years=None, basename, method="average", nprocs=1, flags=None, overwrite=None, verbose=None, quiet=None, superquiet=None)

Example:

gs.run_command("t.rast.aggregate.seasons", input="name", basename="string", method="average")

Parameters

input=name [required]
    Name of the input space time raster dataset
output=name
    The name of a singular space time raster dataset
    Using this option all the yearly space time raster datasets will be merged in a singular space time raster dataset
years=string [,string,...]
    List of years, separator may be comma (list) or minus (range)
basename=string [required]
    Basename of the new generated output maps and space time raster datasets if output option is not used
    A numerical suffix separated by an underscore will be attached to create a unique identifier
method=string [required]
    Aggregate operation to be performed on the raster maps
    Allowed values: average, count, median, mode, minimum, min_raster, maximum, max_raster, stddev, range, sum, variance, diversity, slope, offset, detcoeff, quart1, quart3, perc90, quantile, skewness, kurtosis
    Default: average
nprocs=integer
    Number of processes to run in parallel
    Default: 1
-n
    Register Null maps
-m
    Use meteorological seasons
--overwrite
    Allow output files to overwrite existing files
--help
    Print usage summary
--verbose
    Verbose module output
--quiet
    Quiet module output
--qq
    Very quiet module output
--ui
    Force launching GUI dialog

input : str, required
    Name of the input space time raster dataset
    Used as: input, strds, name
output : str, optional
    The name of a singular space time raster dataset
    Using this option all the yearly space time raster datasets will be merged in a singular space time raster dataset
    Used as: output, strds, name
years : str | list[str], optional
    List of years, separator may be comma (list) or minus (range)
basename : str, required
    Basename of the new generated output maps and space time raster datasets if output option is not used
    A numerical suffix separated by an underscore will be attached to create a unique identifier
    Used as:
method : str, required
    Aggregate operation to be performed on the raster maps
    Allowed values: average, count, median, mode, minimum, min_raster, maximum, max_raster, stddev, range, sum, variance, diversity, slope, offset, detcoeff, quart1, quart3, perc90, quantile, skewness, kurtosis
    Default: average
nprocs : int, optional
    Number of processes to run in parallel
    Default: 1
flags : str, optional
    Allowed values: n, m
    n
        Register Null maps
    m
        Use meteorological seasons
overwrite : bool, optional
    Allow output files to overwrite existing files
    Default: None
verbose : bool, optional
    Verbose module output
    Default: None
quiet : bool, optional
    Quiet module output
    Default: None
superquiet : bool, optional
    Very quiet module output
    Default: None

Returns:

result : grass.tools.support.ToolResult | None
If the tool produces text as standard output, a ToolResult object will be returned. Otherwise, None will be returned.

Raises:

grass.tools.ToolError: When the tool ended with an error.

input : str, required
    Name of the input space time raster dataset
    Used as: input, strds, name
output : str, optional
    The name of a singular space time raster dataset
    Using this option all the yearly space time raster datasets will be merged in a singular space time raster dataset
    Used as: output, strds, name
years : str | list[str], optional
    List of years, separator may be comma (list) or minus (range)
basename : str, required
    Basename of the new generated output maps and space time raster datasets if output option is not used
    A numerical suffix separated by an underscore will be attached to create a unique identifier
    Used as:
method : str, required
    Aggregate operation to be performed on the raster maps
    Allowed values: average, count, median, mode, minimum, min_raster, maximum, max_raster, stddev, range, sum, variance, diversity, slope, offset, detcoeff, quart1, quart3, perc90, quantile, skewness, kurtosis
    Default: average
nprocs : int, optional
    Number of processes to run in parallel
    Default: 1
flags : str, optional
    Allowed values: n, m
    n
        Register Null maps
    m
        Use meteorological seasons
overwrite : bool, optional
    Allow output files to overwrite existing files
    Default: None
verbose : bool, optional
    Verbose module output
    Default: None
quiet : bool, optional
    Quiet module output
    Default: None
superquiet : bool, optional
    Very quiet module output
    Default: None

DESCRIPTION

t.rast.aggregate.seasons aggregates an input space time raster dataset astronomical or meteorological seasons using a statistical method selected by the user. It uses t.rast.aggregate.ds to detect and copy the seasons granularity.

Astronomical seasons are defined as:

  • Spring 20 March - 21 June
  • Summer 21 June - 20 September
  • Autumn 20 September - 21 December
  • Winter 21 December - 20 March (following year)

Meteorological seasons are defined as:

  • Spring 1 March - 31 May
  • Summer 1 June - 30 August
  • Autumn 1 September - 30 November
  • Winter 1 December - 28/29 Februay (following year)

Using the output option, the tool will create a single unified space time raster dataset with the name provided, otherwise it will create a space time raster dataset for each year in the input space time raster dataset.

EXAMPLES

Aggregate the input space-time raster dataset into astronomical seasons and create a unified output space-time raster dataset

t.rast.aggregate.seasons input=mystrds basename=mystrds_seasons output=outstrds

Aggregate the input space-time raster dataset into meteorological seasons and create an output space-time raster dataset for a selected year

t.rast.aggregate.seasons -m input=mystrds basename=mystrds_seasons_meteo \
    output=outstrds_meteo year=2014

NOTES

If one of the seasons is not fully covered by the input space time raster dataset, that season will not be created by the tool. For example if you have a daily space time raster dataset for just one year it will create only raster maps for 3 seasons (Spring, Summer, Autumn), the Winter will be avoided since your input dataset has data only until the end of the year but it misses the data from January to March.

SEE ALSO

t.rast.aggregate.ds, r.null

AUTHOR

Luca Delucchi, Fondazione Edmund Mach

SOURCE CODE

Available at: t.rast.aggregate.seasons source code (history)
Latest change: Saturday Jul 18 20:15:59 2026 in commit a413cbc