[GRASS-SVN] r46787 - grass/trunk/raster3d/r3.stats

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Jun 26 09:52:04 EDT 2011


Author: huhabla
Date: 2011-06-26 06:52:04 -0700 (Sun, 26 Jun 2011)
New Revision: 46787

Added:
   grass/trunk/raster3d/r3.stats/test.r3.stats.sh
   grass/trunk/raster3d/r3.stats/test_volume_double_stats_1.ref
   grass/trunk/raster3d/r3.stats/test_volume_double_stats_18.ref
   grass/trunk/raster3d/r3.stats/test_volume_double_stats_22.ref
   grass/trunk/raster3d/r3.stats/test_volume_double_stats_3.ref
   grass/trunk/raster3d/r3.stats/test_volume_double_stats_9.ref
   grass/trunk/raster3d/r3.stats/test_volume_double_stats_e.ref
   grass/trunk/raster3d/r3.stats/test_volume_float_stats_1.ref
   grass/trunk/raster3d/r3.stats/test_volume_float_stats_14.ref
   grass/trunk/raster3d/r3.stats/test_volume_float_stats_2.ref
   grass/trunk/raster3d/r3.stats/test_volume_float_stats_21.ref
   grass/trunk/raster3d/r3.stats/test_volume_float_stats_7.ref
   grass/trunk/raster3d/r3.stats/test_volume_float_stats_e.ref
Modified:
   grass/trunk/raster3d/r3.stats/r3.stats.html
Log:
Added test case for r3.stats


Modified: grass/trunk/raster3d/r3.stats/r3.stats.html
===================================================================
--- grass/trunk/raster3d/r3.stats/r3.stats.html	2011-06-26 09:45:07 UTC (rev 46786)
+++ grass/trunk/raster3d/r3.stats/r3.stats.html	2011-06-26 13:52:04 UTC (rev 46787)
@@ -13,7 +13,6 @@
 array defined by the current 3D region settings, not the original extent and
 resolution of the input map. See <em><A HREF="g.region.html">g.region</A></em>.
 <P>
-The region setting will not effect the memory consumption of this module.
 The number of subranges in case of value range calculation or the number of 
 equal value groups effect the memory consumption and the calculation time.
 You can expect a huge time consumption to calculate the equal value groups (flag <em>-e</em>)

Added: grass/trunk/raster3d/r3.stats/test.r3.stats.sh
===================================================================
--- grass/trunk/raster3d/r3.stats/test.r3.stats.sh	                        (rev 0)
+++ grass/trunk/raster3d/r3.stats/test.r3.stats.sh	2011-06-26 13:52:04 UTC (rev 46787)
@@ -0,0 +1,30 @@
+# Tests for r3.stats
+
+# We set up a specific region in the
+# @preprocess step of this test. We generate
+# voxel data with r3.mapcalc. The region setting 
+# should work for UTM and LL test locations
+g.region s=0 n=80 w=0 e=120 b=0 t=50 res=10 res3=10 -p3
+# We create several (float, double, null value) voxel map
+# with value = col + row + depth. 
+r3.mapcalc --o expr="volume_float = float(col() + row() + depth())"
+r3.mapcalc --o expr="volume_double = double(col() + row() + depth())"
+# Add null value information to test correct null value handling
+r3.mapcalc --o expr="volume_float_null = if(row() == 1 || row() == 5, null(), volume_float)"
+r3.mapcalc --o expr="volume_double_null = if(row() == 2 || row() == 6, null(), volume_double)"
+
+# @test r3.stats with float maps and @file validation. 
+# The module output on stdout is piped into text files
+r3.stats input=volume_float_null nsteps=1 > test_volume_float_stats_1.txt
+r3.stats input=volume_float_null nsteps=2  > test_volume_float_stats_2.txt
+r3.stats input=volume_float_null nsteps=7  > test_volume_float_stats_7.txt
+r3.stats input=volume_float_null nsteps=14 > test_volume_float_stats_14.txt
+r3.stats input=volume_float_null nsteps=21 > test_volume_float_stats_21.txt
+r3.stats -e input=volume_float_null > test_volume_float_stats_e.txt
+# Test double maps
+r3.stats input=volume_double_null nsteps=1  > test_volume_double_stats_1.txt
+r3.stats input=volume_double_null nsteps=3  > test_volume_double_stats_3.txt
+r3.stats input=volume_double_null nsteps=9  > test_volume_double_stats_9.txt
+r3.stats input=volume_double_null nsteps=18 > test_volume_double_stats_18.txt
+r3.stats input=volume_double_null nsteps=22 > test_volume_double_stats_22.txt
+r3.stats -e input=volume_double_null > test_volume_double_stats_e.txt

