[GRASS-SVN] r71880 - in grass/branches/releasebranch_7_4/temporal: t.rast.algebra t.rast.mapcalc

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Dec 1 06:13:25 PST 2017


Author: veroandreo
Date: 2017-12-01 06:13:25 -0800 (Fri, 01 Dec 2017)
New Revision: 71880

Modified:
   grass/branches/releasebranch_7_4/temporal/t.rast.algebra/t.rast.algebra.html
   grass/branches/releasebranch_7_4/temporal/t.rast.mapcalc/t.rast.mapcalc.html
Log:
t.rast.mapcalc and t.rast.algebra: manual edits (trunk, r71879)

Modified: grass/branches/releasebranch_7_4/temporal/t.rast.algebra/t.rast.algebra.html
===================================================================
--- grass/branches/releasebranch_7_4/temporal/t.rast.algebra/t.rast.algebra.html	2017-12-01 14:09:57 UTC (rev 71879)
+++ grass/branches/releasebranch_7_4/temporal/t.rast.algebra/t.rast.algebra.html	2017-12-01 14:13:25 UTC (rev 71880)
@@ -1,54 +1,68 @@
 <h2>DESCRIPTION</h2>
 
 t.rast.algebra performs temporal and spatial map algebra operations on
-space time raster datasets (STRDS) by using the temporal raster algebra.
+space time raster datasets (STRDS) using the temporal raster algebra.
 
 <h3>PROGRAM USE</h3>
-The module expects an <b>expression</b> as input parameter in the following form: <p>
-<b> "result = expression" </b>
+The module expects an <b>expression</b> as input parameter in the 
+following form:
 <p>
-
-The statement structure is similar to r.mapcalc, see <a href="r.mapcalc.html">r.mapcalc</a>.
-Where <b>result</b> represents the name of a space time raster dataset (STRDS)that will
-contain the result of the calculation that is given as <b>expression</b>
-on the right side of the equality sign.
-These expression can be any valid or nested combination of temporal
-operations and spatial overlay or buffer functions that are provided by the temporal algebra.  <br>
-The temporal raster algebra works with space time raster datasets only (STRDS).
-The algebra provides methods for map selection from STRDS based on their temporal relations.
-It is also possible to temporally shift maps, to create temporal buffer and to snap time
-instances to create a valid temporal topology. Furthermore expressions can be nested and
-evaluated in conditional statements (if, else statements). Within if-statements the algebra
-provides temporal variables like start time, end time, day of year, time differences or
-number of maps per time interval to build up conditions.
+<b>"result = expression"</b>
+<p>
+The statement structure is similar to that of <a href="r.mapcalc.html">r.mapcalc</a>.
+In this statement, <b>result</b> represents the name of the space time 
+raster dataset (STRDS) that will contain the result of the calculation
+that is given as <b>expression</b> on the right side of the equality sign.
+These expressions can be any valid or nested combination of temporal
+operations and spatial overlay or buffer functions that are provided by
+the temporal algebra.
+<p>
+The temporal raster algebra works only with space time raster datasets
+(STRDS). The algebra provides methods for map selection based on their
+temporal relations. It is also possible to temporally shift maps, to
+create temporal buffer and to snap time instances to create a valid
+temporal topology. Furthermore, expressions can be nested and evaluated
+in conditional statements (if, else statements). Within if-statements,
+the algebra provides temporal variables like start time, end time, day
+of year, time differences or number of maps per time interval to build
+up conditions.
 <br>
-In addition the algebra provides
-a subset of the spatial operations from <a href="r.mapcalc.html">r.mapcalc</a>.
-All these operations can be assigned to STRDS or to the resulting map lists of operations between STRDS.
+In addition the algebra provides a subset of the spatial operations
+from <a href="r.mapcalc.html">r.mapcalc</a>. All these operations can be
+assigned to STRDS or to the map lists resulting of operations between 
+STRDS.
 <p>
-As default, topological relationships between space time datasets will be
-evaluated only temporal. Use the <b>s</b> flag to activate the
-additionally evaluate the spatial topology based on the spatial extents of maps.
+By default, only temporal topological relations among space time datasets
+(STDS) are evaluated. The <b>-s</b> flag can be used to aditionally
+activate the evaluation of the spatial topology based on the spatial
+extent of maps.
 <p>
