[GRASS-SVN] r66534 - grass/branches/releasebranch_7_0/raster/r.mapcalc

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Oct 19 13:47:47 PDT 2015


Author: neteler
Date: 2015-10-19 13:47:47 -0700 (Mon, 19 Oct 2015)
New Revision: 66534

Modified:
   grass/branches/releasebranch_7_0/raster/r.mapcalc/r.mapcalc.html
   grass/branches/releasebranch_7_0/raster/r.mapcalc/r3.mapcalc.html
Log:
r3.mapcalc manual: partial sync to r.mapcalc manual; HTML cosmetics

Modified: grass/branches/releasebranch_7_0/raster/r.mapcalc/r.mapcalc.html
===================================================================
--- grass/branches/releasebranch_7_0/raster/r.mapcalc/r.mapcalc.html	2015-10-19 20:45:53 UTC (rev 66533)
+++ grass/branches/releasebranch_7_0/raster/r.mapcalc/r.mapcalc.html	2015-10-19 20:47:47 UTC (rev 66534)
@@ -11,13 +11,13 @@
 <p><b>result =</b><em> expression</em>
 <p>where <em>result</em> is the name of a raster map layer
 to contain the result of the calculation and
-<em>expression</em> is any legal arithmetic expression involving existing
+<b>expression</b> is any legal arithmetic expression involving existing
 raster map layers, integer or floating point constants,
 and functions known to the calculator.
 Parentheses are allowed in the expression and may be nested to any depth.
 <em>result</em> will be created in the user's current mapset.
 <p>
-As <em>expression=</em> is the first option, it is the default. This
+As <b>expression=</b> is the first option, it is the default. This
 means that passing an expression on the command line is possible
 as long as the expression is quoted and a space is included before the
 first <em>=</em> sign.
@@ -279,13 +279,11 @@
 
 The functions currently supported are listed in the table below.
 The type of the result is indicated in the last column.
-<em>F</em>
-means that the functions always results in a floating point value,
-<em>I</em>
-means that the function gives an integer result, and
-<em>*</em>
-indicates that the result is float if any of the arguments to the function
-are floating point values and integer if all arguments are integer.
+<em>F</em> means that the functions always results in a floating point value,
+<em>I</em> means that the function gives an integer result, and
+<em>*</em> indicates that the result is float if any of the arguments to the
+function are floating point values and integer if all arguments are integer.
+
 <p><div class="code"><pre>
 function                description                                     type
 ---------------------------------------------------------------------------
@@ -322,7 +320,7 @@
 nmode(x,y[,z...])       mode value of those listed, excluding NULLs     *
 not(x)                  1 if x is zero, 0 otherwise
 pow(x,y)                x to the power y                                *
-rand(a,b)               random value x : a <= x < b
+rand(a,b)               random value x : a <= x < b                     *
 round(x)                round x to nearest integer                      I
 round(x,y)              round x to nearest multiple of y
 round(x,y,z)            round x to nearest y*i+z for some integer i
@@ -331,6 +329,7 @@
 tan(x)                  tangent of x (x is in degrees)                  F
 xor(x,y)                exclusive-or (XOR) of x and y                   I
 </pre></div>
+
 <div class="code"><pre>
 Internal variables:
  row()                  current row of moving window
@@ -610,19 +609,19 @@
 
 <h3>Random number generator initialization</h3>
 <p>The pseudo-random number generator used by the rand() function can
-be initialised to a specific value using the <em>seed</em> option. 
+be initialised to a specific value using the <b>seed</b> option. 
 This can be used to replicate a previous calculation.
 <p>Alternatively, it can be initialised from the system time and the
-PID using the <em>-r</em> flag. This should result in a different seed
+PID using the <b>-r</b> flag. This should result in a different seed
 being used each time.
 <p>In either case, the seed will be written to the map's history, and
 can be seen using <em>r.info</em>.
 <p>If you want other people to be able to verify your results, it's
-preferable to use the <em>seed</em> option to supply a seed which is
+preferable to use the <b>seed</b> option to supply a seed which is
 either specified in the script or generated from a determenistic process
 such as a pseudo-random number generator given an explicit seed.
 <p>Note that the rand() function will generate a fatal error if neither