Added: grass/trunk/raster3d/r3.stats/test_volume_double_stats_1.ref
===================================================================
--- grass/trunk/raster3d/r3.stats/test_volume_double_stats_1.ref	                        (rev 0)
+++ grass/trunk/raster3d/r3.stats/test_volume_double_stats_1.ref	2011-06-26 13:52:04 UTC (rev 46787)
@@ -0,0 +1,13 @@
+  num   | minimum <= value   | value < maximum    |     volume    |   perc  | cell count
+      1          3.000000000         25.000000001      360000.000   75.00000          360
+      2                    *                    *      120000.000   25.00000          120
+
+Sum of non Null cells: 
+	Volume =    360000.000 
+	Percentage =  75.000  
+	Cell count = 360
+
+Sum of all cells: 
+	Volume =    480000.000 
+	Percentage = 100.000  
+	Cell count = 480

Added: grass/trunk/raster3d/r3.stats/test_volume_double_stats_18.ref
===================================================================
--- grass/trunk/raster3d/r3.stats/test_volume_double_stats_18.ref	                        (rev 0)
+++ grass/trunk/raster3d/r3.stats/test_volume_double_stats_18.ref	2011-06-26 13:52:04 UTC (rev 46787)
@@ -0,0 +1,30 @@
+  num   | minimum <= value   | value < maximum    |     volume    |   perc  | cell count
+      1          3.000000000          4.222222222        3000.000   0.62500            3
+      2          4.222222222          5.444444444        4000.000   0.83333            4
+      3          5.444444444          6.666666667        7000.000   1.45833            7
+      4          6.666666667          7.888888889       11000.000   2.29167           11
+      5          7.888888889          9.111111111       32000.000   6.66667           32
+      6          9.111111111         10.333333333       22000.000   4.58333           22
+      7         10.333333333         11.555555556       25000.000   5.20833           25
+      8         11.555555556         12.777777778       27000.000   5.62500           27
+      9         12.777777778         14.000000000       29000.000   6.04167           29
+     10         14.000000000         15.222222222       59000.000   12.29167           59
+     11         15.222222222         16.444444444       28000.000   5.83333           28
+     12         16.444444444         17.666666667       26000.000   5.41667           26
+     13         17.666666667         18.888888889       23000.000   4.79167           23
+     14         18.888888889         20.111111111       35000.000   7.29167           35
+     15         20.111111111         21.333333333       12000.000   2.50000           12
+     16         21.333333333         22.555555556        8000.000   1.66667            8
+     17         22.555555556         23.777777778        5000.000   1.04167            5
+     18         23.777777778         25.000000001        4000.000   0.83333            4
+     19                    *                    *      120000.000   25.00000          120
+
+Sum of non Null cells: 
+	Volume =    360000.000 
+	Percentage =  75.000  
+	Cell count = 360
+
+Sum of all cells: 
+	Volume =    480000.000 
+	Percentage = 100.000  
+	Cell count = 480

