1t.rast.aggregate(1) GRASS GIS User's Manual t.rast.aggregate(1)
2
3
4
6 t.rast.aggregate - Aggregates temporally the maps of a space time
7 raster dataset by a user defined granularity.
8
10 temporal, aggregation, raster, time
11
13 t.rast.aggregate
14 t.rast.aggregate --help
15 t.rast.aggregate [-n] input=name output=name basename=string [suf‐
16 fix=string] granularity=string method=string [offset=integer]
17 [nprocs=integer] [file_limit=integer] [sampling=name[,name,...]]
18 [where=sql_query] [--overwrite] [--help] [--verbose] [--quiet]
19 [--ui]
20
21 Flags:
22 -n
23 Register Null maps
24
25 --overwrite
26 Allow output files to overwrite existing files
27
28 --help
29 Print usage summary
30
31 --verbose
32 Verbose module output
33
34 --quiet
35 Quiet module output
36
37 --ui
38 Force launching GUI dialog
39
40 Parameters:
41 input=name [required]
42 Name of the input space time raster dataset
43
44 output=name [required]
45 Name of the output space time raster dataset
46
47 basename=string [required]
48 Basename of the new generated output maps
49 Either a numerical suffix or the start time (s-flag) separated by
50 an underscore will be attached to create a unique identifier
51
52 suffix=string
53 Suffix to add at basename: set ’gran’ for granularity, ’time’ for
54 the full time format, ’num’ for numerical suffix with a specific
55 number of digits (default %05)
56 Default: gran
57
58 granularity=string [required]
59 Aggregation granularity, format absolute time "x years, x months, x
60 weeks, x days, x hours, x minutes, x seconds" or an integer value
61 for relative time
62
63 method=string [required]
64 Aggregate operation to be performed on the raster maps
65 Options: average, count, median, mode, minimum, min_raster, maxi‐
66 mum, max_raster, stddev, range, sum, variance, diversity, slope,
67 offset, detcoeff, quart1, quart3, perc90, quantile, skewness, kur‐
68 tosis
69 Default: average
70
71 offset=integer
72 Offset that is used to create the output map ids, output map id is
73 generated as: basename_ (count + offset)
74 Default: 0
75
76 nprocs=integer
77 Number of r.series processes to run in parallel
78 Default: 1
79
80 file_limit=integer
81 The maximum number of open files allowed for each r.series process
82 Default: 1000
83
84 sampling=name[,name,...]
85 The method to be used for sampling the input dataset
86 Options: equal, overlaps, overlapped, starts, started, finishes,
87 finished, during, contains
88 Default: contains
89
90 where=sql_query
91 WHERE conditions of SQL statement without ’where’ keyword used in
92 the temporal GIS framework
93 Example: start_time > ’2001-01-01 12:30:00’
94
96 t.rast.aggregate temporally aggregates space time raster datasets by a
97 specific temporal granularity. This module support absolute and rela‐
98 tive time. The temporal granularity of absolute time can be seconds,
99 minutes, hours, days, weeks, months or years. Mixing of granularities
100 eg. "1 year, 3 months 5 days" is not supported. In case of relative
101 time the temporal unit of the input space time raster dataset is used.
102 The granularity must be specified with an integer value.
103
104 This module is sensitive to the current region and mask settings, hence
105 spatial extent and spatial resolution. In case the registered raster
106 maps of the input space time raster dataset have different spatial res‐
107 olutions, the default nearest neighbor resampling method is used for
108 runtime spatial aggregation.
109
111 The raster module r.series is used internally. Hence all aggregate
112 methods of r.series are supported. See the r.series manual page for de‐
113 tails.
114
115 This module will shift the start date for each aggregation process de‐
116 pending on the provided temporal granularity. The following shifts will
117 performed:
118
119 • granularity years: will start at the first of January, hence
120 14-08-2012 00:01:30 will be shifted to 01-01-2012 00:00:00
121
122 • granularity months: will start at the first day of a month,
123 hence 14-08-2012 will be shifted to 01-08-2012 00:00:00
124
125 • granularity weeks: will start at the first day of a week (Mon‐
126 day), hence 14-08-2012 01:30:30 will be shifted to 13-08-2012
127 01:00:00
128
129 • granularity days: will start at the first hour of a day, hence
130 14-08-2012 00:01:30 will be shifted to 14-08-2012 00:00:00
131
132 • granularity hours: will start at the first minute of a hour,
133 hence 14-08-2012 01:30:30 will be shifted to 14-08-2012
134 01:00:00
135
136 • granularity minutes: will start at the first second of a
137 minute, hence 14-08-2012 01:30:30 will be shifted to 14-08-2012
138 01:30:00
139
140 The specification of the temporal relation between the aggregation in‐
141 tervals and the raster map layers is always formulated from the aggre‐
142 gation interval viewpoint. Hence, the relation contains has to be spec‐
143 ified to aggregate map layer that are temporally located in an aggrega‐
144 tion interval.
145
146 Parallel processing is supported in case that more than one interval is
147 available for aggregation computation. Internally several r.series mod‐
148 ules will be started, depending on the number of specified parallel
149 processes (nprocs) and the number of intervals to aggregate.
150
152 Aggregation of monthly data into yearly data
153 In this example the user is going to aggregate monthly data into yearly
154 data, running:
155 t.rast.aggregate input=tempmean_monthly output=tempmean_yearly \
156 basename=tempmean_year \
157 granularity="1 years" method=average
158 t.support input=tempmean_yearly \
159 title="Yearly precipitation" \
160 description="Aggregated precipitation dataset with yearly resolution"
161 t.info tempmean_yearly
162 +-------------------- Space Time Raster Dataset -----------------------------+
163 | |
164 +-------------------- Basic information -------------------------------------+
165 | Id: ........................ tempmean_yearly@climate_2000_2012
166 | Name: ...................... tempmean_yearly
167 | Mapset: .................... climate_2000_2012
168 | Creator: ................... lucadelu
169 | Temporal type: ............. absolute
170 | Creation time: ............. 2014-11-27 10:25:21.243319
171 | Modification time:.......... 2014-11-27 10:25:21.862136
172 | Semantic type:.............. mean
173 +-------------------- Absolute time -----------------------------------------+
174 | Start time:................. 2009-01-01 00:00:00
175 | End time:................... 2013-01-01 00:00:00
176 | Granularity:................ 1 year
177 | Temporal type of maps:...... interval
178 +-------------------- Spatial extent ----------------------------------------+
179 | North:...................... 320000.0
180 | South:...................... 10000.0
181 | East:.. .................... 935000.0
182 | West:....................... 120000.0
183 | Top:........................ 0.0
184 | Bottom:..................... 0.0
185 +-------------------- Metadata information ----------------------------------+
186 | Raster register table:...... raster_map_register_514082e62e864522a13c8123d1949dea
187 | North-South resolution min:. 500.0
188 | North-South resolution max:. 500.0
189 | East-west resolution min:... 500.0
190 | East-west resolution max:... 500.0
191 | Minimum value min:.......... 7.370747
192 | Minimum value max:.......... 8.81603
193 | Maximum value min:.......... 17.111387
194 | Maximum value max:.......... 17.915511
195 | Aggregation type:........... average
196 | Number of registered maps:.. 4
197 |
198 | Title: Yearly precipitation
199 | Monthly precipitation
200 | Description: Aggregated precipitation dataset with yearly resolution
201 | Dataset with monthly precipitation
202 | Command history:
203 | # 2014-11-27 10:25:21
204 | t.rast.aggregate input="tempmean_monthly"
205 | output="tempmean_yearly" basename="tempmean_year" granularity="1 years"
206 | method="average"
207 |
208 | # 2014-11-27 10:26:21
209 | t.support input=tempmean_yearly \
210 | title="Yearly precipitation" \
211 | description="Aggregated precipitation dataset with yearly resolution"
212 +----------------------------------------------------------------------------+
213
214 Different aggregations and map name suffix variants
215 Examples of resulting naming schemes for different aggregations when
216 using the suffix option:
217
218 Weekly aggregation
219 t.rast.aggregate input=daily_temp output=weekly_avg_temp \
220 basename=weekly_avg_temp method=average granularity="1 weeks"
221 t.rast.list weekly_avg_temp
222 name|mapset|start_time|end_time
223 weekly_avg_temp_2003_01|climate|2003-01-03 00:00:00|2003-01-10 00:00:00
224 weekly_avg_temp_2003_02|climate|2003-01-10 00:00:00|2003-01-17 00:00:00
225 weekly_avg_temp_2003_03|climate|2003-01-17 00:00:00|2003-01-24 00:00:00
226 weekly_avg_temp_2003_04|climate|2003-01-24 00:00:00|2003-01-31 00:00:00
227 weekly_avg_temp_2003_05|climate|2003-01-31 00:00:00|2003-02-07 00:00:00
228 weekly_avg_temp_2003_06|climate|2003-02-07 00:00:00|2003-02-14 00:00:00
229 weekly_avg_temp_2003_07|climate|2003-02-14 00:00:00|2003-02-21 00:00:00
230 Variant with suffix set to granularity:
231 t.rast.aggregate input=daily_temp output=weekly_avg_temp \
232 basename=weekly_avg_temp suffix=gran method=average \
233 granularity="1 weeks"
234 t.rast.list weekly_avg_temp
235 name|mapset|start_time|end_time
236 weekly_avg_temp_2003_01_03|climate|2003-01-03 00:00:00|2003-01-10 00:00:00
237 weekly_avg_temp_2003_01_10|climate|2003-01-10 00:00:00|2003-01-17 00:00:00
238 weekly_avg_temp_2003_01_17|climate|2003-01-17 00:00:00|2003-01-24 00:00:00
239 weekly_avg_temp_2003_01_24|climate|2003-01-24 00:00:00|2003-01-31 00:00:00
240 weekly_avg_temp_2003_01_31|climate|2003-01-31 00:00:00|2003-02-07 00:00:00
241 weekly_avg_temp_2003_02_07|climate|2003-02-07 00:00:00|2003-02-14 00:00:00
242 weekly_avg_temp_2003_02_14|climate|2003-02-14 00:00:00|2003-02-21 00:00:00
243
244 Monthly aggregation
245 t.rast.aggregate input=daily_temp output=monthly_avg_temp \
246 basename=monthly_avg_temp suffix=gran method=average \
247 granularity="1 months"
248 t.rast.list monthly_avg_temp
249 name|mapset|start_time|end_time
250 monthly_avg_temp_2003_01|climate|2003-01-01 00:00:00|2003-02-01 00:00:00
251 monthly_avg_temp_2003_02|climate|2003-02-01 00:00:00|2003-03-01 00:00:00
252 monthly_avg_temp_2003_03|climate|2003-03-01 00:00:00|2003-04-01 00:00:00
253 monthly_avg_temp_2003_04|climate|2003-04-01 00:00:00|2003-05-01 00:00:00
254 monthly_avg_temp_2003_05|climate|2003-05-01 00:00:00|2003-06-01 00:00:00
255 monthly_avg_temp_2003_06|climate|2003-06-01 00:00:00|2003-07-01 00:00:00
256
257 Yearly aggregation
258 t.rast.aggregate input=daily_temp output=yearly_avg_temp \
259 basename=yearly_avg_temp suffix=gran method=average \
260 granularity="1 years"
261 t.rast.list yearly_avg_temp
262 name|mapset|start_time|end_time
263 yearly_avg_temp_2003|climate|2003-01-01 00:00:00|2004-01-01 00:00:00
264 yearly_avg_temp_2004|climate|2004-01-01 00:00:00|2005-01-01 00:00:00
265
267 t.rast.aggregate.ds, t.rast.extract, t.info, r.series, g.region,
268 r.mask
269
270 Temporal data processing Wiki
271
273 Sören Gebbert, Thünen Institute of Climate-Smart Agriculture
274
276 Available at: t.rast.aggregate source code (history)
277
278 Accessed: Saturday Oct 28 18:19:22 2023
279
280 Main index | Temporal index | Topics index | Keywords index | Graphical
281 index | Full index
282
283 © 2003-2023 GRASS Development Team, GRASS GIS 8.3.1 Reference Manual
284
285
286
287GRASS 8.3.1 t.rast.aggregate(1)