-the <em>seed</em> option nor the <em>-s</em> flag are given.
+the <b>seed</b> option nor the <b>-s</b> flag are given.
 
 <h2>EXAMPLES</h2>
 To compute the average of two raster map layers
@@ -682,8 +681,7 @@
 <h2>KNOWN ISSUES</h2>
 
 Continuation lines must end with a <tt>\</tt> and have <em>no</em> trailing
-white space (blanks or tabs).
-If the user does leave white space at the end of
+white space (blanks or tabs). If the user does leave white space at the end of
 continuation lines, the error messages produced by <em>r.mapcalc</em> will
 be meaningless and the equation will not work as the user intended.
 This is particularly important for the <tt>eval()</tt> function.
@@ -701,7 +699,7 @@
 
 <h2>SEE ALSO</h2>
 
-<p><em>
+<em>
 <a href="g.region.html">g.region</a>,
 <a href="r.bitpattern.html">r.bitpattern</a>,
 <a href="r.blend.html">r.blend</a>,
@@ -730,4 +728,5 @@
 Research Laboratory
 <p>Glynn Clements
 
-<p><i>Last changed: $Date$</i>
+<p>
+<i>Last changed: $Date$</i>

Modified: grass/branches/releasebranch_7_0/raster/r.mapcalc/r3.mapcalc.html
===================================================================
--- grass/branches/releasebranch_7_0/raster/r.mapcalc/r3.mapcalc.html	2015-10-19 20:45:53 UTC (rev 66533)
+++ grass/branches/releasebranch_7_0/raster/r.mapcalc/r3.mapcalc.html	2015-10-19 20:47:47 UTC (rev 66534)
@@ -4,19 +4,20 @@
 involving existing raster map layers, integer or floating point constants,
 and functions.
 
-<h3>PROGRAM USE</h3>
 
+<h3>Program use</h3>
+
 <em>r3.mapcalc</em> expression have the form:
 <p><b>result =</b><em> expression</em>
 <p>where <em>result</em> is the name of a raster map layer
 to contain the result of the calculation and
-<em>expression</em> is any legal arithmetic expression involving existing
+<b>expression</b> is any legal arithmetic expression involving existing
 raster map layers, integer or floating point constants,
 and functions known to the calculator.
 Parentheses are allowed in the expression and may be nested to any depth.
 <em>result</em> will be created in the user's current mapset.
 <p>
-As <em>expression=</em> is the first option, it is the default. This
+As <b>expression=</b> is the first option, it is the default. This
 means that passing an expression on the command line is possible
 as long as the expression is quoted and a space is included before the
 first <em>=</em> sign.
@@ -38,7 +39,8 @@
 Sorry, <foo> is not a valid parameter
 </pre></div>
 