Added: grass/trunk/raster3d/r3.stats/test_volume_double_stats_22.ref
===================================================================
--- grass/trunk/raster3d/r3.stats/test_volume_double_stats_22.ref	                        (rev 0)
+++ grass/trunk/raster3d/r3.stats/test_volume_double_stats_22.ref	2011-06-26 13:52:04 UTC (rev 46787)
@@ -0,0 +1,34 @@
+  num   | minimum <= value   | value < maximum    |     volume    |   perc  | cell count
+      1          3.000000000          4.000000000        1000.000   0.20833            1
+      2          4.000000000          5.000000000        2000.000   0.41667            2
+      3          5.000000000          6.000000000        4000.000   0.83333            4
+      4          6.000000000          7.000000000        7000.000   1.45833            7
+      5          7.000000000          8.000000000       11000.000   2.29167           11
+      6          8.000000000          9.000000000       14000.000   2.91667           14
+      7          9.000000000         10.000000000       18000.000   3.75000           18
+      8         10.000000000         11.000000000       22000.000   4.58333           22
+      9         11.000000000         12.000000000       25000.000   5.20833           25
+     10         12.000000000         13.000000000       27000.000   5.62500           27
+     11         13.000000000         14.000000000       29000.000   6.04167           29
+     12         14.000000000         15.000000000       30000.000   6.25000           30
+     13         15.000000000         16.000000000       29000.000   6.04167           29
+     14         16.000000000         17.000000000       28000.000   5.83333           28
+     15         17.000000000         18.000000000       26000.000   5.41667           26
+     16         18.000000000         19.000000000       23000.000   4.79167           23
+     17         19.000000000         20.000000000       19000.000   3.95833           19
+     18         20.000000000         21.000000000       16000.000   3.33333           16
+     19         21.000000000         22.000000000       12000.000   2.50000           12
+     20         22.000000000         23.000000000        8000.000   1.66667            8
+     21         23.000000000         24.000000000        5000.000   1.04167            5
+     22         24.000000000         25.000000001        4000.000   0.83333            4
+     23                    *                    *      120000.000   25.00000          120
+
+Sum of non Null cells: 
+	Volume =    360000.000 
+	Percentage =  75.000  
+	Cell count = 360
+
+Sum of all cells: 
+	Volume =    480000.000 
+	Percentage = 100.000  
+	Cell count = 480

Added: grass/trunk/raster3d/r3.stats/test_volume_double_stats_3.ref
===================================================================
--- grass/trunk/raster3d/r3.stats/test_volume_double_stats_3.ref	                        (rev 0)
+++ grass/trunk/raster3d/r3.stats/test_volume_double_stats_3.ref	2011-06-26 13:52:04 UTC (rev 46787)
@@ -0,0 +1,15 @@
+  num   | minimum <= value   | value < maximum    |     volume    |   perc  | cell count
+      1          3.000000000         10.333333333       79000.000   16.45833           79
+      2         10.333333333         17.666666667      194000.000   40.41667          194
+      3         17.666666667         25.000000001       87000.000   18.12500           87
+      4                    *                    *      120000.000   25.00000          120
+
+Sum of non Null cells: 
+	Volume =    360000.000 
+	Percentage =  75.000  
+	Cell count = 360
+
+Sum of all cells: 
+	Volume =    480000.000 
+	Percentage = 100.000  
+	Cell count = 480

Added: grass/trunk/raster3d/r3.stats/test_volume_double_stats_9.ref
===================================================================
--- grass/trunk/raster3d/r3.stats/test_volume_double_stats_9.ref	                        (rev 0)
+++ grass/trunk/raster3d/r3.stats/test_volume_double_stats_9.ref	2011-06-26 13:52:04 UTC (rev 46787)
@@ -0,0 +1,21 @@
+  num   | minimum <= value   | value < maximum    |     volume    |   perc  | cell count
+      1          3.000000000          5.444444444        7000.000   1.45833            7
+      2          5.444444444          7.888888889       18000.000   3.75000           18
+      3          7.888888889         10.333333333       54000.000   11.25000           54
+      4         10.333333333         12.777777778       52000.000   10.83333           52
+      5         12.777777778         15.222222222       88000.000   18.33333           88
+      6         15.222222222         17.666666667       54000.000   11.25000           54
+      7         17.666666667         20.111111111       58000.000   12.08333           58
+      8         20.111111111         22.555555556       20000.000   4.16667           20
+      9         22.555555556         25.000000001        9000.000   1.87500            9
+     10                    *                    *      120000.000   25.00000          120
+
+Sum of non Null cells: 
+	Volume =    360000.000 
+	Percentage =  75.000  
+	Cell count = 360
+
+Sum of all cells: 
+	Volume =    480000.000 
+	Percentage = 100.000  
+	Cell count = 480