-The expression option must be passed as <b>quoted</b>
-expression, for example: <br>
-<div class="code"><pre>t.rast.algebra expression="C = A + B" basename=result</pre></div>
-Where <b>C</b> is the new space time raster dataset that will contain maps
-with the basename "result" that represent the sum of maps from STRDS <b>A</b> and
-equally temporal related maps from STRDS <b>B</b>.
+The expression option must be passed as <b>quoted</b> expression, for
+example:
+
+<div class="code"><pre>
+t.rast.algebra expression="C = A + B" basename=result
+</pre></div>
+
+Where <b>C</b> is the new space time raster dataset that will contain
+maps with the basename "result" and a numerical suffix separated by an
+underscore that represent the sum of maps from the STRDS
+<b>A</b> and temporally equal maps (i.e., maps with equal temporal
+topology relation) from the STRDS <b>B</b>.
+
 <p>
-The map basename for the result STRDS must always be specified.
+The map <b>basename</b> for the result STRDS must always be specified.
 
 <h2>TEMPORAL RASTER ALGEBRA</h2>
 
-
 The temporal algebra provides a wide range of temporal operators and
-functions that will be presented in the following section. <p>
+functions that will be presented in the following section.
 
 <h3>TEMPORAL RELATIONS</h3>
 
-Several temporal topology relations between registered maps of space
-time datasets are supported: <br>
+Several temporal topology relations are supported between maps registered
+in space time datasets:
+
 <div class="code"><pre>
 equals            A ------
                   B ------
@@ -84,18 +98,21 @@
                   B   ------
 
 over              booth overlaps and overlapped
-
 </pre></div>
-The relations must be read as: A is related to B, like - A equals B - A is
-during B - A contains B <p>
-Topological relations must be specified in {} parentheses. <br>
 
+The relations must be read as: A is related to B, like - A equals B - A
+is during B - A contains B.
+<p>
+Topological relations must be specified with curly brackets {}.
+
 <h3>TEMPORAL OPERATORS</h3>
 
-The temporal algebra defines temporal operators that can be combined with other 
-operators to perform spatio-temporal operations. 
-The temporal operators process the time instances and intervals of two temporal 
-related maps and calculate the result temporal extent by five different possibilities.
+The temporal algebra defines temporal operators that can be combined with
+other operators to perform spatio-temporal operations. 
+The temporal operators process the time instances and intervals of two
+temporally related maps and calculate the resulting temporal extent in
+five possible different ways.
+
 <div class="code"><pre>
 LEFT REFERENCE     l       Use the time stamp of the left space time dataset
 INTERSECTION       i       Intersection
@@ -104,59 +121,68 @@
 RIGHT REFERENCE    r       Use the time stamp of the right space time dataset
 </pre></div>
 
-
 <h3>TEMPORAL SELECTION</h3>
 
 The temporal selection simply selects parts of a space time dataset without
-processing raster or vector data.
+processing any raster or vector data. The algebra provides a selection
+operator <b>:</b> that by default selects parts of a space time dataset
+that are temporally equal to parts of a second space time dataset. The
+following expression
 
-The algebra provides a selection operator <b>:</b> that selects parts
-of a space time dataset that are temporally equal to parts of a second one
-by default. The following expression
 <div class="code"><pre>
 C = A : B
 </pre></div>
-means: Select all parts of space time dataset A that are equal to B and store
-it in space time dataset C. The parts are time stamped maps. <p>
-In addition the inverse selection operator <b>!:</b> is defined as the complement of
-the selection operator, hence the following expression
+
+means: select all parts of space time dataset A that are equal to B and
+store them in space time dataset C. These parts are time stamped maps.
+<p>
+In addition, the inverse selection operator <b>!:</b> is defined as the
+complement of the selection operator, hence the following expression
+
 <div class="code"><pre>
 C = A !: B
 </pre></div>
