Skip to content

r.gdd

Makes each output cell value a function of the values assigned to the corresponding cells in the input raster map layers.

r.gdd [-nz] [input=name [,name,...]] [add=name] [file=name] output=name [index=string] [scale=float] [shift=float] [baseline=float] [cutoff=float] [range=lo,hi] [--overwrite] [--verbose] [--quiet] [--qq] [--ui]

Example:

r.gdd output=name

grass.script.run_command("r.gdd", input=None, add=None, file=None, output, index="gdd", scale=1.0, shift=0.0, baseline=10, cutoff=30, range=None, flags=None, overwrite=False, verbose=False, quiet=False, superquiet=False)

Example:

gs.run_command("r.gdd", output="name")

Parameters

input=name [,name,...]
    Name of input raster map(s)
add=name
    Existing map to be added to output
file=name
    Input file with raster map names, one per line
output=name [required]
    Name for output raster map
index=string
    Index to calculate
    Allowed values: gdd, winkler, bedd, huglin
    Default: gdd
    gdd: Growing Degree Days
    winkler: Winkler index
    bedd: Biologically Effective Degree Days
    huglin: Huglin Heliothermal index
scale=float
    Scale factor for input
    Default: 1.0
shift=float
    Shift factor for input
    Default: 0.0
baseline=float
    Baseline temperature
    Default: 10
cutoff=float
    Cutoff temperature
    Default: 30
range=lo,hi
    Ignore values outside this range
-n
    Propagate NULLs
-z
    Don't keep files open
--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 | list[str], optional
    Name of input raster map(s)
    Used as: input, raster, name
add : str, optional
    Existing map to be added to output
    Used as: input, raster, name
file : str, optional
    Input file with raster map names, one per line
    Used as: input, file, name
output : str, required
    Name for output raster map
    Used as: output, raster, name
index : str, optional
    Index to calculate
    Allowed values: gdd, winkler, bedd, huglin
    gdd: Growing Degree Days
    winkler: Winkler index
    bedd: Biologically Effective Degree Days
    huglin: Huglin Heliothermal index
    Default: gdd
scale : float, optional
    Scale factor for input
    Default: 1.0
shift : float, optional
    Shift factor for input
    Default: 0.0
baseline : float, optional
    Baseline temperature
    Default: 10
cutoff : float, optional
    Cutoff temperature
    Default: 30
range : tuple[float, float] | list[float] | str, optional
    Ignore values outside this range
    Used as: lo,hi
flags : str, optional
    Allowed values: n, z
    n
        Propagate NULLs
    z
        Don't keep files open
overwrite: bool, optional
    Allow output files to overwrite existing files
    Default: False
verbose: bool, optional
    Verbose module output
    Default: False
quiet: bool, optional
    Quiet module output
    Default: False
superquiet: bool, optional
    Very quiet module output
    Default: False

DESCRIPTION

r.gdd calculates (accumulated) growing degree days (GDDs), Winkler indices, Biologically Effective Degree Days (BEDD), and Huglin indices from several input maps with temperature data for different times of the day.

GDDs are calculated as

    gdd = average - baseline

The Winkler index is calculated as

    wi = average - baseline

usually accumulated for the period April 1st to October 31st (northern hemisphere) or the period October 1st to April 30th (southern hemisphere).

BEDDs are calculated as

    bedd = average - baseline

with an optional upper cutoff applied to the average. Vine development kinetics for example reach a plateau at an average daily temperature of 19°C.

The Huglin heliothermal index is calculated as

    hi = (average + max) / 2 - baseline

usually accumulated for the period April 1st to September 30th (northern hemisphere) or the period September 1st to April 30th (southern hemisphere).

Any averages above the cutoff value are set to cutoff, and any average values below the baseline value are set to baseline. Negative results are set to 0 (zero).

The shift and scale values are applied directly to the input values. The baseline, cutoff, and range options are applied to the shifted and scaled values.

If an existing map is provided with the add option, the values of this map are added to the output, thus accumulating the selected index.

NOTES

The scale and shift parameters are used to transform input values with

    new = old * scale + shift

With the -n flag, any cell for which any of the corresponding input cells are NULL is automatically set to NULL (NULL propagation) and the index is not calculated.

Without the -n flag, all non-NULL cells are used to calculate the selected index.

If the range= option is given, any values which fall outside that range will be treated as if they were NULL. Note that the range is applied to the scaled and shifted input data. 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).

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

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.

EXAMPLES

Example with MODIS Land Surface Temperature, transforming values from Kelvin * 50 to degrees Celsius:

r.gdd in=MOD11A1.Day,MOD11A1.Night,MYD11A1.Day,MYD11A1.Night out=MCD11A1.GDD \
      scale=0.02 shift=-273.15 baseline=10 cutoff=30

SEE ALSO

r.series, g.list, g.region

AUTHOR

Markus Metz (based on r.series)

SOURCE CODE

Available at: r.gdd source code (history)
Latest change: Thursday Mar 20 21:36:57 2025 in commit 7286ecf