1t.rast.accumulate(1)        GRASS GIS User's Manual       t.rast.accumulate(1)
2
3
4

NAME

6       t.rast.accumulate   -  Computes  cyclic  accumulations  of a space time
7       raster dataset.
8

KEYWORDS

10       temporal, accumulation, raster, time
11

SYNOPSIS

13       t.rast.accumulate
14       t.rast.accumulate --help
15       t.rast.accumulate [-nr]  input=name  output=name   [lower=name]    [up‐
16       per=name]   start=string   [stop=string]  cycle=string  [offset=string]
17       [granularity=string]     basename=string      [suffix=string]      lim‐
18       its=lower,upper     [scale=float]     [shift=float]     [method=string]
19       [--overwrite]  [--help]  [--verbose]  [--quiet]  [--ui]
20
21   Flags:
22       -n
23           Register empty maps in the output space time raster dataset, other‐
24           wise they will be deleted
25
26       -r
27           Reverse time direction in cyclic accumulation
28
29       --overwrite
30           Allow output files to overwrite existing files
31
32       --help
33           Print usage summary
34
35       --verbose
36           Verbose module output
37
38       --quiet
39           Quiet module output
40
41       --ui
42           Force launching GUI dialog
43
44   Parameters:
45       input=name [required]
46           Name of the input space time raster dataset
47
48       output=name [required]
49           Name of the output space time raster dataset
50
51       lower=name
52           Input  space  time raster dataset that defines the lower threshold,
53           values lower than this threshold are excluded from accumulation
54
55       upper=name
56           Input space time raster dataset that defines the  upper  threshold,
57           values higher than this threshold are excluded from accumulation
58
59       start=string [required]
60           The   temporal   starting  point  to  begin  the  accumulation,  eg
61           ’2001-01-01’
62
63       stop=string
64           The temporal date to stop the accumulation, eg ’2009-01-01’
65
66       cycle=string [required]
67           The temporal cycle to restart the accumulation, eg ’12 months’
68
69       offset=string
70           The temporal offset to the beginning  of  the  next  cycle,  eg  ’6
71           months’
72
73       granularity=string
74           The granularity for accumulation ’1 day’
75           Default: 1 day
76
77       basename=string [required]
78           Basename of the new generated output maps
79           A  numerical  suffix separated by an underscore will be attached to
80           create a unique identifier
81
82       suffix=string
83           Suffix to add to the basename. Set ’gran’ for  granularity,  ’time’
84           for  the  full  time format, ’num’ for numerical suffix with a spe‐
85           cific number of digits (default %05)
86           Default: gran
87
88       limits=lower,upper [required]
89           Use these limits in case lower and/or upper input space time raster
90           datasets are not defined or contain NULL values
91
92       scale=float
93           Scale factor for input space time raster dataset
94
95       shift=float
96           Shift factor for input space time raster dataset
97
98       method=string
99           This method will be applied to compute the accumulative values from
100           the input maps in a single granule
101           Growing Degree Days or Winkler indices; Mean: sum(input maps)/(num‐
102           ber  of input maps); Biologically Effective Degree Days; Huglin He‐
103           liothermal index
104           Options: mean, gdd, bedd, huglin
105           Default: mean
106

DESCRIPTION