-means: select all parts of space time time dataset A that are not equal to B
-and store it in space time dataset (STDS) C. <p>
-To select parts of a STDS by different topological relations to other STDS,
-the temporal topology selection operator can be used. The operator consists of
-the temporal selection operator, the topological relations, that must be separated 
-by the logical OR operator <b>|</b> and the temporal extent operator. 
-All three parts are separated by comma and surrounded by curly braces:
-{"temporal selection operator", "topological relations", "temporal operator"}
+
+means: select all parts of space time time dataset A that are not equal
+to B and store them in space time dataset C.
 <p>
+To select parts of a STRDS using different topological relations
+regarding to other STRDS, the temporal topology selection operator
+can be used. This operator consists of the temporal selection operator,
+the topological relations that must be separated by the logical OR
+operator <b>|</b> and, the temporal extent operator. All three parts 
+are separated by comma and surrounded by curly brackets as follows:
+{"temporal selection operator", "topological relations", "temporal operator"}.
+<p>
 
 <b>Examples:</b>
 
 <div class="code"><pre>
-C = A {:, equals} B
-C = A {!:, equals} B
+C = A {:,equals} B
+C = A {!:,equals} B
 </pre></div>
+
 We can now define arbitrary topological relations using the OR operator "|"
 to connect them:
+
 <div class="code"><pre>
 C = A {:,equals|during|overlaps} B
 </pre></div>
-Select all parts of A that are equal to B, during B or overlaps B. <br>
 
-In addition we can define the temporal extent of the result STDS by adding the
-temporal operator.
+Select all parts of A that are equal to B, during B or overlaps B.<br>
+
+In addition, we can define the temporal extent of the resulting STRDS by
+adding the temporal operator.
+
 <div class="code"><pre>
-C = A {:, during,r} B
+C = A {:,during,r} B
 </pre></div>
-Select all parts of A that are during B and use the temporal extents from B for 
-C. <br>
 
-<br>
+Select all parts of A that are during B and use the temporal extents
+from B for C.<br><br>
 The selection operator is implicitly contained in the temporal topology
 selection operator, so that the following statements are exactly the same:
+
 <div class="code"><pre>
 C = A : B
 C = A {:} B
@@ -165,6 +191,7 @@
 </pre></div>
 
 Same for the complementary selection:
+
 <div class="code"><pre>
 C = A !: B
 C = A {!:} B
@@ -174,27 +201,30 @@
 
 <h3>CONDITIONAL STATEMENTS</h3>
 
-Selection operations can be evaluated within conditional statements.
-<br>
+Selection operations can be evaluated within conditional statements as
+showed below. Note that A and B can be either space time datasets or 
+expressions. The temporal relationship between the conditions and the
+conclusions can be defined at the beginning of the if statement (third
+and fourth examples below). The relationship between then and else 
+conclusion must be always equal.
+
 <div class="code"><pre>
-Note A and B can either be space time datasets or expressions. The temporal 
-relationship between the conditions and the conclusions can be defined at the 
-beginning of the if statement. The relationship between then and else conclusion 
-must be always equal.
-
-if statement                         decision option                        temporal relations
+if statement                        decision option                        temporal relations
   if(if, then, else)
-  if(conditions, A)                    A if conditions are True;              temporal topological relation between if and then is equal.
-  if(conditions, A, B)                 A if conditions are True, B otherwise; temporal topological relation between if, then and else is equal.
-  if(topologies, conditions, A)        A if conditions are True;              temporal topological relation between if and then is explicit specified by topologies.
-  if(topologies, conditions, A, B)     A if conditions are True, B otherwise; temporal topological relation between if, then and else is explicit specified by topologies.
+  if(conditions, A)                   A if conditions are True;              temporal topological relation between if and then is equal.
+  if(conditions, A, B)                A if conditions are True, B otherwise; temporal topological relation between if, then and else is equal.
+  if(topologies, conditions, A)       A if conditions are True;              temporal topological relation between if and then is explicitly specified by topologies.
+  if(topologies, conditions, A, B)    A if conditions are True, B otherwise; temporal topological relation between if, then and else is explicitly specified by topologies.
 </pre></div>
+
 The conditions are comparison expressions that are used to evaluate
 space time datasets. Specific values of temporal variables are
-compared by logical operators and evaluated for each map of the STDS.<br>
+compared by logical operators and evaluated for each map of the STRDS.
+<br>
 <b>Important:</b> The conditions are evaluated from left to right. 
 
 <h4>Logical operators</h4>
