Debian Codegraph @

temporal/t.rast.accumulate/t.rast.accumulate.html

raw
1 <h2>DESCRIPTION</h2>
2
3 <em>t.rast.accumulate</em> is designed to perform temporal accumulations
4 of space time raster datasets.
5
6 This module expects a space time raster dataset as input that will be
7 sampled by a given <b>granularity</b>. All maps that have the start
8 time during the actual granule will be accumulated with the predecessor
9 granule accumulation result using the raster module
10 <a href="r.series.accumulate.html">r.series.accumulate</a>. The default
11 granularity is 1 day, but any temporal granularity can be set.
12
13 <p>
14 The <b>start</b> time and the <b>end</b> time of the accumulation
15 process must be set, eg. <b>start="2000-03-01" end="2011-01-01"</b>. In
16 addition, a <b>cycle</b>, eg. <b>cycle="8 months"</b>, can be specified,
17 that defines after which interval of time the accumulation process
18 restarts. The <b>offset</b> option specifies the time that should be
19 skipped between two cycles, eg. <b>offset="4 months"</b>.
20
21 <p>
22 The <b>lower</b> and <b>upper</b> <b>limits</b> of the accumulation
23 process can be set, either by using space time raster datasets or by
24 using fixed values for all raster cells and time steps. The raster
25 maps that specify the lower and upper limits of the actual granule
26 will be detected using the following temporal relations: equals,
27 during, overlaps, overlapped and contains. First, all maps with time
28 stamps equal to the current granule will be detected, the first lower
29 map and the first upper map found will be used as limit definitions.
30 If no equal maps are found, then maps with a temporal during relation
31 are detected, then maps that temporally overlap the actual granules,
32 until maps that have a temporal contain relation are detected. If no
33 maps are found or lower/upper STRDS are not defined, then the
34 <b>limits</b> option is used, eg. <b>limits=10,30</b>.
35
36 <p>
37 The <b>upper</b> <b>limit</b> is only used in the Biologically
38 Effective Degree Days calculation.
39
40 <p>
41 The options <b>shift</b>, <b>scale</b> and <b>method</b> are passed to
42 <a href="r.series.accumulate.html">r.series.accumulate</a>.
43 Please refer to the manual page of
44 <a href="r.series.accumulate.html">r.series.accumulate</a> for detailed
45 option description.
46
47 <p>
48 The <b>output</b> is a new space time raster dataset with the provided
49 start time, end time and granularity containing the accumulated raster
50 maps. The <b>base</b> name of the generated maps must always be set.
51 The <b>output</b> space time raster dataset can then be analyzed using
52 <a href="t.rast.accdetect.html">t.rast.accdetect</a> to detect specific
53 accumulation patterns.
54
55 <h2>EXAMPLE</h2>
56
57 This is an example how to accumulate the daily mean temperature of
58 Europe from 1990 to 2000 using the growing-degree-day method to detect
59 grass hopper reproduction cycles that are critical to agriculture.
60
61 <div class="code"><pre>
62 # Get the temperature data
63 wget http://www-pool.math.tu-berlin.de/~soeren/grass/temperature_mean_1990_2000_daily_celsius.tar.gz
64
65 # Create a temporary project directory
66 mkdir -p /tmp/grassdata/LL
67
68 # Start GRASS and create a new project with PERMANENT mapset
69 grass -c EPSG:4326 /tmp/grassdata/LL/PERMANENT
70
71 # Import the temperature data
72 t.rast.import input=temperature_mean_1990_2000_daily_celsius.tar.gz \
73 output=temperature_mean_1990_2000_daily_celsius directory=/tmp
74
75 # We need to set the region correctly
76 g.region -p raster=`t.rast.list input=temperature_mean_1990_2000_daily_celsius column=name | tail -1`
77 # We can zoom to the raster map
78 g.region -p zoom=`t.rast.list input=temperature_mean_1990_2000_daily_celsius column=name | tail -1`
79
80 #############################################################################
81 #### ACCUMULATION USING GDD METHOD ##########################################
82 #############################################################################
83 # The computation of grashopper pest control cycles is based on:
84 #
85 # Using Growing Degree Days For Insect Management
86 # Nancy E. Adams
87 # Extension Educator, Agricultural Resources
88 #
89 # available here: http://extension.unh.edu/agric/gddays/docs/growch.pdf
90
91 # Now we compute the Biologically Effective Degree Days
92 # from 1990 - 2000 for each year (12 month cycle) with
93 # a granularity of one day. Base temperature is 10&deg;C, upper limit is 30&deg;C.
94 # Hence the accumulation starts at 10&deg;C and does not accumulate values above 30&deg;C.
95 t.rast.accumulate input="temperature_mean_1990_2000_daily_celsius" \
96 output="temperature_mean_1990_2000_daily_celsius_accumulated_10_30" \
97 limits="10,30" start="1990-01-01" stop="2000-01-01" cycle="12 months" \
98 basename="temp_acc_daily_10_30" method="bedd"
99
100 #############################################################################
101 #### ACCUMULATION PATTERN DETECTION #########################################
102 #############################################################################
103 # Now we detect the three grasshopper pest control cycles
104
105 # First cycle at 325&deg;C - 427&deg;C GDD
106 t.rast.accdetect input=temperature_mean_1990_2000_daily_celsius_accumulated_10_30@PERMANENT \
107 occ=leafhopper_occurrence_c1_1990_2000 start="1990-01-01" stop="2000-01-01" \
108 cycle="12 months" range=325,427 basename=lh_c1 indicator=leafhopper_indicator_c1_1990_2000
109
110 # Second cycle at 685&deg;C - 813&deg;C GDD
111 t.rast.accdetect input=temperature_mean_1990_2000_daily_celsius_accumulated_10_30@PERMANENT \
112 occ=leafhopper_occurrence_c2_1990_2000 start="1990-01-01" stop="2000-01-01" \
113 cycle="12 months" range=685,813 basename=lh_c2 indicator=leafhopper_indicator_c2_1990_2000
114
115 # Third cycle at 1047&deg;C - 1179&deg;C GDD
116 t.rast.accdetect input=temperature_mean_1990_2000_daily_celsius_accumulated_10_30@PERMANENT \
117 occ=leafhopper_occurrence_c3_1990_2000 start="1990-01-01" stop="2000-01-01" \
118 cycle="12 months" range=1047,1179 basename=lh_c3 indicator=leafhopper_indicator_c3_1990_2000
119
120
121 #############################################################################
122 #### YEARLY SPATIAL OCCURRENCE COMPUTATION OF ALL CYCLES ####################
123 #############################################################################
124
125 # Extract the areas that have full cycles
126 t.rast.aggregate input=leafhopper_indicator_c1_1990_2000 gran="1 year" \
127 output=leafhopper_cycle_1_1990_2000_yearly method=maximum basename=li_c1
128
129 t.rast.mapcalc input=leafhopper_cycle_1_1990_2000_yearly basename=lh_clean_c1 \
130 output=leafhopper_cycle_1_1990_2000_yearly_clean \
131 expression="if(leafhopper_cycle_1_1990_2000_yearly == 3, 1, null())"
132
133 t.rast.aggregate input=leafhopper_indicator_c2_1990_2000 gran="1 year" \
134 output=leafhopper_cycle_2_1990_2000_yearly method=maximum basename=li_c2
135
136 t.rast.mapcalc input=leafhopper_cycle_2_1990_2000_yearly basename=lh_clean_c2 \
137 output=leafhopper_cycle_2_1990_2000_yearly_clean \
138 expression="if(leafhopper_cycle_2_1990_2000_yearly == 3, 2, null())"
139
140 t.rast.aggregate input=leafhopper_indicator_c3_1990_2000 gran="1 year" \
141 output=leafhopper_cycle_3_1990_2000_yearly method=maximum basename=li_c3
142
143 t.rast.mapcalc input=leafhopper_cycle_3_1990_2000_yearly basename=lh_clean_c3 \
144 output=leafhopper_cycle_3_1990_2000_yearly_clean \
145 expression="if(leafhopper_cycle_3_1990_2000_yearly == 3, 3, null())"
146
147
148 t.rast.mapcalc input=leafhopper_cycle_1_1990_2000_yearly_clean,leafhopper_cycle_2_1990_2000_yearly_clean,leafhopper_cycle_3_1990_2000_yearly_clean \
149 basename=lh_cleann_all_cycles \
150 output=leafhopper_all_cycles_1990_2000_yearly_clean \
151 expression="if(isnull(leafhopper_cycle_3_1990_2000_yearly_clean), \
152 if(isnull(leafhopper_cycle_2_1990_2000_yearly_clean), \
153 if(isnull(leafhopper_cycle_1_1990_2000_yearly_clean), \
154 null() ,1),2),3)"
155
156 cat &gt; color.table &lt;&lt; EOF
157 3 yellow
158 2 blue
159 1 red
160 EOF
161
162 t.rast.colors input=leafhopper_cycle_1_1990_2000_yearly_clean rules=color.table
163 t.rast.colors input=leafhopper_cycle_2_1990_2000_yearly_clean rules=color.table
164 t.rast.colors input=leafhopper_cycle_3_1990_2000_yearly_clean rules=color.table
165 t.rast.colors input=leafhopper_all_cycles_1990_2000_yearly_clean rules=color.table
166
167 #############################################################################
168 ################ DURATION COMPUTATION #######################################
169 #############################################################################
170
171 # Extract the duration in days of the first cycle
172 t.rast.aggregate input=leafhopper_occurrence_c1_1990_2000 gran="1 year" \
173 output=leafhopper_min_day_c1_1990_2000 method=minimum basename=occ_min_day_c1
174 t.rast.aggregate input=leafhopper_occurrence_c1_1990_2000 gran="1 year" \
175 output=leafhopper_max_day_c1_1990_2000 method=maximum basename=occ_max_day_c1
176 t.rast.mapcalc input=leafhopper_min_day_c1_1990_2000,leafhopper_max_day_c1_1990_2000 \
177 basename=occ_duration_c1 \
178 output=leafhopper_duration_c1_1990_2000 \
179 expression="leafhopper_max_day_c1_1990_2000 - leafhopper_min_day_c1_1990_2000"
180
181
182 # Extract the duration in days of the second cycle
183 t.rast.aggregate input=leafhopper_occurrence_c2_1990_2000 gran="1 year" \
184 output=leafhopper_min_day_c2_1990_2000 method=minimum basename=occ_min_day_c2
185 t.rast.aggregate input=leafhopper_occurrence_c2_1990_2000 gran="1 year" \
186 output=leafhopper_max_day_c2_1990_2000 method=maximum basename=occ_max_day_c2
187 t.rast.mapcalc input=leafhopper_min_day_c2_1990_2000,leafhopper_max_day_c2_1990_2000 \
188 basename=occ_duration_c2 \
189 output=leafhopper_duration_c2_1990_2000 \
190 expression="leafhopper_max_day_c2_1990_2000 - leafhopper_min_day_c2_1990_2000"
191
192
193 # Extract the duration in days of the third cycle
194 t.rast.aggregate input=leafhopper_occurrence_c3_1990_2000 gran="1 year" \
195 output=leafhopper_min_day_c3_1990_2000 method=minimum basename=occ_min_day_c3
196 t.rast.aggregate input=leafhopper_occurrence_c3_1990_2000 gran="1 year" \
197 output=leafhopper_max_day_c3_1990_2000 method=maximum basename=occ_max_day_c3
198 t.rast.mapcalc input=leafhopper_min_day_c3_1990_2000,leafhopper_max_day_c3_1990_2000 \
199 basename=occ_duration_c3 \
200 output=leafhopper_duration_c3_1990_2000 \
201 expression="leafhopper_max_day_c3_1990_2000 - leafhopper_min_day_c3_1990_2000"
202
203 t.rast.colors input=leafhopper_duration_c1_1990_2000 color=rainbow
204 t.rast.colors input=leafhopper_duration_c2_1990_2000 color=rainbow
205 t.rast.colors input=leafhopper_duration_c3_1990_2000 color=rainbow
206
207 #############################################################################
208 ################ MONTHLY CYCLES OCCURRENCE ##################################
209 #############################################################################
210
211 # Extract the monthly indicator that shows the start and end of a cycle
212
213 # First cycle
214 t.rast.aggregate input=leafhopper_indicator_c1_1990_2000 gran="1 month" \
215 output=leafhopper_indi_min_month_c1_1990_2000 method=minimum basename=occ_indi_min_month_c1
216 t.rast.aggregate input=leafhopper_indicator_c1_1990_2000 gran="1 month" \
217 output=leafhopper_indi_max_month_c1_1990_2000 method=maximum basename=occ_indi_max_month_c1
218 t.rast.mapcalc input=leafhopper_indi_min_month_c1_1990_2000,leafhopper_indi_max_month_c1_1990_2000 \
219 basename=indicator_monthly_c1 \
220 output=leafhopper_monthly_indicator_c1_1990_2000 \
221 expression="if(leafhopper_indi_min_month_c1_1990_2000 == 1, 1, if(leafhopper_indi_max_month_c1_1990_2000 == 3, 3, 2))"
222
223 # Second cycle
224 t.rast.aggregate input=leafhopper_indicator_c2_1990_2000 gran="1 month" \
225 output=leafhopper_indi_min_month_c2_1990_2000 method=minimum basename=occ_indi_min_month_c2
226 t.rast.aggregate input=leafhopper_indicator_c2_1990_2000 gran="1 month" \
227 output=leafhopper_indi_max_month_c2_1990_2000 method=maximum basename=occ_indi_max_month_c2
228 t.rast.mapcalc input=leafhopper_indi_min_month_c2_1990_2000,leafhopper_indi_max_month_c2_1990_2000 \
229 basename=indicator_monthly_c2 \
230 output=leafhopper_monthly_indicator_c2_1990_2000 \
231 expression="if(leafhopper_indi_min_month_c2_1990_2000 == 1, 1, if(leafhopper_indi_max_month_c2_1990_2000 == 3, 3, 2))"
232
233 # Third cycle
234 t.rast.aggregate input=leafhopper_indicator_c3_1990_2000 gran="1 month" \
235 output=leafhopper_indi_min_month_c3_1990_2000 method=minimum basename=occ_indi_min_month_c3
236 t.rast.aggregate input=leafhopper_indicator_c3_1990_2000 gran="1 month" \
237 output=leafhopper_indi_max_month_c3_1990_2000 method=maximum basename=occ_indi_max_month_c3
238 t.rast.mapcalc input=leafhopper_indi_min_month_c3_1990_2000,leafhopper_indi_max_month_c3_1990_2000 \
239 basename=indicator_monthly_c3 \
240 output=leafhopper_monthly_indicator_c3_1990_2000 \
241 expression="if(leafhopper_indi_min_month_c3_1990_2000 == 1, 1, if(leafhopper_indi_max_month_c3_1990_2000 == 3, 3, 2))"
242
243 cat &gt; color.table &lt;&lt; EOF
244 3 red
245 2 yellow
246 1 green
247 EOF
248
249 t.rast.colors input=leafhopper_monthly_indicator_c1_1990_2000 rules=color.table
250 t.rast.colors input=leafhopper_monthly_indicator_c2_1990_2000 rules=color.table
251 t.rast.colors input=leafhopper_monthly_indicator_c3_1990_2000 rules=color.table
252
253 #############################################################################
254 ################ VISUALIZATION ##############################################
255 #############################################################################
256 # Now we use g.gui.animation to visualize the yearly occurrence, the duration and the monthly occurrence
257
258 # Yearly occurrence of all reproduction cycles
259 g.gui.animation strds=leafhopper_all_cycles_1990_2000_yearly_clean
260
261 # Yearly duration of reproduction cycle 1
262 g.gui.animation strds=leafhopper_duration_c1_1990_2000
263 # Yearly duration of reproduction cycle 2
264 g.gui.animation strds=leafhopper_duration_c2_1990_2000
265 # Yearly duration of reproduction cycle 3
266 g.gui.animation strds=leafhopper_duration_c3_1990_2000
267
268 # Monthly occurrence of reproduction cycle 1
269 g.gui.animation strds=leafhopper_monthly_indicator_c1_1990_2000
270 # Monthly occurrence of reproduction cycle 2
271 g.gui.animation strds=leafhopper_monthly_indicator_c2_1990_2000
272 # Monthly occurrence of reproduction cycle 3
273 g.gui.animation strds=leafhopper_monthly_indicator_c3_1990_2000
274 </pre></div>
275
276 <h2>REFERENCES</h2>
277
278 <ul>
279 <li> Jones, G.V., Duff, A.A., Hall, A., Myers, J.W., 2010.
280 Spatial Analysis of Climate in Winegrape Growing Regions in the
281 Western United States. Am. J. Enol. Vitic. 61, 313-326.</li>
282 </ul>
283
284 <h2>SEE ALSO</h2>
285
286 <em>
287 <a href="t.rast.accdetect.html">t.rast.accdetect</a>,
288 <a href="t.rast.aggregate.html">t.rast.aggregate</a>,
289 <a href="t.rast.mapcalc.html">t.rast.mapcalc</a>,
290 <a href="t.info.html">t.info</a>,
291 <a href="g.region.html">g.region</a>,
292 <a href="r.series.accumulate.html">r.series.accumulate</a>
293 </em>
294
295 <h2>AUTHOR</h2>
296
297 S&ouml;ren Gebbert, Th&uuml;nen Institute of Climate-Smart Agriculture