108       t.rast.accumulate is designed  to  perform  temporal  accumulations  of
109       space  time  raster  datasets.  This module expects a space time raster
110       dataset as input that will be sampled by a given granularity. All  maps
111       that  have the start time during the actual granule will be accumulated
112       with the predecessor granule accumulation result using the raster  mod‐
113       ule r.series.accumulate. The default granularity is 1 day, but any tem‐
114       poral granularity can be set.
115
116       The start time and the end time of the  accumulation  process  must  be
117       set, eg. start="2000-03-01" end="2011-01-01". In addition, a cycle, eg.
118       cycle="8 months", can be specified, that defines after  which  interval
119       of  time the accumulation process restarts. The offset option specifies
120       the time that should be  skipped  between  two  cycles,  eg.  offset="4
121       months".
122
123       The  lower and upper limits of the accumulation process can be set, ei‐
124       ther by using space time raster datasets or by using fixed  values  for
125       all raster cells and time steps. The raster maps that specify the lower
126       and upper limits of the actual granule will be detected using the  fol‐
127       lowing  temporal  relations:  equals,  during, overlaps, overlapped and
128       contains. First, all maps with time stamps equal to the current granule
129       will  be  detected,  the  first lower map and the first upper map found
130       will be used as limit definitions.  If no equal maps  are  found,  then
131       maps  with a temporal during relation are detected, then maps that tem‐
132       porally overlap the actual granules, until maps that  have  a  temporal
133       contain  relation  are  detected.  If  no maps are found or lower/upper
134       STRDS are not defined,  then  the  limits  option  is  used,  eg.  lim‐
135       its=10,30.
136
137       The  upper limit is only used in the Biologically Effective Degree Days
138       calculation.
139
140       The options shift, scale and method are passed to  r.series.accumulate.
141       Please refer to the manual page of r.series.accumulate for detailed op‐
142       tion description.
143
144       The output is a new space time raster dataset with the  provided  start
145       time,  end time and granularity containing the accumulated raster maps.
146       The base name of the generated maps must always  be  set.   The  output
147       space  time  raster dataset can then be analyzed using t.rast.accdetect
148       to detect specific accumulation patterns.
149

EXAMPLE