+
 <div class="code"><pre>
 Symbol  description
 
@@ -209,9 +239,11 @@
 </pre></div>
 
 <h4>Temporal functions</h4>
-The following temporal function are evaluated only for the STDS that must be given in parenthesis.
+
+The following temporal functions are evaluated only for the STDS that
+must be given in parenthesis.
+
 <div class="code"><pre>
-
 td(A)                    Returns a list of time intervals of STDS A
 
 start_time(A)            Start time as HH::MM:SS
@@ -242,27 +274,31 @@
 </pre></div>
 
 <h4>Comparison operator</h4>
-The conditions are comparison expressions that are used to evaluate
-space time datasets. Specific values of temporal variables are
-compared by logical operators and evaluated for each map of the STDS and 
-the related maps.
-For complex relations the comparison operator can be used to combine conditions: 
+
+As mentioned above, the conditions are comparison expressions that are
+used to evaluate space time datasets. Specific values of temporal 
+variables are compared by logical operators and evaluated for each map
+of the STDS and (optionally) related maps.
+For complex relations, the comparison operator can be used to combine
+conditions. 
 <br>
-The structure is similar to the select operator with the extension of an aggregation operator: 
+The structure is similar to the select operator with the addition of an
+aggregation operator: 
 {"comparison operator", "topological relations", aggregation operator, "temporal operator"}
 <br>
-This aggregation operator (| or &) define the behaviour if a map is related the more 
-than one map, e.g for the topological relations 'contains'.
-Should all (&) conditions for the related maps be true or is it sufficient to 
-have any (|) condition that is true. The resulting boolean value is then compared 
-to the first condition by the comparison operator (|| or &&). 
-As default the aggregation operator is related to the comparison operator: <br>
-Comparison operator -> aggregation operator:
+This aggregation operator (| or &) defines the behaviour when a map is
+related to more than one map, e.g. for the topological relation 'contains'.
+Should all (&) conditions for the related maps be true or is it sufficient
+to have any (|) condition that is true. The resulting boolean value is
+then compared to the first condition by the comparison operator (|| or &&).
+By default, the aggregation operator is related to the comparison
+operator:<br>
+comparison operator -> aggregation operator:
+
 <div class="code"><pre>
 || -> | and && -> & 
 </pre></div>
 
-
 <b>Examples:</b>
 <div class="code"><pre>
 Condition 1 {||, equal, r} Condition 2
@@ -273,50 +309,61 @@
 </pre></div>
 
 <h4>Hash operator</h4>