-If no options are given, it manufactures "input=-" (which reads from
+<!-- sync to r.mapcalc? -->
+If no options are given, it manufactures "file=-" (which reads from
 stdin), so you can continue to use e.g.:
 
 <div class="code"><pre>
@@ -50,15 +52,15 @@
 foo = 1
 EOF
 </pre></div>
-But unless you need compatibility with previous versions, use input=
+But unless you need compatibility with previous versions, use file=
 explicitly, e.g.:
 
 <div class="code"><pre>
-r3.mapcalc input=file
+r3.mapcalc file=file
 </pre></div>
 or:
 <div class="code"><pre>
-r3.mapcalc input=- <<EOF
+r3.mapcalc file=- <<EOF
 foo = 1
 EOF
 </pre></div>
@@ -71,7 +73,8 @@
 should be enclosed within single quotes.  See NOTES, below.
 
 
-<h3>OPERATORS AND ORDER OF PRECEDENCE</h3>
+<h3>Operators and order of precedence</h3>
+
 The following operators are supported:
 <div class="code"><pre>
      Operator   Meaning                    Type        Precedence
@@ -112,7 +115,9 @@
 The logical operators give a 1 result if the comparison is true, 0 otherwise.
 <p><p>
 
-<h3>3D GRID NAMES</h3>
+
+<h3>3D Grid names</h3>
+
 Anything in the expression which is not a number, operator, or function name
 is taken to be a 3D grid name.
 Examples:
@@ -131,7 +136,7 @@
 <p><div class="code"><pre>
 x = "a-b"
 </pre></div>
-<p>would be interpreted as: x equals the 3D grid named <em>a-b</em>
+<p>would be interpreted as:  x equals the 3D grid named <em>a-b</em>
 <p>Also
 <p><div class="code"><pre>
 x = 3107
@@ -156,12 +161,13 @@
 <p><div class="code"><pre>
 result = x at PERMANENT / y at SOILS
 </pre></div>
-<p>The mapset specified does not have to be in the mapset search path. (This
-method of overriding the mapset search path is common to all GRASS commands,
-not just <em>r3.mapcalc</em>.)
+<p>The mapset specified does not have to be in the mapset search path.
+(This method of overriding the mapset search path is common to all
+GRASS commands, not just <em>r3.mapcalc</em>.)
 <p>
 
-<h3>THE NEIGHBORHOOD MODIFIER</h3>
+<h3>The neighborhood modifier</h3>
+
 3D grids are data base files stored in voxel format, i.e., three-dimensional
 matrices of float/double values. In <em>r3.mapcalc</em>, 3D grids may be
 followed by a <em>neighborhood</em> modifier that specifies a relative offset
@@ -176,18 +182,16 @@
 permits the development of neighborhood-type filters within a single 3D
 grid or across multiple 3D grids.
 
-<p>
 
-<h3>FUNCTIONS</h3>
+<h3>Functions</h3>
+
 The functions currently supported are listed in the table below.
 The type of the result is indicated in the last column.
-<em>F</em>
-means that the functions always results in a floating point value,
-<em>I</em>
-means that the function gives an integer result, and
-<em>*</em>
-indicates that the result is float if any of the arguments to the function
-are floating point values and integer if all arguments are integer.
+<em>F</em> means that the functions always results in a floating point value,
+<em>I</em> means that the function gives an integer result, and
+<em>*</em> indicates that the result is float if any of the arguments to the
+function are floating point values and integer if all arguments are integer.
+
 <p><div class="code"><pre>
 function                description                                     type
 ---------------------------------------------------------------------------
@@ -224,7 +228,7 @@
 nmode(x,y[,z...])       mode value of those listed, excluding NULLs     *
 not(x)                  1 if x is zero, 0 otherwise
 pow(x,y)                x to the power y                                *
-rand(a,b)               random value x : a <= x < b
+rand(a,b)               random value x : a <= x < b                     *
 round(x)                round x to nearest integer                      I
 round(x,y)              round x to nearest multiple of y
 round(x,y,z)            round x to nearest y*i+z for some integer i
@@ -233,6 +237,7 @@
 tan(x)                  tangent of x (x is in degrees)                  F
 xor(x,y)                exclusive-or (XOR) of x and y                   I
 </pre></div>
+
 <div class="code"><pre>
 Internal variables:
  row()                  current row of moving window
@@ -249,7 +254,8 @@
 Note, that the row(), col() and depth() indexing starts with 1. 
 
 
-<h3>FLOATING POINT VALUES IN THE EXPRESSION</h3>
+<h3>Floating point values in the expression</h3>
+
 Floating point numbers are allowed in the expression. A floating point
 number is a number which contains a decimal point:
 <div class="code"><pre>
@@ -274,6 +280,7 @@
 
 
 <h3>NULL support</h3>
+
 <ul>
 <li>Division by zero should result in NULL. 
 <li>Modulus by zero should result in NULL. 
@@ -381,7 +388,9 @@
 Extra care must be taken if the expression is given on the command line.
 Some characters have special meaning to the UNIX shell.
 These include, among others:
-<p>* ( ) > & |
+<div class="code"><pre>
+* ( ) > & |
+</pre></div>
 <p>It is advisable to put single quotes around the expression; e.g.:
 <div class="code"><pre>
 'result = volume * 2'
@@ -430,7 +439,7 @@
 the formula being entered by the user continues on to the next input line.
 There is no limit to the possible number of input lines
 or to the length of a formula.
-<p>If the <em>r333.mapcalc</em> formula entered by the user is very long,
+<p>If the <em>r3.mapcalc</em> formula entered by the user is very long,
 the map title will contain only some of it, but most (if not all) of
 the formula will be placed into the history file for the <em>result</em> map.
 <p>When the user enters input to <em>r3.mapcalc</em> non-interactively on
@@ -471,19 +480,19 @@
 
 <h3>Random number generator initialization</h3>
 <p>The pseudo-random number generator used by the rand() function can
-be initialised to a specific value using the <em>seed</em> option. 
+be initialised to a specific value using the <b>seed</b> option. 
 This can be used to replicate a previous calculation.
 <p>Alternatively, it can be initialised from the system time and the
-PID using the <em>-r</em> flag. This should result in a different seed
+PID using the <b>-r</b> flag. This should result in a different seed
 being used each time.
 <p>In either case, the seed will be written to the map's history, and
 can be seen using <em>r.info</em>.
 <p>If you want other people to be able to verify your results, it's
-preferable to use the <em>seed</em> option to supply a seed which is
+preferable to use the <b>seed</b> option to supply a seed which is
 either specified in the script or generated from a determenistic process
 such as a pseudo-random number generator given an explicit seed.
 <p>Note that the rand() function will generate a fatal error if neither
-the <em>seed</em> option nor the <em>-s</em> flag are given.
+the <b>seed</b> option nor the <b>-s</b> flag are given.
 
 <h2>EXAMPLES</h2>
 To compute the average of two 3D grids
@@ -541,25 +550,36 @@
 
 
 <h2>KNOWN ISSUES</h2>
-Continuation lines must end with a \ and have NO trailing white space
-(blanks or tabs).  If the user does leave white space at the end of
+
+Continuation lines must end with a <tt>\</tt> and have <em>no</em> trailing
+white space (blanks or tabs). If the user does leave white space at the end of
 continuation lines, the error messages produced by <em>r3.mapcalc</em> will
 be meaningless and the equation will not work as the user intended.
-This is important for the eval() function.
+This is particularly important for the <tt>eval()</tt> function.
 <p><!-- STILL TRUE ??-->
-Currently, there is no comment mechanism in <em>r3.mapcalc</em>. Perhaps
-adding a capability that would cause the entire line to be ignored when
-the user inserted a # at the start of a line as if it were not present,
-would do the trick.
+Currently, there is no comment mechanism in <em>r3.mapcalc</em>.
+Perhaps adding a capability that would cause the entire line to be
+ignored when the user inserted a # at the start of a line
+as if it were not present, would do the trick.
 <p>The function should require the user to type "end" or "exit" instead
 of simply a blank line. This would make separation of multiple scripts
 separable by white space.
-<p>r3.mapcalc does not print a warning in case of operations on NULL cells.
-It is left to the user to utilize the isnull() function.
+<p><em>r3.mapcalc</em> does not print a warning in case of operations on
+NULL cells. It is left to the user to utilize the <tt>isnull()</tt> function.
 
 
 <h2>SEE ALSO</h2>
-<b><a href="http://grass.osgeo.org/uploads/grass/history_docs/mapcalc-algebra.pdf">r3.mapcalc: An Algebra for GIS and Image
+
+<em>
+<a href="g.region.html">g.region</a>,
+<a href="r3.colors.html">r3.colors</a>,
+<a href="r.mapcalc.html">r.mapcalc</a>
+</em>
+
+
+<h2>REFERENCES</h2>
+
+<b><a href="http://grass.osgeo.org/uploads/grass/history_docs/mapcalc-algebra.pdf">r.mapcalc: An Algebra for GIS and Image
 Processing</a></b>, by Michael Shapiro and Jim Westervelt, U.S. Army
 Construction Engineering Research Laboratory (March/1991).
 <p> 
@@ -572,12 +592,12 @@
 Brovelli, M. (ed.)(2001): The Geomatics Workbook N. 2. Politecnico di Milano,
 Italy (ISSN 1591-092X) (<a href="http://geomatica.como.polimi.it/workbooks/n2/articoli/mn2.pdf">PDF</a>)
 
-<p><em><a href="r.mapcalc.html">r.mapcalc</a></em>
 
-
 <h2>AUTHORS</h2>
 Tomas Paudits & Jaro Hofierka, funded by GeoModel s.r.o., Slovakia
 <br><a href="mailto:tpaudits at mailbox.sk">tpaudits at mailbox.sk</a>,
 <a href="MAILTO:hofierka at geomodel.sk">hofierka at geomodel.sk</a>
+<p>Glynn Clements
 
-<p><i>Last changed: $Date$</i>
+<p>
+<i>Last changed: $Date$</i>



More information about the grass-commit mailing list