151       This is an example how to accumulate the daily mean temperature of  Eu‐
152       rope  from  1990  to 2000 using the growing-degree-day method to detect
153       grass hopper reproduction cycles that are critical to agriculture.
154       # Get the temperature data
155       wget http://www-pool.math.tu-berlin.de/~soeren/grass/temperature_mean_1990_2000_daily_celsius.tar.gz
156       # Create a temporary location directory
157       mkdir -p /tmp/grassdata/LL
158       # Start GRASS and create a new location with PERMANENT mapset
159       grass -c EPSG:4326 /tmp/grassdata/LL/PERMANENT
160       # Import the temperature data
161       t.rast.import input=temperature_mean_1990_2000_daily_celsius.tar.gz \
162             output=temperature_mean_1990_2000_daily_celsius directory=/tmp
163       # We need to set the region correctly
164       g.region -p raster=`t.rast.list input=temperature_mean_1990_2000_daily_celsius column=name | tail -1`
165       # We can zoom to the raster map
166       g.region -p zoom=`t.rast.list input=temperature_mean_1990_2000_daily_celsius column=name | tail -1`
167       #############################################################################
168       #### ACCUMULATION USING GDD METHOD ##########################################
169       #############################################################################
170       # The computation of grashopper pest control cycles is based on:
171       #
172       #   Using Growing Degree Days For Insect Management
173       #   Nancy E. Adams
174       #   Extension Educator, Agricultural Resources
175       #
176       # available here: http://extension.unh.edu/agric/gddays/docs/growch.pdf
177       # Now we compute the Biologically Effective Degree Days
178       # from 1990 - 2000 for each year (12 month cycle) with
179       # a granularity of one day. Base temperature is 10°C, upper limit is 30°C.
180       # Hence the accumulation starts at 10°C and does not accumulate values above 30°C.
181       t.rast.accumulate input="temperature_mean_1990_2000_daily_celsius" \
182             output="temperature_mean_1990_2000_daily_celsius_accumulated_10_30" \
183             limits="10,30" start="1990-01-01" stop="2000-01-01" cycle="12 months" \
184             basename="temp_acc_daily_10_30" method="bedd"
185       #############################################################################
186       #### ACCUMULATION PATTERN DETECTION #########################################
187       #############################################################################
188       # Now we detect the three grasshopper pest control cycles
189       # First cycle at 325°C - 427°C GDD
190       t.rast.accdetect input=temperature_mean_1990_2000_daily_celsius_accumulated_10_30@PERMANENT \
191             occ=leafhopper_occurrence_c1_1990_2000 start="1990-01-01" stop="2000-01-01" \
192             cycle="12 months" range=325,427 basename=lh_c1 indicator=leafhopper_indicator_c1_1990_2000
193       # Second cycle at 685°C - 813°C GDD
194       t.rast.accdetect input=temperature_mean_1990_2000_daily_celsius_accumulated_10_30@PERMANENT \
195             occ=leafhopper_occurrence_c2_1990_2000 start="1990-01-01" stop="2000-01-01" \
196             cycle="12 months" range=685,813 basename=lh_c2 indicator=leafhopper_indicator_c2_1990_2000
197       # Third cycle at 1047°C - 1179°C GDD
198       t.rast.accdetect input=temperature_mean_1990_2000_daily_celsius_accumulated_10_30@PERMANENT \
199             occ=leafhopper_occurrence_c3_1990_2000 start="1990-01-01" stop="2000-01-01" \
200             cycle="12 months" range=1047,1179 basename=lh_c3 indicator=leafhopper_indicator_c3_1990_2000
201       #############################################################################
202       #### YEARLY SPATIAL OCCURRENCE COMPUTATION OF ALL CYCLES ####################
203       #############################################################################
204       # Extract the areas that have full cycles
205       t.rast.aggregate input=leafhopper_indicator_c1_1990_2000 gran="1 year" \
206             output=leafhopper_cycle_1_1990_2000_yearly method=maximum basename=li_c1
207       t.rast.mapcalc input=leafhopper_cycle_1_1990_2000_yearly basename=lh_clean_c1 \
208                      output=leafhopper_cycle_1_1990_2000_yearly_clean \
209                      expression="if(leafhopper_cycle_1_1990_2000_yearly == 3, 1, null())"
210       t.rast.aggregate input=leafhopper_indicator_c2_1990_2000 gran="1 year" \
211             output=leafhopper_cycle_2_1990_2000_yearly method=maximum basename=li_c2
212       t.rast.mapcalc input=leafhopper_cycle_2_1990_2000_yearly basename=lh_clean_c2 \
213                      output=leafhopper_cycle_2_1990_2000_yearly_clean \
214                      expression="if(leafhopper_cycle_2_1990_2000_yearly == 3, 2, null())"
215       t.rast.aggregate input=leafhopper_indicator_c3_1990_2000 gran="1 year" \
216             output=leafhopper_cycle_3_1990_2000_yearly method=maximum basename=li_c3
217       t.rast.mapcalc input=leafhopper_cycle_3_1990_2000_yearly basename=lh_clean_c3 \
218                      output=leafhopper_cycle_3_1990_2000_yearly_clean \
219                      expression="if(leafhopper_cycle_3_1990_2000_yearly == 3, 3, null())"
220       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 \
221                      basename=lh_cleann_all_cycles \
222                      output=leafhopper_all_cycles_1990_2000_yearly_clean \
223                      expression="if(isnull(leafhopper_cycle_3_1990_2000_yearly_clean), \
224                     if(isnull(leafhopper_cycle_2_1990_2000_yearly_clean), \
225                  if(isnull(leafhopper_cycle_1_1990_2000_yearly_clean), \
226                  null() ,1),2),3)"
227       cat > color.table << EOF
228       3 yellow
229       2 blue
230       1 red
231       EOF
232       t.rast.colors input=leafhopper_cycle_1_1990_2000_yearly_clean rules=color.table
233       t.rast.colors input=leafhopper_cycle_2_1990_2000_yearly_clean rules=color.table
234       t.rast.colors input=leafhopper_cycle_3_1990_2000_yearly_clean rules=color.table
235       t.rast.colors input=leafhopper_all_cycles_1990_2000_yearly_clean rules=color.table
236       #############################################################################
237       ################ DURATION COMPUTATION #######################################
238       #############################################################################
239       # Extract the duration in days of the first cycle
240       t.rast.aggregate input=leafhopper_occurrence_c1_1990_2000 gran="1 year" \
241             output=leafhopper_min_day_c1_1990_2000 method=minimum basename=occ_min_day_c1
242       t.rast.aggregate input=leafhopper_occurrence_c1_1990_2000 gran="1 year" \
243             output=leafhopper_max_day_c1_1990_2000 method=maximum basename=occ_max_day_c1
244       t.rast.mapcalc input=leafhopper_min_day_c1_1990_2000,leafhopper_max_day_c1_1990_2000 \
245                      basename=occ_duration_c1 \
246                      output=leafhopper_duration_c1_1990_2000 \
247                      expression="leafhopper_max_day_c1_1990_2000 - leafhopper_min_day_c1_1990_2000"
248       # Extract the duration in days of the second cycle
249       t.rast.aggregate input=leafhopper_occurrence_c2_1990_2000 gran="1 year" \
250             output=leafhopper_min_day_c2_1990_2000 method=minimum basename=occ_min_day_c2
251       t.rast.aggregate input=leafhopper_occurrence_c2_1990_2000 gran="1 year" \
252             output=leafhopper_max_day_c2_1990_2000 method=maximum basename=occ_max_day_c2
253       t.rast.mapcalc input=leafhopper_min_day_c2_1990_2000,leafhopper_max_day_c2_1990_2000 \
254                      basename=occ_duration_c2 \
255                      output=leafhopper_duration_c2_1990_2000 \
256                      expression="leafhopper_max_day_c2_1990_2000 - leafhopper_min_day_c2_1990_2000"
257       # Extract the duration in days of the third cycle
258       t.rast.aggregate input=leafhopper_occurrence_c3_1990_2000 gran="1 year" \
259             output=leafhopper_min_day_c3_1990_2000 method=minimum basename=occ_min_day_c3
260       t.rast.aggregate input=leafhopper_occurrence_c3_1990_2000 gran="1 year" \
261             output=leafhopper_max_day_c3_1990_2000 method=maximum basename=occ_max_day_c3
262       t.rast.mapcalc input=leafhopper_min_day_c3_1990_2000,leafhopper_max_day_c3_1990_2000 \
263                      basename=occ_duration_c3 \
264                      output=leafhopper_duration_c3_1990_2000 \
265                      expression="leafhopper_max_day_c3_1990_2000 - leafhopper_min_day_c3_1990_2000"
266       t.rast.colors input=leafhopper_duration_c1_1990_2000 color=rainbow
267       t.rast.colors input=leafhopper_duration_c2_1990_2000 color=rainbow
268       t.rast.colors input=leafhopper_duration_c3_1990_2000 color=rainbow
269       #############################################################################
270       ################ MONTHLY CYCLES OCCURRENCE ##################################
271       #############################################################################
272       # Extract the monthly indicator that shows the start and end of a cycle
273       # First cycle
274       t.rast.aggregate input=leafhopper_indicator_c1_1990_2000 gran="1 month" \
275             output=leafhopper_indi_min_month_c1_1990_2000 method=minimum basename=occ_indi_min_month_c1
276       t.rast.aggregate input=leafhopper_indicator_c1_1990_2000 gran="1 month" \
277             output=leafhopper_indi_max_month_c1_1990_2000 method=maximum basename=occ_indi_max_month_c1
278       t.rast.mapcalc input=leafhopper_indi_min_month_c1_1990_2000,leafhopper_indi_max_month_c1_1990_2000 \
279                      basename=indicator_monthly_c1 \
280                      output=leafhopper_monthly_indicator_c1_1990_2000 \
281                      expression="if(leafhopper_indi_min_month_c1_1990_2000 == 1, 1, if(leafhopper_indi_max_month_c1_1990_2000 == 3, 3, 2))"
282       # Second cycle
283       t.rast.aggregate input=leafhopper_indicator_c2_1990_2000 gran="1 month" \
284             output=leafhopper_indi_min_month_c2_1990_2000 method=minimum basename=occ_indi_min_month_c2
285       t.rast.aggregate input=leafhopper_indicator_c2_1990_2000 gran="1 month" \
286             output=leafhopper_indi_max_month_c2_1990_2000 method=maximum basename=occ_indi_max_month_c2
287       t.rast.mapcalc input=leafhopper_indi_min_month_c2_1990_2000,leafhopper_indi_max_month_c2_1990_2000 \
288                      basename=indicator_monthly_c2 \
289                      output=leafhopper_monthly_indicator_c2_1990_2000 \
290                      expression="if(leafhopper_indi_min_month_c2_1990_2000 == 1, 1, if(leafhopper_indi_max_month_c2_1990_2000 == 3, 3, 2))"
291       # Third cycle
292       t.rast.aggregate input=leafhopper_indicator_c3_1990_2000 gran="1 month" \
293             output=leafhopper_indi_min_month_c3_1990_2000 method=minimum basename=occ_indi_min_month_c3
294       t.rast.aggregate input=leafhopper_indicator_c3_1990_2000 gran="1 month" \
295             output=leafhopper_indi_max_month_c3_1990_2000 method=maximum basename=occ_indi_max_month_c3
296       t.rast.mapcalc input=leafhopper_indi_min_month_c3_1990_2000,leafhopper_indi_max_month_c3_1990_2000 \
297                      basename=indicator_monthly_c3 \
298                      output=leafhopper_monthly_indicator_c3_1990_2000 \
299                      expression="if(leafhopper_indi_min_month_c3_1990_2000 == 1, 1, if(leafhopper_indi_max_month_c3_1990_2000 == 3, 3, 2))"
300       cat > color.table << EOF
301       3 red
302       2 yellow
303       1 green
304       EOF
305       t.rast.colors input=leafhopper_monthly_indicator_c1_1990_2000 rules=color.table
306       t.rast.colors input=leafhopper_monthly_indicator_c2_1990_2000 rules=color.table
307       t.rast.colors input=leafhopper_monthly_indicator_c3_1990_2000 rules=color.table
308       #############################################################################
309       ################ VISUALIZATION ##############################################
310       #############################################################################
311       # Now we use g.gui.animation to visualize the yearly occurrence, the duration and the monthly occurrence
312       # Yearly occurrence of all reproduction cycles
313       g.gui.animation strds=leafhopper_all_cycles_1990_2000_yearly_clean
314       # Yearly duration of reproduction cycle 1
315       g.gui.animation strds=leafhopper_duration_c1_1990_2000
316       # Yearly duration of reproduction cycle 2
317       g.gui.animation strds=leafhopper_duration_c2_1990_2000
318       # Yearly duration of reproduction cycle 3
319       g.gui.animation strds=leafhopper_duration_c3_1990_2000
320       # Monthly occurrence of reproduction cycle 1
321       g.gui.animation strds=leafhopper_monthly_indicator_c1_1990_2000
322       # Monthly occurrence of reproduction cycle 2
323       g.gui.animation strds=leafhopper_monthly_indicator_c2_1990_2000
324       # Monthly occurrence of reproduction cycle 3
325       g.gui.animation strds=leafhopper_monthly_indicator_c3_1990_2000
326

REFERENCES

328           •   Jones, G.V., Duff, A.A., Hall, A., Myers, J.W., 2010.   Spatial
329               Analysis of Climate in Winegrape Growing Regions in the Western
330               United States. Am. J. Enol. Vitic. 61, 313-326.
331

SEE ALSO

333        t.rast.accdetect, t.rast.aggregate, t.rast.mapcalc, t.info,  g.region,
334       r.series.accumulate
335

AUTHOR

337       Sören Gebbert, Thünen Institute of Climate-Smart Agriculture
338

SOURCE CODE

340       Available at: t.rast.accumulate source code (history)
341
342       Accessed: Saturday Jan 21 21:17:05 2023
343
344       Main index | Temporal index | Topics index | Keywords index | Graphical
345       index | Full index
346
347       © 2003-2023 GRASS Development Team, GRASS GIS 8.2.1 Reference Manual
348
349
350
351GRASS 8.2.1                                               t.rast.accumulate(1)
Impressum