Selaa lähdekoodia

r.univar: include sum, put statistics to description, improve manual (backport of https://trac.osgeo.org/grass/changeset/62185 and https://trac.osgeo.org/grass/changeset/62186)

git-svn-id: https://svn.osgeo.org/grass/grass/branches/releasebranch_7_0@62249 15284696-431f-4ddb-bdfa-cd5b030d7da7
Vaclav Petras 10 vuotta sitten
vanhempi
commit
cf4e3818f3

+ 2 - 2
raster/r.univar/r.univar.html

@@ -2,8 +2,8 @@
 
 
 <em>r.univar</em> calculates the univariate statistics of one or several raster
 <em>r.univar</em> calculates the univariate statistics of one or several raster
 map(s). This includes the number of cells counted, minimum and maximum cell
 map(s). This includes the number of cells counted, minimum and maximum cell
-values, range, arithmetic mean, population variance, standard deviation, and 
-coefficient of variation. Statistics are calculated separately for every
+values, range, arithmetic mean, population variance, standard deviation,
+coefficient of variation, and sum. Statistics are calculated separately for every
 category/zone found in the <b>zones</b> input map if given.
 category/zone found in the <b>zones</b> input map if given.
 If the <b>-e</b> extended statistics flag is given the 1st quartile, median,
 If the <b>-e</b> extended statistics flag is given the 1st quartile, median,
 3rd quartile, and given <b>percentile</b> are calculated.
 3rd quartile, and given <b>percentile</b> are calculated.

+ 6 - 1
raster/r.univar/r.univar_main.c

@@ -101,8 +101,13 @@ int main(int argc, char *argv[])
     G_add_keyword(_("statistics"));
     G_add_keyword(_("statistics"));
     G_add_keyword(_("univariate statistics"));
     G_add_keyword(_("univariate statistics"));
     G_add_keyword(_("zonal statistics"));
     G_add_keyword(_("zonal statistics"));
-    module->description =
+
+    module->label =
 	_("Calculates univariate statistics from the non-null cells of a raster map.");
 	_("Calculates univariate statistics from the non-null cells of a raster map.");
+    module->description =
+	_("Statistics include number of cells counted, minimum and maximum cell"
+	    " values, range, arithmetic mean, population variance, standard deviation,"
+	    " coefficient of variation, and sum.");
 
 
     /* Define the different options */
     /* Define the different options */
     set_params();
     set_params();

+ 16 - 3
raster/r.univar/r3.univar.html

@@ -1,9 +1,9 @@
 <h2>DESCRIPTION</h2>
 <h2>DESCRIPTION</h2>
 
 
-<em>r3.univar</em> calculates the univariate statistics for raster3d maps.
+<em>r3.univar</em> calculates the univariate statistics for a 3D raster map.
 This includes the number of cells counted, minimum and maximum cell values,
 This includes the number of cells counted, minimum and maximum cell values,
-range, arithmetic mean, population variance, standard deviation, and 
-coefficient of variation. Statistics are calculated separately for every
+range, arithmetic mean, population variance, standard deviation,
+coefficient of variation, and sum. Statistics are calculated separately for every
 category/zone found in the <b>zones</b> input map if given.
 category/zone found in the <b>zones</b> input map if given.
 If the <b>-e</b> extended statistics flag is given the 1st quartile, median,
 If the <b>-e</b> extended statistics flag is given the 1st quartile, median,
 3rd quartile, and given <b>percentile</b> are calculated.
 3rd quartile, and given <b>percentile</b> are calculated.
@@ -31,6 +31,19 @@ The <em>r.quantile</em> module will be significantly more efficient for
 calculating percentiles with large maps.
 calculating percentiles with large maps.
 -->
 -->
 
 
+<h2>EXAMPLE</h2>
+
+Computing univariate statistics of a 3D raster with randomly generated values:
+
+<div class="code"><pre>
+# generate random map
+r3.mapcalc "random_0_1 = rand(0., 1)" -s
+
+# compute univariate statistics
+r3.univar map=random_0_1
+</pre></div>
+
+
 <h2>TODO</h2>
 <h2>TODO</h2>
 
 
 <i>mode, skewness, kurtosis</i>
 <i>mode, skewness, kurtosis</i>

+ 5 - 1
raster/r.univar/r3.univar_main.c

@@ -99,8 +99,12 @@ int main(int argc, char *argv[])
     G_add_keyword(_("statistics"));
     G_add_keyword(_("statistics"));
     G_add_keyword(_("univariate statistics"));
     G_add_keyword(_("univariate statistics"));
 
 
+    module->label =
+	_("Calculates univariate statistics from the non-null cells of a 3D raster map.");
     module->description =
     module->description =
-	_("Calculates univariate statistics from the non-null 3d cells of a raster3d map.");
+	_("Statistics include number of cells counted, minimum and maximum cell"
+	    " values, range, arithmetic mean, population variance, standard deviation,"
+	    " coefficient of variation, and sum.");
 
 
     /* Define the different options */
     /* Define the different options */
     set_params();
     set_params();