Added: grass/trunk/raster3d/r3.stats/test_volume_double_stats_e.ref
===================================================================
--- grass/trunk/raster3d/r3.stats/test_volume_double_stats_e.ref	                        (rev 0)
+++ grass/trunk/raster3d/r3.stats/test_volume_double_stats_e.ref	2011-06-26 13:52:04 UTC (rev 46787)
@@ -0,0 +1,36 @@
+  num   |        value       |     volume    |   perc  | cell count
+      1             3.000000        1000.000   0.20833            1
+      2             4.000000        2000.000   0.41667            2
+      3             5.000000        4000.000   0.83333            4
+      4             6.000000        7000.000   1.45833            7
+      5             7.000000       11000.000   2.29167           11
+      6             8.000000       14000.000   2.91667           14
+      7             9.000000       18000.000   3.75000           18
+      8            10.000000       22000.000   4.58333           22
+      9            11.000000       25000.000   5.20833           25
+     10            12.000000       27000.000   5.62500           27
+     11            13.000000       29000.000   6.04167           29
+     12            14.000000       30000.000   6.25000           30
+     13            15.000000       29000.000   6.04167           29
+     14            16.000000       28000.000   5.83333           28
+     15            17.000000       26000.000   5.41667           26
+     16            18.000000       23000.000   4.79167           23
+     17            19.000000       19000.000   3.95833           19
+     18            20.000000       16000.000   3.33333           16
+     19            21.000000       12000.000   2.50000           12
+     20            22.000000        8000.000   1.66667            8
+     21            23.000000        5000.000   1.04167            5
+     22            24.000000        3000.000   0.62500            3
+     23            25.000000        1000.000   0.20833            1
+     24                    *      120000.000   25.00000          120
+
+Number of groups with equal values: 23
+Sum of non Null cells: 
+	Volume =    360000.000 
+	Percentage =  75.000  
+	Cell count = 360
+
+Sum of all cells: 
+	Volume =    480000.000 
+	Percentage = 100.000  
+	Cell count = 480

Added: grass/trunk/raster3d/r3.stats/test_volume_float_stats_1.ref
===================================================================
--- grass/trunk/raster3d/r3.stats/test_volume_float_stats_1.ref	                        (rev 0)
+++ grass/trunk/raster3d/r3.stats/test_volume_float_stats_1.ref	2011-06-26 13:52:04 UTC (rev 46787)
@@ -0,0 +1,13 @@
+  num   | minimum <= value   | value < maximum    |     volume    |   perc  | cell count
+      1          4.000000000         25.000000001      360000.000   75.00000          360
+      2                    *                    *      120000.000   25.00000          120
+
+Sum of non Null cells: 
+	Volume =    360000.000 
+	Percentage =  75.000  
+	Cell count = 360
+
+Sum of all cells: 
+	Volume =    480000.000 
+	Percentage = 100.000  
+	Cell count = 480

