t.shift.html 7.9 KB

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