t.rast.aggregate.html 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. <h2>DESCRIPTION</h2>
  2. <em>t.rast.aggregate</em> temporally aggregates space time raster datasets by a specific temporal granularity.
  3. This module support <em>absolute</em> and <em>relative time</em>.
  4. The temporal granularity of absolute time can be
  5. <em>seconds, minutes, hours, days, weeks, months</em> or <em>years</em>.
  6. Mixing of granularities eg. "1 year, 3 months 5 days" is not supported.
  7. In case of relative time the temporal unit of the input space time raster
  8. dataset is used. The granularity must be specified with an integer value.
  9. <p>
  10. This module is sensitive to the current region and mask settings, hence spatial extent and spatial resolution.
  11. In case the registered raster maps of the input space time raster dataset
  12. have different spatial resolutions, the default nearest neighbor resampling method is used for
  13. runtime spatial aggregation.
  14. <h2>NOTES</h2>
  15. The raster module <em>r.series</em> is used internally. Hence all aggregate
  16. methods of <em>r.series</em> are supported. See the <a href="r.series.html">r.series</a> manpage
  17. for details.
  18. <p>
  19. This module will shift the start date for each aggregation process depending on the
  20. provided temporal granularity. The following shifts will performed:
  21. <ul>
  22. <li><em>granularity years</em>: will start at the first of January, hence 14-08-2012 00:01:30 will be shifted to 01-01-2012 00:00:00</li>
  23. <li><em>granularity months</em>: will start at the first day of a month, hence 14-08-2012 will be shifted to 01-08-2012 00:00:00</li>
  24. <li><em>granularity weeks</em>: will start at the first day of a week (Monday), hence 14-08-2012 01:30:30 will be shifted to 13-08-2012 01:00:00</li>
  25. <li><em>granularity days</em>: will start at the first hour of a day, hence 14-08-2012 00:01:30 will be shifted to 14-08-2012 00:00:00</li>
  26. <li><em>granularity hours</em>: will start at the first minute of a hour, hence 14-08-2012 01:30:30 will be shifted to 14-08-2012 01:00:00</li>
  27. <li><em>granularity minutes</em>: will start at the first second of a minute, hence 14-08-2012 01:30:30 will be shifted to 14-08-2012 01:30:00</li>
  28. </ul>
  29. <h2>EXAMPLE</h2>
  30. In this example we create 7 raster maps that will be registered in a single space time
  31. raster dataset named <em>precipitation_daily</em> using a daily temporal granularity.
  32. The names of the raster maps are stored in a text file that is used for raster map registration.
  33. <p>
  34. The space time raster dataset <em>precipitation_daily</em> with daily temporal granularity
  35. will be aggregated to weekly precipitation resulting in the output space time raster dataset
  36. <em>precipitation_weekly</em>. The base name of the new generated raster maps is <em>prec_weekly</em>, the
  37. granularity is 1 week. The aggregation method is set to <em>sum</em> to accumulate the precipitation values
  38. of all raster maps in a week. The sampling option assures that only raster maps that are
  39. temporally during a week will be considered for computation:
  40. <div class="code"><pre>
  41. MAPS="map_1 map_2 map_3 map_4 map_5 map_6 map_7"
  42. for map in ${MAPS} ; do
  43. r.mapcalc --o expr="${map} = 1"
  44. echo ${map} >> map_list.txt
  45. done
  46. t.create type=strds temporaltype=absolute \
  47. output=precipitation_daily \
  48. title="Daily precipitation" \
  49. description="Test dataset with daily precipitation"
  50. t.register -i type=rast input=precipitation_daily \
  51. file=map_list.txt start="2012-08-20" increment="1 days"
  52. t.info type=strds input=precipitation_daily
  53. +-------------------- Absolute time -----------------------------------------+
  54. | Start time:................. 2012-09-03 00:00:00
  55. | End time:................... 2012-09-10 00:00:00
  56. | Granularity:................ 1 day
  57. | Temporal type of maps:...... interval
  58. +-------------------- Spatial extent ----------------------------------------+
  59. | North:...................... 80.0
  60. | South:...................... -1.0
  61. | East:.. .................... 120.5
  62. | West:....................... -40.5
  63. | Top:........................ 0.0
  64. | Bottom:..................... 0.0
  65. +-------------------- Metadata information ----------------------------------+
  66. | Raster register table:...... precipitation_daily_test_raster_register
  67. | North-South resolution min:. 1.0
  68. | North-South resolution max:. 1.0
  69. | East-west resolution min:... 1.0
  70. | East-west resolution max:... 1.0
  71. | Minimum value min:.......... 1.0
  72. | Minimum value max:.......... 1.0
  73. | Maximum value min:.......... 1.0
  74. | Maximum value max:.......... 1.0
  75. | Number of registered maps:.. 7
  76. |
  77. | Title:
  78. | Daily precipitation
  79. | Description:
  80. | Test dataset with daily precipitation
  81. | Command history:
  82. | # 2013-07-13 13:10:46
  83. | t.create type="strds" temporaltype="absolute"
  84. | output="precipitation_daily" title="Daily precipitation"
  85. | description="Test dataset with daily precipitation"
  86. | # 2013-07-13 13:10:47
  87. | t.register -i type="rast" input="precipitation_daily"
  88. | file="map_list.txt" start="2012-08-20" increment="1 days"
  89. |
  90. +----------------------------------------------------------------------------+
  91. t.rast.aggregate input=precipitation_daily \
  92. output=precipitation_weekly \
  93. base=prec_weekly granularity="1 weeks" \
  94. method=sum sampling=during
  95. t.support input=precipitation_weekly \
  96. title="Weekly precipitation" \
  97. description="Aggregated precipitation dataset with weekly resolution"
  98. t.info type=strds input=precipitation_weekly
  99. +-------------------- Space Time Raster Dataset -----------------------------+
  100. | |
  101. +-------------------- Basic information -------------------------------------+
  102. | Id: ........................ precipitation_weekly@test
  103. | Name: ...................... precipitation_weekly
  104. | Mapset: .................... test
  105. | Creator: ................... soeren
  106. | Creation time: ............. 2013-07-13 13:11:23.286982
  107. | Temporal type: ............. absolute
  108. | Semantic type:.............. mean
  109. +-------------------- Absolute time -----------------------------------------+
  110. | Start time:................. 2012-09-03 00:00:00
  111. | End time:................... 2012-09-10 00:00:00
  112. | Granularity:................ 7 days
  113. | Temporal type of maps:...... interval
  114. +-------------------- Spatial extent ----------------------------------------+
  115. | North:...................... 80.0
  116. | South:...................... -1.0
  117. | East:.. .................... 120.5
  118. | West:....................... -40.5
  119. | Top:........................ 0.0
  120. | Bottom:..................... 0.0
  121. +-------------------- Metadata information ----------------------------------+
  122. | Raster register table:...... precipitation_weekly_test_raster_register
  123. | North-South resolution min:. 1.0
  124. | North-South resolution max:. 1.0
  125. | East-west resolution min:... 1.0
  126. | East-west resolution max:... 1.0
  127. | Minimum value min:.......... 7.0
  128. | Minimum value max:.......... 7.0
  129. | Maximum value min:.......... 7.0
  130. | Maximum value max:.......... 7.0
  131. | Number of registered maps:.. 1
  132. |
  133. | Title:
  134. | Weekly precipitation
  135. | Description:
  136. | Aggregated precipitation dataset with weekly resolution
  137. | Command history:
  138. | # 2013-07-13 13:11:23
  139. | t.rast.aggregate input="precipitation_daily"
  140. | output="precipitation_weekly" base="prec_weekly" granularity="1 weeks"
  141. | method="sum" sampling="during"
  142. | # 2013-07-13 13:11:29
  143. | t.support input="precipitation_weekly"
  144. | title="Weekly precipitation"
  145. | description="Aggregated precipitation dataset with weekly resolution"
  146. |
  147. +----------------------------------------------------------------------------+
  148. </pre></div>
  149. <h2>SEE ALSO</h2>
  150. <em>
  151. <a href="t.rast.aggregate.ds.html">t.rast.aggregate.ds</a><br>
  152. <a href="t.rast.extract.html">t.rast.extract</a><br>
  153. <a href="t.info.html">t.info</a><br>
  154. <a href="r.series.html">r.series</a><br>
  155. <a href="g.region.html">g.region</a><br>
  156. <a href="r.mask.html">r.mask</a><br>
  157. </em>
  158. <h2>AUTHOR</h2>
  159. S&ouml;ren Gebbert
  160. <p><i>Last changed: $Date$</i>