File: t.shift.html

package info (click to toggle)
grass 8.4.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 277,040 kB
  • sloc: ansic: 460,798; python: 227,732; cpp: 42,026; sh: 11,262; makefile: 7,007; xml: 3,637; sql: 968; lex: 520; javascript: 484; yacc: 450; asm: 387; perl: 157; sed: 25; objc: 6; ruby: 4
file content (198 lines) | stat: -rw-r--r-- 8,053 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
<h2>DESCRIPTION</h2>

<em>t.shift</em> is designed to temporally shift all registered maps in
a space time dataset with a user defined granularity. Raster, 3D raster
and vector space time datasets are supported.
<p>
The format of the absolute time granularity is "number unit". Number is
an integer, unit is the temporal unit that can be one of year(s),
month(s), week(s), day(s), hour(s), minute(s) or second(s).
<p>
The granularity in case of relative time is an integer. The temporal
unit is the unit of the space time dataset and can not be modified.

<h2>NOTES</h2>

Be careful when shifting space time datasets with absolute time. The
temporal granularity may change if you shift a space time dataset with
a unit that is different from the space time dataset granularity. Be
aware that the shifting with months and years may result in incorrect
days per month. Shifting the date 20012-03-31 with a granularity of one
month will result in 2012-04-31 which is incorrect. In this case an
error will raise and the shifting will not performed for the whole
dataset.
<p>
You can use the extraction module to shift only a subset of maps from a
space time dataset. Be aware that the shifting of maps affect all space
time datasets in which they are registered.

<h2>EXAMPLE</h2>

We create 6 raster maps and register them in a space time raster
dataset using an increment of one day. Then we shift the time intervals
with a granularity of 12 hours.

<div class="code"><pre>
r.mapcalc expression="prec_1 = rand(0, 550)" -s
r.mapcalc expression="prec_2 = rand(0, 450)" -s
r.mapcalc expression="prec_3 = rand(0, 320)" -s
r.mapcalc expression="prec_4 = rand(0, 510)" -s
r.mapcalc expression="prec_5 = rand(0, 300)" -s
r.mapcalc expression="prec_6 = rand(0, 650)" -s

t.create type=strds temporaltype=absolute \
         output=precipitation_daily \
         title="Daily precipitation" \
         description="Test dataset with daily precipitation"

t.register -i type=raster input=precipitation_daily \
           maps=prec_1,prec_2,prec_3,prec_4,prec_5,prec_6 \
           start=2012-01-01 increment="1 day"

t.info type=strds input=precipitation_daily

 +-------------------- Space Time Raster Dataset -----------------------------+
 |                                                                            |
 +-------------------- Basic information -------------------------------------+
 | Id: ........................ precipitation_daily@PERMANENT
 | Name: ...................... precipitation_daily
 | Mapset: .................... PERMANENT
 | Creator: ................... soeren
 | Temporal type: ............. absolute
 | Creation time: ............. 2014-11-23 19:20:26.004855
 | Modification time:.......... 2014-11-23 19:20:26.471536
 | Semantic type:.............. mean
 +-------------------- Absolute time -----------------------------------------+
 | Start time:................. 2012-01-01 00:00:00
 | End time:................... 2012-01-07 00:00:00
 | Granularity:................ 1 day
 | Temporal type of maps:...... interval
 +-------------------- Spatial extent ----------------------------------------+
 | North:...................... 80.0
 | South:...................... 0.0
 | East:.. .................... 120.0
 | West:....................... 0.0
 | Top:........................ 0.0
 | Bottom:..................... 0.0
 +-------------------- Metadata information ----------------------------------+
 | Raster register table:...... raster_map_register_882043e9afaa4e60b845aceb1a1fee2c
 | North-South resolution min:. 10.0
 | North-South resolution max:. 10.0
 | East-west resolution min:... 10.0
 | East-west resolution max:... 10.0
 | Minimum value min:.......... 0.0
 | Minimum value max:.......... 16.0
 | Maximum value min:.......... 297.0
 | Maximum value max:.......... 647.0
 | Aggregation type:........... None
 | Number of registered maps:.. 6
 |
 | Title:
 | Daily precipitation
 | Description:
 | Test dataset with daily precipitation
 | Command history:
 | # 2014-11-23 19:20:26
 | t.create type="strds" temporaltype="absolute"
 |     output="precipitation_daily" title="Daily precipitation"
 |     description="Test dataset with daily precipitation"
 | # 2014-11-23 19:20:26
 | t.register -i type="rast" input="precipitation_daily"
 |     maps="prec_1,prec_2,prec_3,prec_4,prec_5,prec_6" start="2012-01-01"
 |     increment="1 day"
 |
 +----------------------------------------------------------------------------+

