3
<em>t.shift</em> is designed to temporally shift all registered maps in
4
a space time dataset with a user defined granularity. Raster, 3D raster
5
and vector space time datasets are supported.
7
The format of the absolute time granularity is "number unit". Number is
8
an integer, unit is the temporal unit that can be one of year(s),
9
month(s), week(s), day(s), hour(s), minute(s) or second(s).
11
The granularity in case of relative time is an integer. The temporal
12
unit is the unit of the space time dataset and can not be modified.
15
Be careful when shifting space time datasets with absolute time. The
16
temporal granularity may change if you shift a space time dataset with
17
a unit that is different from the space time dataset granularity. Be
18
aware that the shifting with months and years may result in incorrect
19
days per month. Shifting the date 20012-03-31 with a granularity of one
20
month will result in 2012-04-31 which is incorrect. In this case an
21
error will raise and the shifting will not performed for the whole
24
You can use the extraction module to shift only a subset of maps from a
25
space time dataset. Be aware that the shifting of maps affect all space
26
time datasets in which they are registered.
30
We create 6 raster maps and register them in a space time raster
31
dataset using an increment of one day. Then we shift the time intervals
32
with a granularity of 12 hours.
34
<div class="code"><pre>
35
r.mapcalc expr="prec_1 = rand(0, 550)" -s
36
r.mapcalc expr="prec_2 = rand(0, 450)" -s
37
r.mapcalc expr="prec_3 = rand(0, 320)" -s
38
r.mapcalc expr="prec_4 = rand(0, 510)" -s
39
r.mapcalc expr="prec_5 = rand(0, 300)" -s
40
r.mapcalc expr="prec_6 = rand(0, 650)" -s
42
t.create type=strds temporaltype=absolute \
43
output=precipitation_daily \
44
title="Daily precipitation" \
45
description="Test dataset with daily precipitation"
47
t.register -i type=raster input=precipitation_daily \
48
maps=prec_1,prec_2,prec_3,prec_4,prec_5,prec_6 \
49
start=2012-01-01 increment="1 day"
51
t.info type=strds input=precipitation_daily
53
+-------------------- Space Time Raster Dataset -----------------------------+
55
+-------------------- Basic information -------------------------------------+
56
| Id: ........................ precipitation_daily@PERMANENT
57
| Name: ...................... precipitation_daily
58
| Mapset: .................... PERMANENT
59
| Creator: ................... soeren
60
| Temporal type: ............. absolute
61
| Creation time: ............. 2014-11-23 19:20:26.004855
62
| Modification time:.......... 2014-11-23 19:20:26.471536
63
| Semantic type:.............. mean
64
+-------------------- Absolute time -----------------------------------------+
65
| Start time:................. 2012-01-01 00:00:00
66
| End time:................... 2012-01-07 00:00:00
67
| Granularity:................ 1 day
68
| Temporal type of maps:...... interval
69
+-------------------- Spatial extent ----------------------------------------+
70
| North:...................... 80.0
71
| South:...................... 0.0
72
| East:.. .................... 120.0
73
| West:....................... 0.0
74
| Top:........................ 0.0
75
| Bottom:..................... 0.0
76
+-------------------- Metadata information ----------------------------------+
77
| Raster register table:...... raster_map_register_882043e9afaa4e60b845aceb1a1fee2c
78
| North-South resolution min:. 10.0
79
| North-South resolution max:. 10.0
80
| East-west resolution min:... 10.0
81
| East-west resolution max:... 10.0
82
| Minimum value min:.......... 0.0
83
| Minimum value max:.......... 16.0
84
| Maximum value min:.......... 297.0
85
| Maximum value max:.......... 647.0
86
| Aggregation type:........... None
87
| Number of registered maps:.. 6
92
| Test dataset with daily precipitation
94
| # 2014-11-23 19:20:26
95
| t.create type="strds" temporaltype="absolute"
96
| output="precipitation_daily" title="Daily precipitation"
97
| description="Test dataset with daily precipitation"
98
| # 2014-11-23 19:20:26
99
| t.register -i type="rast" input="precipitation_daily"
100
| maps="prec_1,prec_2,prec_3,prec_4,prec_5,prec_6" start="2012-01-01"
103
+----------------------------------------------------------------------------+
105
t.rast.list input=precipitation_daily
107
name|mapset|start_time|end_time
108
prec_1|PERMANENT|2012-01-01 00:00:00|2012-01-02 00:00:00
109
prec_2|PERMANENT|2012-01-02 00:00:00|2012-01-03 00:00:00
110
prec_3|PERMANENT|2012-01-03 00:00:00|2012-01-04 00:00:00
111
prec_4|PERMANENT|2012-01-04 00:00:00|2012-01-05 00:00:00
112
prec_5|PERMANENT|2012-01-05 00:00:00|2012-01-06 00:00:00
113
prec_6|PERMANENT|2012-01-06 00:00:00|2012-01-07 00:00:00
116
t.shift type=strds input=precipitation_daily granularity="12 hours"
118
t.info type=strds input=precipitation_daily
120
+-------------------- Space Time Raster Dataset -----------------------------+
122
+-------------------- Basic information -------------------------------------+
123
| Id: ........................ precipitation_daily@PERMANENT
124
| Name: ...................... precipitation_daily
125
| Mapset: .................... PERMANENT
126
| Creator: ................... soeren
127
| Temporal type: ............. absolute
128
| Creation time: ............. 2014-11-23 19:20:26.004855
129
| Modification time:.......... 2014-11-23 19:21:08.240018
130
| Semantic type:.............. mean
131
+-------------------- Absolute time -----------------------------------------+
132
| Start time:................. 2012-01-01 12:00:00
133
| End time:................... 2012-01-07 12:00:00
134
| Granularity:................ 24 hours
135
| Temporal type of maps:...... interval
136
+-------------------- Spatial extent ----------------------------------------+
137
| North:...................... 80.0
138
| South:...................... 0.0
139
| East:.. .................... 120.0
140
| West:....................... 0.0
141
| Top:........................ 0.0
142
| Bottom:..................... 0.0
143
+-------------------- Metadata information ----------------------------------+
144
| Raster register table:...... raster_map_register_882043e9afaa4e60b845aceb1a1fee2c
145
| North-South resolution min:. 10.0
146
| North-South resolution max:. 10.0
147
| East-west resolution min:... 10.0
148
| East-west resolution max:... 10.0
149
| Minimum value min:.......... 0.0
150
| Minimum value max:.......... 16.0
151
| Maximum value min:.......... 297.0
152
| Maximum value max:.......... 647.0
153
| Aggregation type:........... None
154
| Number of registered maps:.. 6
157
| Daily precipitation
159
| Test dataset with daily precipitation
161
| # 2014-11-23 19:20:26
162
| t.create type="strds" temporaltype="absolute"
163
| output="precipitation_daily" title="Daily precipitation"
164
| description="Test dataset with daily precipitation"
165
| # 2014-11-23 19:20:26
166
| t.register -i type="rast" input="precipitation_daily"
167
| maps="prec_1,prec_2,prec_3,prec_4,prec_5,prec_6" start="2012-01-01"
169
| # 2014-11-23 19:21:08
170
| t.shift type="strds" input="precipitation_daily"
171
| granularity="12 hours"
173
+----------------------------------------------------------------------------+
176
t.rast.list input=precipitation_daily
178
name|mapset|start_time|end_time
179
prec_1|PERMANENT|2012-01-01 12:00:00|2012-01-02 12:00:00
180
prec_2|PERMANENT|2012-01-02 12:00:00|2012-01-03 12:00:00
181
prec_3|PERMANENT|2012-01-03 12:00:00|2012-01-04 12:00:00
182
prec_4|PERMANENT|2012-01-04 12:00:00|2012-01-05 12:00:00
183
prec_5|PERMANENT|2012-01-05 12:00:00|2012-01-06 12:00:00
184
prec_6|PERMANENT|2012-01-06 12:00:00|2012-01-07 12:00:00
190
<a href="t.create.html">t.create</a>,
191
<a href="t.register.html">t.register</a>,
192
<a href="t.snap.html">t.snap</a>
197
Sören Gebbert, Thünen Institute of Climate-Smart Agriculture
199
<p><i>Last changed: $Date: 2014-12-27 00:50:11 +0100 (Sat, 27 Dec 2014) $</i>