Added: grass/trunk/raster3d/r3.stats/test_volume_float_stats_14.ref
===================================================================
--- grass/trunk/raster3d/r3.stats/test_volume_float_stats_14.ref	                        (rev 0)
+++ grass/trunk/raster3d/r3.stats/test_volume_float_stats_14.ref	2011-06-26 13:52:04 UTC (rev 46787)
@@ -0,0 +1,26 @@
+  num   | minimum <= value   | value < maximum    |     volume    |   perc  | cell count
+      1          4.000000000          5.500000000        4000.000   0.83333            4
+      2          5.500000000          7.000000000        6000.000   1.25000            6
+      3          7.000000000          8.500000000       22000.000   4.58333           22
+      4          8.500000000         10.000000000       17000.000   3.54167           17
+      5         10.000000000         11.500000000       45000.000   9.37500           45
+      6         11.500000000         13.000000000       27000.000   5.62500           27
+      7         13.000000000         14.500000000       59000.000   12.29167           59
+      8         14.500000000         16.000000000       30000.000   6.25000           30
+      9         16.000000000         17.500000000       56000.000   11.66667           56
+     10         17.500000000         19.000000000       24000.000   5.00000           24
+     11         19.000000000         20.500000000       38000.000   7.91667           38
+     12         20.500000000         22.000000000       13000.000   2.70833           13
+     13         22.000000000         23.500000000       15000.000   3.12500           15
+     14         23.500000000         25.000000001        4000.000   0.83333            4
+     15                    *                    *      120000.000   25.00000          120
+
+Sum of non Null cells: 
+	Volume =    360000.000 
+	Percentage =  75.000  
+	Cell count = 360
+
+Sum of all cells: 
+	Volume =    480000.000 
+	Percentage = 100.000  
+	Cell count = 480

Added: grass/trunk/raster3d/r3.stats/test_volume_float_stats_2.ref
===================================================================
--- grass/trunk/raster3d/r3.stats/test_volume_float_stats_2.ref	                        (rev 0)
+++ grass/trunk/raster3d/r3.stats/test_volume_float_stats_2.ref	2011-06-26 13:52:04 UTC (rev 46787)
@@ -0,0 +1,14 @@
+  num   | minimum <= value   | value < maximum    |     volume    |   perc  | cell count
+      1          4.000000000         14.500000000      180000.000   37.50000          180
+      2         14.500000000         25.000000001      180000.000   37.50000          180
+      3                    *                    *      120000.000   25.00000          120
+
+Sum of non Null cells: 
+	Volume =    360000.000 
+	Percentage =  75.000  
+	Cell count = 360
+
+Sum of all cells: 
+	Volume =    480000.000 
+	Percentage = 100.000  
+	Cell count = 480

Added: grass/trunk/raster3d/r3.stats/test_volume_float_stats_21.ref
===================================================================
--- grass/trunk/raster3d/r3.stats/test_volume_float_stats_21.ref	                        (rev 0)
+++ grass/trunk/raster3d/r3.stats/test_volume_float_stats_21.ref	2011-06-26 13:52:04 UTC (rev 46787)
@@ -0,0 +1,33 @@
+  num   | minimum <= value   | value < maximum    |     volume    |   perc  | cell count
+      1          4.000000000          5.000000000        1000.000   0.20833            1
+      2          5.000000000          6.000000000        3000.000   0.62500            3
+      3          6.000000000          7.000000000        6000.000   1.25000            6
+      4          7.000000000          8.000000000        9000.000   1.87500            9
+      5          8.000000000          9.000000000       13000.000   2.70833           13
+      6          9.000000000         10.000000000       17000.000   3.54167           17
+      7         10.000000000         11.000000000       21000.000   4.37500           21
+      8         11.000000000         12.000000000       24000.000   5.00000           24
+      9         12.000000000         13.000000000       27000.000   5.62500           27
+     10         13.000000000         14.000000000       29000.000   6.04167           29
+     11         14.000000000         15.000000000       30000.000   6.25000           30
+     12         15.000000000         16.000000000       30000.000   6.25000           30
+     13         16.000000000         17.000000000       29000.000   6.04167           29
+     14         17.000000000         18.000000000       27000.000   5.62500           27
+     15         18.000000000         19.000000000       24000.000   5.00000           24
+     16         19.000000000         20.000000000       21000.000   4.37500           21
+     17         20.000000000         21.000000000       17000.000   3.54167           17
+     18         21.000000000         22.000000000       13000.000   2.70833           13
+     19         22.000000000         23.000000000        9000.000   1.87500            9
+     20         23.000000000         24.000000000        6000.000   1.25000            6
+     21         24.000000000         25.000000001        4000.000   0.83333            4
+     22                    *                    *      120000.000   25.00000          120
+
+Sum of non Null cells: 
+	Volume =    360000.000 
+	Percentage =  75.000  
+	Cell count = 360
+
+Sum of all cells: 
+	Volume =    480000.000 
+	Percentage = 100.000  
+	Cell count = 480

