Opened 9 years ago

Closed 8 years ago

#2594 closed defect (invalid)

r.univar output error

Reported by: richardc Owned by: grass-dev@…
Priority: normal Milestone: 7.0.5
Component: Raster Version: svn-releasebranch70
Keywords: r.univar statistics zones Cc:
CPU: x86-32 Platform: Linux

Description (last modified by martinl)

There appears to be an error in the output of r.univar when -g and -t options are NOT used. It looks like a formatting error, where there is a mismatch between categories reported in r.univar and the actual category in the zone file. E.g. category 2 reported by r.univar is derived from category 1 of the zones file.

Example of output with -g and -t options:

r.univar -g -t map=cahpa_i0apr_05216_nc_remapped_nc_1@prcp05216ijk zones=BMR_bndry_epsg4326_rasterized@prcp05216ijk
zone|label|non_null_cells|null_cells|min|max|range|mean|mean_of_abs|stddev|variance|coeff_var|sum|sum_abs
1|Category 1|2|0|3.58209799742326e-05|6.23035812168382e-05|2.64826012426056e-05|4.90622805955354e-05|4.90622805955354e-05|1.32413006213028e-05|1.75332042143714e-10|26.9887589010849|9.81245611910708e-05|9.81245611910708e-05
2|Category 2|1|0|3.53023679053877e-05|3.53023679053877e-05|0|3.53023679053877e-05|3.53023679053877e-05|0|0|0|3.53023679053877e-05|3.53023679053877e-05
3|Category 3|2|0|5.02148177474737e-05|8.14341983641498e-05|3.12193806166761e-05|6.58245080558117e-05|6.58245080558117e-05|1.5609690308338e-05|2.43662431522222e-10|23.7141009775611|0.000131649016111623|0.000131649016111623
4|Category 4|3|0|4.46328085672576e-05|8.2188387750648e-05|3.75555791833904e-05|6.12175620820684e-05|6.12175620820684e-05|1.56425403660131e-05|2.4468906910235e-10|25.552373916888|0.000183652686246205|0.000183652686246205
5|Category 5|3|0|3.81464305974077e-05|6.24195599812083e-05|2.42731293838006e-05|4.99398726484893e-05|4.99398726484893e-05|9.92133734132678e-06|9.8432934640405e-11|19.8665651615892|0.000149819617945468|0.000149819617945468
6|Category 6|2|0|1.89598704309901e-05|7.74326545069925e-05|5.84727840760024e-05|4.81962624689913e-05|4.81962624689913e-05|2.92363920380012e-05|8.54766619399701e-10|60.6611188093919|9.63925249379827e-05|9.63925249379827e-05

Example without -t and -g options:

r.univar map=cahpa_i0apr_05216_nc_remapped_nc_1@prcp05216ijk zones=BMR_bndry_epsg4326_rasterized@prcp05216ijk
zone 1 Category 1
total null and non-null cells: 2
total null cells: 0
Of the non-null cells:
----------------------
n: 2
minimum: 3.5821e-05
maximum: 6.23036e-05
range: 2.64826e-05
mean: 4.90623e-05
mean of absolute values: 4.90623e-05
standard deviation: 1.32413e-05
variance: 1.75332e-10
variation coefficient: 26.9888 %
sum: 9.81245611910708e-05
zone 2 Category 2
total null and non-null cells: 1
total null cells: 0
Of the non-null cells:
----------------------
n: 1
minimum: 3.53024e-05
maximum: 3.53024e-05
range: 0
mean: 3.53024e-05
mean of absolute values: 3.53024e-05
standard deviation: 0
variance: 0
variation coefficient: 0 %
sum: 3.53023679053877e-05
zone 3 Category 3
total null and non-null cells: 2
total null cells: 0
Of the non-null cells:
----------------------
n: 2
minimum: 5.02148e-05
maximum: 8.14342e-05
range: 3.12194e-05
mean: 6.58245e-05
mean of absolute values: 6.58245e-05
standard deviation: 1.56097e-05
variance: 2.43662e-10
variation coefficient: 23.7141 %
sum: 0.000131649016111623
zone 4 Category 4
total null and non-null cells: 3
total null cells: 0
Of the non-null cells:
----------------------
n: 3
minimum: 4.46328e-05
maximum: 8.21884e-05
range: 3.75556e-05
mean: 6.12176e-05
mean of absolute values: 6.12176e-05
standard deviation: 1.56425e-05
variance: 2.44689e-10
variation coefficient: 25.5524 %
sum: 0.000183652686246205
zone 5 Category 5
total null and non-null cells: 3
total null cells: 0
Of the non-null cells:
----------------------
n: 3
minimum: 3.81464e-05
maximum: 6.24196e-05
range: 2.42731e-05
mean: 4.99399e-05
mean of absolute values: 4.99399e-05
standard deviation: 9.92134e-06
variance: 9.84329e-11
variation coefficient: 19.8666 %
sum: 0.000149819617945468
zone 6 Category 6
total null and non-null cells: 2
total null cells: 0
Of the non-null cells:
----------------------
n: 2
minimum: 1.89599e-05
maximum: 7.74327e-05
range: 5.84728e-05
mean: 4.81963e-05
mean of absolute values: 4.81963e-05
standard deviation: 2.92364e-05
variance: 8.54767e-10
variation coefficient: 60.6611 %
sum: 9.63925249379827e-05
GRASS version: 
7.0.0svn                                                         
GRASS SVN Revision: 64042                                                       
Build Date: 2015-01-10                                                          
Build Platform: i686-pc-linux-gnu                                               
GDAL/OGR: 1.11.1                                                                
PROJ.4: 4.9.0                                                                   
GEOS: 3.4.2                                                                     
SQLite: 3.7.9                                                                   
Python: 2.7.3                                                                   
wxPython: 2.8.12.1                                                              
Platform: Linux-3.2.0-31-generic-pae-i686-with-LinuxMint-13-maya

Change History (8)

comment:1 by martinl, 9 years ago

Description: modified (diff)

comment:2 by mlennert, 9 years ago

I don't see where the problem is.

With -gt you report:

1|Category 1|2|0|3.58209799742326e-05|6.23035812168382e-05|2.64826012426056e-05|4.90622805955354e-05|4.90622805955354e-05|1.32413006213028e-05|1.75332042143714e-10|26.9887589010849|9.81245611910708e-05|9.81245611910708e-05

without:

zone 1 Category 1
total null and non-null cells: 2
total null cells: 0
Of the non-null cells:
----------------------
n: 2
minimum: 3.5821e-05
maximum: 6.23036e-05
range: 2.64826e-05
mean: 4.90623e-05
mean of absolute values: 4.90623e-05
standard deviation: 1.32413e-05
variance: 1.75332e-10
variation coefficient: 26.9888 %
sum: 9.81245611910708e-05

Where is the difference ?

Unless you can specify, I will close this as invalid.

comment:3 by neteler, 9 years ago

Milestone: 7.0.17.0.2

Ticket retargeted after 7.0.1 milestone closed

comment:4 by neteler, 8 years ago

Milestone: 7.0.27.0.3

Ticket retargeted after milestone closed

comment:5 by neteler, 8 years ago

Milestone: 7.0.3

Ticket retargeted after milestone closed

comment:6 by neteler, 8 years ago

Milestone: 7.0.4

Ticket retargeted after 7.0.3 milestone closed

comment:7 by martinl, 8 years ago

Milestone: 7.0.47.0.5

comment:8 by martinl, 8 years ago

Resolution: invalid
Status: newclosed
Note: See TracTickets for help on using tickets.