-Additionally the number of maps in intervals can be computed and used in 
-conditional statements with the hash (#) operator. <br>
+
+Additionally, the number of maps in intervals can be computed and used in 
+conditional statements with the hash (#) operator.
+
 <div class="code"><pre>
-A{#, contains}B
+A {#, contains} B
 </pre></div>
-This expression computes the number of maps from space
-time dataset B which are during the time intervals of maps from
-space time dataset A.<br>
-A list of integers (scalars) corresponding to the maps of A
-that contain maps from B will be returned. <p>
+
+This expression computes the number of maps from space time dataset B
+which are during the time intervals of maps from space time dataset A.<br>
+A list of integers (scalars) corresponding to the maps of A that contain
+maps from B will be returned.
+
 <div class="code"><pre>
 C = if({equal}, A {#, contains} B > 2, A {:, contains} B)
 </pre></div>
-This expression selects all maps from A that temporally contains at least 2 
-maps from B and stores them in space time dataset C. The leading equal statement 
-in the if condition specifies the temporal relation between the if and then part 
-of the if expression. This is very important, so we do not need to specify a 
-global time reference (a space time dataset) for temporal processing.
+
+This expression selects all maps from A that temporally contain at least 2 
+maps from B and stores them in space time dataset C. The leading equal
+statement in the if condition specifies the temporal relation between
+the if and then part of the if expression. This is very important, so we
+do not need to specify a global time reference (a space time dataset)
+for temporal processing.
 <p>
-Furthermore the temporal algebra allows temporal buffering, shifting
-and snapping with the functions buff_t(), tshift() and tsnap()
+Furthermore, the temporal algebra allows temporal buffering, shifting
+and snapping with the functions buff_t(), tshift() and tsnap(),
 respectively.
+
 <div class="code"><pre>
 buff_t(A, size)         Buffer STDS A with granule ("1 month" or 5)
 tshift(A, size)         Shift STDS A with granule ("1 month" or 5)
 tsnap(A)                Snap time instances and intervals of STDS A
 </pre></div>
-<br>
+
 <h4>Single map with temporal extent</h4>
+
 The temporal algebra can also handle single maps with time stamps in the
-tmap function.
+tmap() function.
+
 <div class="code"><pre>
 tmap()
 </pre></div>
+
 For example:
 <div class="code"><pre>
- C = A {:,during} tmap(event)
+C = A {:, during} tmap(event)
 </pre></div>
-This statement select all maps from space time data set A that are during 
-the temporal extent of single map 'event'
 
+This statement selects all maps from space time data set A that are during 
+the temporal extent of the single map 'event'
+
 <h3>Spatial raster operators</h3>
 
-The module supports the following raster operations: <br>
+The module supports the following raster operations: 
+
 <div class="code"><pre>
 Symbol  description     precedence
 
@@ -345,21 +392,26 @@
 
 <h4>Single raster map </h4>
 
-The temporal raster algebra feature also a function to integrate single raster 
-maps without time stamps into the expressions.
+The temporal raster algebra features also a function to integrate single
+raster maps without time stamps into the expressions.
+
 <div class="code"><pre>
- map()
+map()
 </pre></div>
+
 For example:
 <div class="code"><pre>
- C = A * map(constant_value)
+C = A * map(constant_value)
 </pre></div>
-This statement multiply all raster maps from space time raster data set A
-with the raster map 'constant_value'
+
+This statement multiplies all raster maps from space time raster data
+set A with the raster map 'constant_value'
+
 <h3>Combinations of temporal, raster and select operators</h3>
 
-We combine the temporal topology relations, the temporal operators and the
-spatial/select operators to create spatio-temporal operators:
+The user can combine the temporal topology relations, the temporal
+operators and the spatial/select operators to create spatio-temporal
+operators as follows:
 
 <div class="code"><pre>
 {"spatial or select operator", "list of temporal relations", "temporal operator"}
@@ -369,27 +421,31 @@
 operators feature implicit aggregation.
 
 The algebra evaluates the stated STDS by their temporal topologies and apply 
-the given spatio temporal operators in a aggregated form.
+the given spatio-temporal operators in a aggregated form.
 
 If we have two STDS A and B, B has three maps: b1, b2, b3 that are all during 
 the temporal extent of the single map a1 of A, then the following arithmetic 
 calculations would implicitly aggregate all maps of B into one result map for 
 a1 of A:
+
 <pre class="code">
  C = A {+, contains} B --> c1 = a1 + b1 + b2 + b3
 </pre><p>
-Keep attention that the aggregation behaviour is not symmetric:
+
+<b>Important</b>: the aggregation behaviour is not symmetric
+
 <pre class="code">
  C = B {+, during} A --> c1 = b1 + a1
                          c2 = b2 + a1
                          c3 = b3 + a1
 </pre>
+
 <h3>Temporal neighbourhood modifier</h3>
 
-The neighbourhood modifier of r.mapcalc is extended for the temporal 
-raster algebra by the temporal dimension. The format is strds[t,r,c], 
+The neighbourhood modifier of <em>r.mapcalc</em> is extended for the temporal 
+raster algebra with the temporal dimension. The format is strds[t,r,c], 
 where t is the temporal offset, r is the row offset and c is the column 
-offset. <br>
+offset.
 
 <pre class="code">
 strds[2] 
@@ -413,9 +469,8 @@
 
 <h2>EXAMPLES</h2>
 
-Sum maps from space time dataset A with maps from space time dataset
-B which have equal time stamps and are temporary before Jan. 1. 2005 and
-store them in space time dataset D:
+Sum maps from STRDS A with maps from STRDS B which have equal time stamps
+and are temporally before Jan. 1. 2005 and store them in STRDS D:
 <div class="code"><pre>
 D = if(start_date(A) < "2005-01-01", A + B)
 </pre></div>
@@ -432,9 +487,9 @@
 C = A {+,equal,l} B
 </pre></div>
 
-Select all cells from STRDS B with equal temporal relations to STRDS A, if the 
-cells of A are in the range of [100.0, 1600] of time intervals that have more 
-then 30 days (Jan, Mar, Mai, Jul, Aug, Oct, Dec):
+Select all cells from STRDS B with equal temporal relations to STRDS A, if
+the cells of A are in the range [100.0, 1600] of time intervals that have
+more than 30 days (Jan, Mar, May, Jul, Aug, Oct, Dec):
 <div class="code"><pre>
 C = if(A > 100 && A < 1600 && td(A) > 30, B)
 </pre></div>
@@ -444,13 +499,14 @@
 <div class="code"><pre>
 C = if({equal}, A > 100 && A < 1600 {&&,equal} td(A) > 30, B)
 </pre></div>
-Compute the recharge in meter per second for all cells of precipitation
+
+Compute the recharge in meters per second for all cells of precipitation
 STRDS "Prec" if the mean temperature specified in STRDS "Temp" is higher
 than 10 degrees. Computation is performed if STRDS "Prec" and "Temp" have
 equal time stamps. The number of days or fraction of days per interval is
 computed using the td() function that has as argument the STRDS "Prec":
 <div class="code"><pre>
-C = if(Temp > 10.0, Prec / 3600.0 /24.0 / td(Prec))
+C = if(Temp > 10.0, Prec / 3600.0 / 24.0 / td(Prec))
 </pre></div>
 
 Same expression with explicit definition of the temporal topology relation
@@ -461,7 +517,7 @@
 
 Compute the mean value of all maps from STRDS A that are located during time
 intervals of STRDS B if more than one map of A is contained in an interval
-of B, use A otherwise, the resulting time intervals are either from B or A:
+of B, use A otherwise. The resulting time intervals are either from B or A:
 <div class="code"><pre>
 C = if(B {#,contain} A > 1, (B {+,contain,l} A - B) / (B {#,contain} A), A)
 </pre></div>
@@ -472,7 +528,6 @@
 C = if({equal}, B {#,contain} A > 1, (B {+,contain,l} A {-,equal,l} B) {equal,=/} (B {#,contain} A), A)
 </pre></div>
 
-
 <h2>SEE ALSO</h2>
 
 <em>
@@ -486,7 +541,6 @@
 <p>
 <a href="http://grasswiki.osgeo.org/wiki/Temporal_data_processing">Temporal data processing Wiki</a>
 
-
 <h2>REFERENCES</h2>
 
 <a href="http://www.dabeaz.com/ply/">PLY(Python-Lex-Yacc)</a>

Modified: grass/branches/releasebranch_7_4/temporal/t.rast.mapcalc/t.rast.mapcalc.html
===================================================================
--- grass/branches/releasebranch_7_4/temporal/t.rast.mapcalc/t.rast.mapcalc.html	2017-12-01 14:09:57 UTC (rev 71879)
+++ grass/branches/releasebranch_7_4/temporal/t.rast.mapcalc/t.rast.mapcalc.html	2017-12-01 14:13:25 UTC (rev 71880)
@@ -8,7 +8,7 @@
 the <a href="r.mapcalc.html">r.mapcalc</a> manual page. The temporal
 functions are described in detail below.
 <p>
-This module expects several parameter. All space time raster datasets
+This module expects several parameters. All space time raster datasets
 that are referenced in the <em>mapcalc expression</em> must be listed
 in the <em>input</em> option. The <em>first</em> space time raster
 dataset that is listed as input will be used to temporally sample all
@@ -16,12 +16,12 @@
 chosen using the <em>method</em> option. The order of the STRDS's in
 the mapcalc expression can be different to the order of the STRDS's in
 the input option. The resulting space time raster dataset must be
-specified in the <em>output</em> option together with the <em>base</em>
-name of generated raster maps that are registered in the resulting
+specified in the <em>output</em> option together with the <em>basename</em>
+of generated raster maps that are registered in the resulting
 STRDS. Empty maps resulting from map-calculation are not registered by
 default. This behavior can be changed with the <em>-n</em> flag. The
-flag <em>-s</em> can be used to assure that only spatial related maps
-in the STRDS's are processed. Spatial related means that temporally
+flag <em>-s</em> can be used to assure that only spatially related maps
+in the STRDS's are processed. Spatially related means that temporally
 related maps overlap in their spatial extent.
 <p>
 The module <em>t.rast.mapcalc</em> supports parallel processing. The option
@@ -32,55 +32,55 @@
 sampled maps. Temporal internal variables are available in addition to
 the <em>r.mapcalc</em> spatial operators and functions:
 <p>
-Supported internal variables for relative and absolute time:
+The supported internal variables for relative and absolute time are:
 <ul>
-  <li> <em>td()</em> - This internal variable
-       represents the size of the current sample time interval
-       in days and fraction of days for absolute time,
-       and in relative units in case of relative time. </li>
-  <li> <em>start_time()</em> - This internal variable represent
-    the time difference between the start time of the sample space time
-    raster dataset and the start time of the current sample interval or instance.
-    The time is measured in days and fraction of days for absolute time,
-    and in relative units in case of relative time. </li>
-  <li> <em>end_time()</em> - This internal variable represent
-    the time difference between the start time of the sample space time
-    raster dataset and the end time of the current sample interval. The
-    time is measured in days and fraction of days for absolute time,
-    and in relative units in case of relative time.
-    The end_time() will be represented by null() in case of a time instance.</li>
+  <li><em>td()</em> - This internal variable represents the size of the
+  current sample time interval in days and fraction of days for absolute
+  time, and in relative units in case of relative time.</li>
+  <li><em>start_time()</em> - This internal variable represents
+  the time difference between the start time of the sample space time
+  raster dataset and the start time of the current sample interval or instance.
+  The time is measured in days and fraction of days for absolute time,
+  and in relative units in case of relative time.</li>
+  <li><em>end_time()</em> - This internal variable represents
+  the time difference between the start time of the sample space time
+  raster dataset and the end time of the current sample interval. The
+  time is measured in days and fraction of days for absolute time,
+  and in relative units in case of relative time.
+  The end_time() will be represented by null() in case of a time instance.</li>
 </ul>
 <p>
-Supported internal variables for absolute time of the current sample interval or instance:
+The supported internal variables for the current sample interval or instance
+for absolute time are:
 <ul>
-  <li> <em>start_doy()</em> - Day of year (doy) from the start time [1 - 366] </li>
-  <li> <em>start_dow()</em> - Day of week (dow) from the start time [1 - 7],
-         the start of the week is monday == 1 </li>
-  <li> <em>start_year()</em> - The year of the start time [0 - 9999] </li>
-  <li> <em>start_month()</em> - The month of the start time [1 - 12] </li>
-  <li> <em>start_week()</em> - Week of year of the start time [1 - 54] </li>
-  <li> <em>start_day()</em> - Day of month from the start time [1 - 31] </li>
-  <li> <em>start_hour()</em> - The hour of the start time [0 - 23] </li>
-  <li> <em>start_minute()</em> - The minute of the start time [0 - 59] </li>
-  <li> <em>start_second()</em> - The second of the start time [0 - 59] </li>
-  <li> <em>end_doy()</em> - Day of year (doy) from the end time [1 - 366] </li>
-  <li> <em>end_dow()</em> - Day of week (dow) from the end time [1 - 7],
-         the start of the week is monday == 1 </li>
-  <li> <em>end_year()</em> - The year of the end time [0 - 9999] </li>
-  <li> <em>end_month()</em> - The month of the end time [1 - 12] </li>
-  <li> <em>end_woy()</em> - Week of year (woy) of the end time [1 - 54] </li>
-  <li> <em>end_day()</em> - Day of month from the start time [1 - 31] </li>
-  <li> <em>end_hour()</em> - The hour of the end time [0 - 23] </li>
-  <li> <em>end_minute()</em> - The minute of the end time [0 - 59] </li>
-  <li> <em>end_second()</em> - The second of the end time [0 - 59] </li>
+  <li><em>start_doy()</em> - Day of year (doy) from the start time [1 - 366]</li>
+  <li><em>start_dow()</em> - Day of week (dow) from the start time [1 - 7],
+  the start of the week is Monday == 1</li>
+  <li><em>start_year()</em> - The year of the start time [0 - 9999]</li>
+  <li><em>start_month()</em> - The month of the start time [1 - 12]</li>
+  <li><em>start_week()</em> - Week of year of the start time [1 - 54]</li>
+  <li><em>start_day()</em> - Day of month from the start time [1 - 31]</li>
+  <li><em>start_hour()</em> - The hour of the start time [0 - 23]</li>
+  <li><em>start_minute()</em> - The minute of the start time [0 - 59]</li>
+  <li><em>start_second()</em> - The second of the start time [0 - 59]</li>
+  <li><em>end_doy()</em> - Day of year (doy) from the end time [1 - 366]</li>
+  <li><em>end_dow()</em> - Day of week (dow) from the end time [1 - 7],
+  the start of the week is Monday == 1</li>
+  <li><em>end_year()</em> - The year of the end time [0 - 9999]</li>
+  <li><em>end_month()</em> - The month of the end time [1 - 12]</li>
+  <li><em>end_woy()</em> - Week of year (woy) of the end time [1 - 54]</li>
+  <li><em>end_day()</em> - Day of month from the start time [1 - 31]</li>
+  <li><em>end_hour()</em> - The hour of the end time [0 - 23]</li>
+  <li><em>end_minute()</em> - The minute of the end time [0 - 59]</li>
+  <li><em>end_second()</em> - The second of the end time [0 - 59].</li>
 </ul>
-The <em>end_*</em> functions are represented by the null() internal variables
+The <em>end_*</em> functions are represented by the null() internal variable
 in case of time instances.
 
 <h2>NOTES</h2>
 
 We will discuss the internal work of <em>t.rast.mapcalc</em> with an
-example. Imagine we have two STRDS as input, each with monthly
+example. Imagine we have two STRDS as input, each one of monthly
 granularity. The first one <em>A</em> has 6 raster maps (a3 ... a8)
 with a temporal range from March to August. The second STRDS <em>B</em>
 has 12 raster maps (b1 ... b12) ranging from January to December. The
@@ -125,16 +125,18 @@
 
 <h2>EXAMPLE</h2>
 
-The following command it is creating a new raster space time dataset where
-in the January maps are if the temperature is more than 0 it is setting
-null otherwise it set the original value. The other months are copied as
-the original one.
+The following command creates a new space time raster dataset 
+<tt>january_under_0</tt> that will set to null all cells with
+temperature above zero in the January maps while keeping all the rest
+as in the original time series. This will change the maximum values
+of all January maps in the new STRDS as compared to the original one,
+<tt>tempmean_monthly</tt>.
 
 <div class="code"><pre>
 t.rast.mapcalc input=tempmean_monthly output=january_under_0 basename=january_under_0 \
     expression="if(start_month() == 1 && tempmean_monthly > 0, null(), tempmean_monthly)"
 
-# printing the minimum or maximum values only for January
+# print minimum and maximum only for January in the new strds
 t.rast.list january_under_0 columns=name,start_time,min,max | grep 01-01
 name|start_time|min|max
 january_under_0_01|2009-01-01 00:00:00|-3.380823|-7e-06
@@ -142,7 +144,8 @@
 january_under_0_25|2011-01-01 00:00:00|-4.968747|-6.1e-05
 january_under_0_37|2012-01-01 00:00:00|-0.534994|-0.014581
 
-# these are the original data, you can see that the maximum is different
+# print minimum and maximum only for January in the original strds,
+# note that the maximum is different
 t.rast.list tempmean_monthly columns=name,start_time,min,max | grep 01-01
 2009_01_tempmean|2009-01-01 00:00:00|-3.380823|7.426054
 2010_01_tempmean|2010-01-01 00:00:00|-5.266929|5.71131
@@ -161,7 +164,6 @@
 <p>
 <a href="http://grasswiki.osgeo.org/wiki/Temporal_data_processing">Temporal data processing Wiki</a>
 
-
 <h2>AUTHOR</h2>
 
 Sören Gebbert, Thünen Institute of Climate-Smart Agriculture



More information about the grass-commit mailing list