Added: grass/trunk/raster3d/r3.stats/test_volume_float_stats_7.ref
===================================================================
--- grass/trunk/raster3d/r3.stats/test_volume_float_stats_7.ref	                        (rev 0)
+++ grass/trunk/raster3d/r3.stats/test_volume_float_stats_7.ref	2011-06-26 13:52:04 UTC (rev 46787)
@@ -0,0 +1,19 @@
+  num   | minimum <= value   | value < maximum    |     volume    |   perc  | cell count
+      1          4.000000000          7.000000000       10000.000   2.08333           10
+      2          7.000000000         10.000000000       39000.000   8.12500           39
+      3         10.000000000         13.000000000       72000.000   15.00000           72
+      4         13.000000000         16.000000000       89000.000   18.54167           89
+      5         16.000000000         19.000000000       80000.000   16.66667           80
+      6         19.000000000         22.000000000       51000.000   10.62500           51
+      7         22.000000000         25.000000001       19000.000   3.95833           19
+      8                    *                    *      120000.000   25.00000          120
+
+Sum of non Null cells: 
+	Volume =    360000.000 
+	Percentage =  75.000  
+	Cell count = 360
+
+Sum of all cells: 
+	Volume =    480000.000 
+	Percentage = 100.000  
+	Cell count = 480

Added: grass/trunk/raster3d/r3.stats/test_volume_float_stats_e.ref
===================================================================
--- grass/trunk/raster3d/r3.stats/test_volume_float_stats_e.ref	                        (rev 0)
+++ grass/trunk/raster3d/r3.stats/test_volume_float_stats_e.ref	2011-06-26 13:52:04 UTC (rev 46787)
@@ -0,0 +1,35 @@
+  num   |        value       |     volume    |   perc  | cell count
+      1             4.000000        1000.000   0.20833            1
+      2             5.000000        3000.000   0.62500            3
+      3             6.000000        6000.000   1.25000            6
+      4             7.000000        9000.000   1.87500            9
+      5             8.000000       13000.000   2.70833           13
+      6             9.000000       17000.000   3.54167           17
+      7            10.000000       21000.000   4.37500           21
+      8            11.000000       24000.000   5.00000           24
+      9            12.000000       27000.000   5.62500           27
+     10            13.000000       29000.000   6.04167           29
+     11            14.000000       30000.000   6.25000           30
+     12            15.000000       30000.000   6.25000           30
+     13            16.000000       29000.000   6.04167           29
+     14            17.000000       27000.000   5.62500           27
+     15            18.000000       24000.000   5.00000           24
+     16            19.000000       21000.000   4.37500           21
+     17            20.000000       17000.000   3.54167           17
+     18            21.000000       13000.000   2.70833           13
+     19            22.000000        9000.000   1.87500            9
+     20            23.000000        6000.000   1.25000            6
+     21            24.000000        3000.000   0.62500            3
+     22            25.000000        1000.000   0.20833            1
+     23                    *      120000.000   25.00000          120
+
+Number of groups with equal values: 22
+Sum of non Null cells: 
+	Volume =    360000.000 
+	Percentage =  75.000  
+	Cell count = 360
+
+Sum of all cells: 
+	Volume =    480000.000 
+	Percentage = 100.000  
+	Cell count = 480



More information about the grass-commit mailing list