t.rast.list input=precipitation_daily

name|mapset|start_time|end_time
prec_1|PERMANENT|2012-01-01 00:00:00|2012-01-02 00:00:00
prec_2|PERMANENT|2012-01-02 00:00:00|2012-01-03 00:00:00
prec_3|PERMANENT|2012-01-03 00:00:00|2012-01-04 00:00:00
prec_4|PERMANENT|2012-01-04 00:00:00|2012-01-05 00:00:00
prec_5|PERMANENT|2012-01-05 00:00:00|2012-01-06 00:00:00
prec_6|PERMANENT|2012-01-06 00:00:00|2012-01-07 00:00:00


t.shift type=strds input=precipitation_daily granularity="12 hours"

t.info type=strds input=precipitation_daily

 +-------------------- Space Time Raster Dataset -----------------------------+
 |                                                                            |
 +-------------------- Basic information -------------------------------------+
 | Id: ........................ precipitation_daily@PERMANENT
 | Name: ...................... precipitation_daily
 | Mapset: .................... PERMANENT
 | Creator: ................... soeren
 | Temporal type: ............. absolute
 | Creation time: ............. 2014-11-23 19:20:26.004855
 | Modification time:.......... 2014-11-23 19:21:08.240018
 | Semantic type:.............. mean
 +-------------------- Absolute time -----------------------------------------+
 | Start time:................. 2012-01-01 12:00:00
 | End time:................... 2012-01-07 12:00:00
 | Granularity:................ 24 hours
 | Temporal type of maps:...... interval
 +-------------------- Spatial extent ----------------------------------------+
 | North:...................... 80.0
 | South:...................... 0.0
 | East:.. .................... 120.0
 | West:....................... 0.0
 | Top:........................ 0.0
 | Bottom:..................... 0.0
 +-------------------- Metadata information ----------------------------------+
 | Raster register table:...... raster_map_register_882043e9afaa4e60b845aceb1a1fee2c
 | North-South resolution min:. 10.0
 | North-South resolution max:. 10.0
 | East-west resolution min:... 10.0
 | East-west resolution max:... 10.0
 | Minimum value min:.......... 0.0
 | Minimum value max:.......... 16.0
 | Maximum value min:.......... 297.0
 | Maximum value max:.......... 647.0
 | Aggregation type:........... None
 | Number of registered maps:.. 6
 |
 | Title:
 | Daily precipitation
 | Description:
 | Test dataset with daily precipitation
 | Command history:
 | # 2014-11-23 19:20:26
 | t.create type="strds" temporaltype="absolute"
 |     output="precipitation_daily" title="Daily precipitation"
 |     description="Test dataset with daily precipitation"
 | # 2014-11-23 19:20:26
 | t.register -i type="rast" input="precipitation_daily"
 |     maps="prec_1,prec_2,prec_3,prec_4,prec_5,prec_6" start="2012-01-01"
 |     increment="1 day"
 | # 2014-11-23 19:21:08
 | t.shift type="strds" input="precipitation_daily"
 |     granularity="12 hours"
 |
 +----------------------------------------------------------------------------+


t.rast.list input=precipitation_daily

name|mapset|start_time|end_time
prec_1|PERMANENT|2012-01-01 12:00:00|2012-01-02 12:00:00
prec_2|PERMANENT|2012-01-02 12:00:00|2012-01-03 12:00:00
prec_3|PERMANENT|2012-01-03 12:00:00|2012-01-04 12:00:00
prec_4|PERMANENT|2012-01-04 12:00:00|2012-01-05 12:00:00
prec_5|PERMANENT|2012-01-05 12:00:00|2012-01-06 12:00:00
prec_6|PERMANENT|2012-01-06 12:00:00|2012-01-07 12:00:00
</pre></div>

<h2>SEE ALSO</h2>

<em>
<a href="t.create.html">t.create</a>,
<a href="t.register.html">t.register</a>,
<a href="t.snap.html">t.snap</a>
</em>

<h2>AUTHOR</h2>

S&ouml;ren Gebbert, Th&uuml;nen Institute of Climate-Smart Agriculture