1t.register(1) GRASS GIS User's Manual t.register(1)
2
3
4
6 t.register - Assigns timestamps and registers raster, vector and
7 raster3d maps in a space time dataset.
8
10 temporal, map management, register, time
11
13 t.register
14 t.register --help
15 t.register [-i] [input=name] [maps=name[,name,...]] [type=name]
16 [file=name] [start=string] [end=string] [unit=string] [incre‐
17 ment=string] [separator=character] [--overwrite] [--help] [--ver‐
18 bose] [--quiet] [--ui]
19
20 Flags:
21 -i
22 Create an interval (start and end time) in case an increment and
23 the start time are provided
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
42 Name of the input space time dataset
43
44 maps=name[,name,...]
45 Name of the input maps
46
47 type=name
48 Type of the input map
49 Options: raster, vector, raster_3d
50 Default: raster
51
52 file=name
53 Input file with map names, one per line
54 Additionally the start time and the end time can be specified per
55 line
56
57 start=string
58 Valid start date and time of the first map
59 Format for absolute time: "yyyy-mm-dd HH:MM:SS +HHMM", relative
60 time is of type integer.
61
62 end=string
63 Valid end date and time of all map
64 Format for absolute time: "yyyy-mm-dd HH:MM:SS +HHMM", relative
65 time is of type integer.
66
67 unit=string
68 Time stamp unit
69 Unit must be set in case of relative timestamps
70 Options: years, months, days, hours, minutes, seconds
71
72 increment=string
73 Time increment, works only in conjunction with start option
74 Time increment between maps for creation of valid time intervals
75 (format for absolute time: NNN seconds, minutes, hours, days,
76 weeks, months, years; format for relative time is of type integer:
77 5)
78
79 separator=character
80 Field separator character of the input file
81 Special characters: pipe, comma, space, tab, newline
82 Default: pipe
83
85 The module t.register has double functionality: it either only assigns
86 timestamps to raster, 3D raster and vector maps in the temporal data‐
87 base (if input option is not provided, see below) or additionally, it
88 also registers them within input space time datasets (stds). The exist‐
89 ing timestamp modules r.timestamp, r3.timestamp and v.timestamp do not
90 register the maps in the temporal database of GRASS GIS. However, time‐
91 stamps that have been created with these modules can be read and used
92 by t.register. This works only for maps that are not already registered
93 in the temporal database.
94
95 If the input option is not used (i.e., no stds is provided), maps will
96 be only registered in the temporal database with assigned timestamps.
97 If, on the other hand, the input option is used and a stds is provided,
98 maps will be first registered in the temporal database (if not regis‐
99 tered before) and then, in the stds specified. If the user wants to
100 register maps that are already registered in the temporal database in a
101 different stds, there is no need to pass information regarding start
102 and end time, t.register will read timestamps from the temporal data‐
103 base (i.e., in this case only passing map names will be enough).
104
105 The module t.register supports absolute and relative time. The absolute
106 temporal type refers to a fixed date while the relative temporal type
107 refers to data without fixed timestamps (e.g., sequential maps used to
108 calculate multi-decadal averages).
109
110 Maps can be registered by command line argument (i.e., a list of comma
111 separated map names) or using an input file. The start time, end time
112 and a temporal increment can be provided through command line or in the
113 input file. End time and increment are mutually exclusive. The user can
114 register single maps or a list of maps at once. Maps can be registered
115 in several space time datasets using the same timestamp. For the case
116 of vector time series, the user can also register a single vector map
117 connected to different layers representing time steps using the
118 map:layer notation (See example below).
119
120 The increment option and the -i flag (to create time intervals) work
121 only in conjunction with the start option. If an input file with time‐
122 stamps (either start time or start time and end time) is used, then the
123 increment option and the -i flag are not supported.
124
125 Start time and end time with absolute time must be provided using the
126 format yyyy-mm-dd HH:MM:SS +HHMM. It is also supported to specify only
127 the date yyyy-mm-dd. In case of relative time, the temporal unit
128 (years, months, days, hours, minutes or seconds) must be provided. In
129 this case, the relative start time, end time and increment are inte‐
130 gers.
131
133 The timestamps of registered maps will be stored in the temporal data‐
134 base and in the metadata of the grass maps in the spatial database.
135 This assures that timestamps can always be accessed with (r|r3|v).time‐
136 stamp and the temporal modules. Timestamps should only be modified with
137 t.register because the (r|r3|v).timestamp modules have no access to the
138 temporal database.
139
141 There are several options to register maps by means of a file. The in‐
142 put file consists of a list of map names, optionally along with time‐
143 stamps. Each map name (and timestaps if provided) should be stored in a
144 new line in this file.
145
146 When only map names are provided, the increment option and the -i flag
147 are supported. However, when along with map names any kind of timestamp
148 is provided, as well, the increment option and the -i are no longer
149 supported.
150
151 Specification of map names only (increment option and -i flag sup‐
152 ported):
153 terra_lst_day20020113
154 terra_lst_day20020114
155 terra_lst_day20020115
156 terra_lst_day20020116
157 terra_lst_day20020117
158
159 Specification of map names and absolute start time (date) of the time
160 instances (no support for increment option nor -i flag):
161 terra_lst_day20020113|2002-01-13
162 terra_lst_day20020114|2002-01-14
163 terra_lst_day20020115|2002-01-15
164 terra_lst_day20020116|2002-01-16
165 terra_lst_day20020117|2002-01-17
166
167 Specification of map names and absolute start time (datetime) of the
168 time instances (no support for increment option nor -i flag):
169 terra_lst_day20020113|2002-01-13 10:30
170 terra_lst_day20020114|2002-01-14 10:30
171 terra_lst_day20020115|2002-01-15 10:30
172 terra_lst_day20020116|2002-01-16 10:30
173 terra_lst_day20020117|2002-01-17 10:30
174
175 Specification of map names and absolute time interval with start and
176 end time (no support for increment option nor -i flag):
177 prec_1|2001-01-01|2001-04-01
178 prec_2|2001-04-01|2001-07-01
179 prec_3|2001-07-01|2001-10-01
180 prec_4|2001-10-01|2002-01-01
181 prec_5|2002-01-01|2002-04-01
182 prec_6|2002-04-01|2002-07-01
183
184 Support for semantic labels
185 For more information about semantic labels and image collections see
186 i.band.library module.
187
188 Specification of map names and absolute start time (datetime) of the
189 time instances. The last column indicates related semantic label.
190 T33UYP_20190331T094039_B01|2019-03-31 09:40:39|S2_1
191 T33UYP_20190331T094039_B10|2019-03-31 09:40:39|S2_10
192 T33UYP_20190331T094039_B02|2019-03-31 09:40:39|S2_2
193 T33UYP_20190331T094039_B05|2019-03-31 09:40:39|S2_5
194 T33UYP_20190331T094039_B11|2019-03-31 09:40:39|S2_11
195 T33UYP_20190331T094039_B08|2019-03-31 09:40:39|S2_8
196 T33UYP_20190331T094039_B12|2019-03-31 09:40:39|S2_12
197 T33UYP_20190331T094039_B8A|2019-03-31 09:40:39|S2_8A
198 T33UYP_20190331T094039_B06|2019-03-31 09:40:39|S2_6
199 T33UYP_20190331T094039_B04|2019-03-31 09:40:39|S2_4
200 T33UYP_20190331T094039_B03|2019-03-31 09:40:39|S2_3
201 T33UYP_20190331T094039_B09|2019-03-31 09:40:39|S2_9
202 In this case t.register assigns to given raster maps a semantic label
203 similarly as r.semantic.label does. Such registered raster maps is
204 possible to filter by a semantic label.
205
206 Please note that raster maps with semantic labels assigned can be reg‐
207 istered only in STRDS created in TGIS DB version 3 or higher. Older
208 versions of TGIS DB are not supported. TGIS DB version can be checked
209 t.connect module.
210
212 North Carolina dataset
213 Using a text file
214 Register maps in an absolute space time dataset, creating a time inter‐
215 val
216 # first: prepare a text file with a list of input maps (see above)
217 # second: register maps
218 t.register -i type=raster input=precipitation_monthly \
219 file=list_of_input_maps.txt start="2009-01-01" \
220 increment="1 months"
221
222 Using g.list to generate the input
223 Register maps in an absolute space time dataset, creating a time inter‐
224 val
225 t.register -i type=raster input=precipitation_monthly \
226 maps=`g.list raster pattern="*precip*" sep=comma` start="2009-01-01" \
227 increment="1 months"
228
229 Register a vector map with layers representing time steps
230 Assume a vector map of points that represent meteorological stations
231 and it is connected to different layers depicting daily time steps. In
232 this example, only the fifth layer of the vector map will be regis‐
233 tered.
234 # the layer is specified behind the colon
235 t.register type=vector input=meteo_stations_nc_daily \
236 maps=meteo_stations_nc:5 start="2009-01-05"
237
238 Synthetic maps
239 In this example we create 6 raster maps that will be registered in a
240 single space time raster dataset named precip_abs using a monthly tem‐
241 poral granularity. The -i flag generates time intervals of the provided
242 increment. The generated timestamps will be inspected using r.timestamp
243 and t.rast.list. We will register an additional map with a timestamp
244 that was set with r.timestamp.
245 r.mapcalc expression="prec_1 = 100"
246 r.mapcalc expression="prec_2 = 200"
247 r.mapcalc expression="prec_3 = 300"
248 r.mapcalc expression="prec_4 = 400"
249 r.mapcalc expression="prec_5 = 500"
250 r.mapcalc expression="prec_6 = 600"
251 t.create type=strds temporaltype=absolute \
252 output=precip_abs title="Example" \
253 descr="Example"
254 t.register -i type=raster input=precip_abs \
255 maps=prec_1,prec_2,prec_3,prec_4,prec_5,prec_6 \
256 start="2001-01-01" increment="1 months"
257 r.timestamp prec_1
258 1 Jan 2001 00:00:00 / 1 Feb 2001 00:00:00
259 r.timestamp prec_2
260 1 Feb 2001 00:00:00 / 1 Mar 2001 00:00:00
261 t.rast.list input=precip_abs
262 name|mapset|start_time|end_time
263 prec_1|PERMANENT|2001-01-01 00:00:00|2001-02-01 00:00:00
264 prec_2|PERMANENT|2001-02-01 00:00:00|2001-03-01 00:00:00
265 prec_3|PERMANENT|2001-03-01 00:00:00|2001-04-01 00:00:00
266 prec_4|PERMANENT|2001-04-01 00:00:00|2001-05-01 00:00:00
267 prec_5|PERMANENT|2001-05-01 00:00:00|2001-06-01 00:00:00
268 prec_6|PERMANENT|2001-06-01 00:00:00|2001-07-01 00:00:00
269 r.mapcalc expression="prec_7 = 700"
270 r.timestamp map=prec_7 date="1 jul 2001 / 1 aug 2001"
271 t.register type=raster input=precip_abs maps=prec_7
272 t.rast.list input=precip_abs
273 name|mapset|start_time|end_time
274 prec_1|PERMANENT|2001-01-01 00:00:00|2001-02-01 00:00:00
275 prec_2|PERMANENT|2001-02-01 00:00:00|2001-03-01 00:00:00
276 prec_3|PERMANENT|2001-03-01 00:00:00|2001-04-01 00:00:00
277 prec_4|PERMANENT|2001-04-01 00:00:00|2001-05-01 00:00:00
278 prec_5|PERMANENT|2001-05-01 00:00:00|2001-06-01 00:00:00
279 prec_6|PERMANENT|2001-06-01 00:00:00|2001-07-01 00:00:00
280 prec_7|PERMANENT|2001-07-01 00:00:00|2001-08-01 00:00:00
281
282 Importing and registering ECA&D climatic data
283 The European Climate Assessment & Dataset (ECA&D) project offers the
284 E-OBS dataset which is a daily gridded observational dataset for pre‐
285 cipitation, temperature and sea level pressure in Europe based on ECA&D
286 information. Download and decompress mean temperature data from: here
287 by accepting their Terms of use.
288 # import E-OBS V12 into a lat-long location (alternatively, use r.external)
289 r.in.gdal -oe input=tg_0.25deg_reg_1950-1964_v12.0.nc \
290 output=temperature_mean offset=0
291 r.in.gdal -oe input=tg_0.25deg_reg_1965-1979_v12.0.nc \
292 output=temperature_mean offset=5479 --o
293 r.in.gdal -oe input=tg_0.25deg_reg_1980-1994_v12.0.nc \
294 output=temperature_mean offset=10957 --o
295 r.in.gdal -oe input=tg_0.25deg_reg_1995-2015_v12.0.nc \
296 output=temperature_mean offset=16436 --o
297 # create STRDS
298 t.create type=strds output=temperature_mean_1950_2015_daily \
299 temporaltype=absolute semantictype=mean \
300 title="European mean temperature 1950-2015" \
301 description="The European daily mean temperature from ECAD"
302 # create text file with all temperature_mean rasters, one per line,
303 # a) using a shell script
304 for i in `seq 1 23922` ; do
305 echo temperature_mean.$i >> map_list.txt
306 done
307 # b) using a Python script
308 file = open("map_list.txt", "w")
309 for i in range(23922):
310 file.write("temperature_mean.%i\n" % (i + 1))
311 file.close()
312 # register daily maps using the file created above
313 t.register -i type=raster input=temperature_mean_1950_2015_daily \
314 file=map_list.txt start="1950-01-01" increment="1 days"
315
317 r.timestamp, t.create, t.info
318
319 Maps registration examples in Temporal data processing Wiki
320
322 Sören Gebbert, Thünen Institute of Climate-Smart Agriculture
323
325 Available at: t.register source code (history)
326
327 Accessed: Saturday Jan 21 21:17:04 2023
328
329 Main index | Temporal index | Topics index | Keywords index | Graphical
330 index | Full index
331
332 © 2003-2023 GRASS Development Team, GRASS GIS 8.2.1 Reference Manual
333
334
335
336GRASS 8.2.1 t.register(1)