t.rast.univar(1grass)

✨ t.rast.univar ✨

okay bestie, gather round, because t.rast.univar is literally that girl πŸ’… it's a GRASS User's Manual classic, and she's here to spill the stats.

🌸 NAME 🌸

t.rast.univar β€” she calculates univariate statistics from the non-null cells for each registered raster map of a space time raster dataset. yes, every single one. no skips. πŸŽ€

πŸ¦‹ KEYWORDS πŸ¦‹

temporal, statistics, raster, time, parallel


πŸ‘‘ SYNOPSIS πŸ‘‘

t.rast.univar
t.rast.univar --help
t.rast.univar [-eru] input=name  [zones=name]   [nprocs=integer]
[output=name]   [percentile=float[,float,...]]   [where=sql_query]
[region_relation=string]   [separator=character]   [--overwrite]
[--help]  [--verbose]  [--quiet]  [--ui]

πŸ’– Flags πŸ’–

  • -e β€” Calculate extended statistics. more numbers, more power, slay.
  • -r β€” Use the raster map regions for univar statistical calculation instead of the current region.
  • -u β€” Suppress printing of column names. just the data, no labels, mysterious queen energy.
  • --overwrite β€” Allow output files to overwrite existing files (so she can just take over, respectfully).
  • --help β€” Print usage summary.
  • --verbose β€” Verbose module output (she will narrate).
  • --quiet β€” Quiet module output (she will simply not).
  • --ui β€” Force launching GUI dialog. buttons and everything ✨

πŸŽ€ Parameters πŸŽ€

  • input=name [required] β€” Name of the input space time raster dataset. this one's mandatory, no cap.
  • zones=name β€” Raster map used for zoning, must be of type CELL.
  • nprocs=integer β€” Number of threads for parallel computing.
    • 0: use OpenMP default; >0: use nprocs; <0: use MAX-nprocs
    • Default: 0
  • output=name β€” Name for output file.
  • percentile=float[,float,...] β€” Percentile to calculate (requires extended statistics flag, so bestie bring -e or she can't help you πŸ’€).
    • Options: 0-100
  • where=sql_query β€” WHERE conditions of SQL statement without 'where' keyword used in the temporal GIS framework.
    • Example: start_time > '2001-01-01 12:30:00'
  • region_relation=string β€” Process only maps with this spatial relation to the current computational region.
    • Options: overlaps, contains, is_contained
  • separator=character β€” Field separator character between the output columns.
    • Special characters: pipe, comma, space, tab, newline
    • Default: pipe

πŸ’œ DESCRIPTION πŸ’œ

okay so t.rast.univar calculates univariate statistics from the non-null cells for each registered raster map of a space time raster dataset. that's the whole vibe. 🫢

By default it returns the name of the map, the semantic label of the map, the start and end date of the map and the following values: mean, minimum and maximum vale, mean_of_abs, standard deviation, variance, coeff_var, number of null cells, total number of cells. (yes, "vale" β€” we keep it exactly as the legend says, character for character, it's iconic now 🌈)

Using the e flag it can calculate also extended statistics: first quartile, median value, third quartile and percentile 90. extra credit stats, ate.

If a zones raster map is provided, statistics are computed for each zone (category) in that input raster map. The zones option does not support space time raster datasets (STRDS) but only a single, static raster map. so like, one map only, don't come at her with a whole series πŸ™ˆ

Space time raster datasets may contain raster maps with varying spatial extent like for example series of scenes of satellite images. With the region_relation option, computations can be limited to maps of the space time raster dataset that have a given spatial relation to the current computational region. Supported spatial relations are:

  • "overlaps": process only maps that spatially overlap ("intersect") with the current computational region
  • "is_contained": process only maps that are fully within the current computational region
  • "contains": process only maps that contain (fully cover) the current computational region

⭐ EXAMPLE ⭐

Obtain the univariate statistics for the raster space time dataset "tempmean_monthly" (precision reduced to 2 decimals in this example):

t.rast.univar -e tempmean_monthly
id|start|end|mean|min|max|mean_of_abs|stddev|variance|coeff_var|sum|null_cells|cells|first_quartile|median|third_quartile|percentile_90
2009_01_tempmean@climate_2009_2012|2009-01-01 00:00:00|2009-02-01 00:00:00|3.90|-3.38|7.43|3.95|1.79|3.20|45.91|1977967.31|503233|1010600|2.80|3.92|5.21|6.23
2009_02_tempmean@climate_2009_2012|2009-02-01 00:00:00|2009-03-01 00:00:00|5.91|-1.82|8.01|5.92|1.63|2.65|27.53|2999555.60|503233|1010600|5.44|6.26|7.07|7.48
...
2012_11_tempmean@climate_2009_2012|2012-11-01 00:00:00|2012-12-01 00:00:00|8.03|1.79|10.91|8.03|1.32|1.73|16.41|4072472.77|503233|1010600|7.49|8.13|8.96|9.48
2012_12_tempmean@climate_2009_2012|2012-12-01 00:00:00|2013-01-01 00:00:00|8.71|1.76|11.98|8.71|1.72|2.95|19.74|4418403.77|503233|1010600|7.84|8.95|9.99|10.67

🌈 SEE ALSO 🌈

t.create, t.info t.create,

(yes, that's literally what it says. we don't question the reference list, we just respect it πŸ’€)


🧚 AUTHOR 🧚

SΓΆren Gebbert, ThΓΌnen Institute of Climate-Smart Agriculture Stefan Blumentrath (support for zones, parallel processing, and spatial relations)

πŸ“ SOURCE CODE πŸ“

Available at: t.rast.univar source code (history)

Latest change: Saturday Oct 11 04:38:40 2025 in commit: 3dd71f5fab83b72a2db2da959fe075c5b3b52200

Main index | Temporal index | Topics index | Keywords index | Graphical index | Full index

Β© 2003-2026 GRASS Development Team, GRASS 8.5.0 Reference Manual


and that's the whole page, bestie πŸ’– this was t.rast.univar from the GRASS User's Manual, GRASS 8.5.0, with the latest change landing Saturday Oct 11 04:38:40 2025 in that commit 3dd71f5fab83b72a2db2da959fe075c5b3b52200, Β© 2003-2026 GRASS Development Team. go run your stats, you're gonna do amazing, periodt πŸ‘‘βœ¨

πŸ“¦ where this page comes from