GRASS logo

NAME

t.rast.aggregate.condition - Aggregate multiple space time raster maps into mosaics with the given granualrity, applying a condition for valid data using r.mapcalc.

KEYWORDS

temporal, aggregation, patch, raster, merge, patching, granularity, strds

SYNOPSIS

t.rast.aggregate.condition
t.rast.aggregate.condition --help
t.rast.aggregate.condition [-en] input=name [where=sql_query] [mask_label=string] mask_value=string condition_label=string aggregation_labels=string[,string,...] output=name [title=string] [description=string] basename=string [offset=integer] [suffix=string] granularity=string [sampling=name[,name,...]] aggregate_condition=string [nprocs=integer] [region_relation=string] [--overwrite] [--help] [--verbose] [--quiet] [--ui]

Flags:

-e
Extend existing STRDS (requires overwrite flag)
-n
Register Null maps
--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 [required]
Name of the input space time raster dataset
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'
mask_label=string
Semantic label of the mask raster maps
mask_value=string [required]
Value of the mask raster maps representing valid data
condition_label=string [required]
Semantic label of the condition raster maps
aggregation_labels=string[,string,...] [required]
One ore more semantic label(s) of raster map(s) to aggregate
output=name [required]
Name of the output space time raster dataset
title=string
Title of the resulting STRDS
description=string
Description of the resulting STRDS
basename=string [required]
Basename for output raster maps
offset=integer
Offset that is used to create the output map ids, output map id is generated as: basename_ (count + offset)
Default: 0
suffix=string
Suffix to add at basename: set 'gran' for granularity, 'time' for the full time format, 'num' for numerical suffix with a specific number of digits (default %05)
Default: gran
granularity=string [required]
Aggregation granularity, format absolute time "x years, x months, x weeks, x days, x hours, x minutes, x seconds" or an integer value for relative time
sampling=name[,name,...]
The method to be used for sampling the input dataset
Options: equal, overlaps, overlapped, starts, started, finishes, finished, during, contains
Default: contains
aggregate_condition=string [required]
Condition used to identify/select values of maps to aggregate (NULL aware method from r.mapcalc)
Options: nmax, nmin, nmode
nprocs=integer
Number of threads for parallel computing
Default: 1
region_relation=string
Process only maps with this spatial relation to the current computational region
Options: overlaps, contains, is_contained

Table of contents

DESCRIPTION

t.rast.aggregate.condition aggregates raster maps within a space time raster dataset (STRDS) using an r.mapcalc expression. It is written oriented on t.rast.aggregate and provides many of the same options, to control naming of the output raster maps, like: basename, offset, suffix

Which and how many maps are aggregated can be controled using the granularity and sampling options.

t.rast.aggregate.condition applies a mask (given in mask_label) while selecting values from raster maps with the given aggregation_labels using a condition raster map (given in the condition_label option). For aggregation, those pixels in the aggregation_labels raster maps are selected, where the pixels in the temporally corresponding (=equal) raster maps with the condition_label meet the aggregate_condition.

The module assumes and requires that the input STRDS is equipped with semantic_labels. semantic_labels are used to compile mapcalculator expressions for each ganule and temporal extent selected for the given granule.

Per granule, one raster map is produced for the condition_label, aggregated with the aggregate_condition, plus one map for each of the aggregation_labels. Semantic labels for the output raster maps are condition_label_aggregate_condition for the aggregated condition_label maps and aggregation_label for all aggregated maps from the aggregation_labels.

The use case t.rast.aggregate.condition is written for is to be able to aggregate satellite imagery in space and time, where cloudy pixels are excluded and only selected values are propagated to the output maps. A concrete example, is to aggregate Fractional Sow Cover maps from Sentinel-3 where pixels with the lowes solar angle are selected and a cloud mask is applied at the same time.

Both input and output of this module is a single space time raster dataset. A subset of the input space time raster dataset can be selected using the where option. In addition, input maps can be filtered spatially using the region_relation option.

The resulting raster maps can also be registered into an existing Space Time Raster Dataset if the e-flag and --overwrite flags are set.

EXAMPLE

The example uses the North Carolina extra time series of MODIS Land Surface Temperature maps (download). (The mapset has to be unzip in one of the North Carolina locations.)

Patching the MODIS Land Surface Temperature for 2016 (filling missing pixels by subsequent maps in the time series):

t.rast.aggregate.condition input=Sentinel_3_SLSTR_FSC output=Sentinel_3_SLSTR_FSC_daily \
  --overwrite --verbose -e mask_label=S3_SLSTR_cloud_mask mask_value=0 \
  condition_label=S3_solar_zenith aggregate_condition=nmin \
  aggregation_labels=S3_SLSTR_fractional_snow_cover \
  granularity="1 day" basename=S3_SLSTR_FSC \
  title="Sentinel-3 SLSTR FSC daily" \
  description="Daily Fractional Snow Cover measurements from Seninel-3 SLSTR instrument" \
  region_relation=contains \
  where="start_time >= '2023-01' and start_time <= '2023-12'" \
  nprocs=8
t.info Sentinel_3_SLSTR_FSC

SEE ALSO

r.mapcalc, t.rast.aggregate, t.rast.algebra, t.rast.mapcalc, t.rast.series, t.create, t.info, t.merge t.rast.patch,

Temporal data processing Wiki

AUTHOR

Stefan Blumentrath, NVE

SOURCE CODE

Available at: t.rast.aggregate.condition source code (history)

Accessed: Monday Sep 16 09:38:17 2024


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

© 2003-2024 GRASS Development Team, GRASS GIS 8.4.0 Reference Manual