[GRASS-dev] r.univar: 'nan' results

Hamish hamish_nospam at yahoo.com
Sun Sep 17 05:04:11 EDT 2006


Maciej Sieczka wrote:
> I've just noticed the r.univar.sh output is also screwed OK - the max
> value is nan here! What the devil?!
> 
> > $ r.univar.sh cieki10_2zl_dir
> > WARNING: This module is superseded and will be removed in future
> > versions of GRASS. Use the much faster r.univar instead.
> > 
> > Calculation for map cieki10_2zl_dir (ignoring NULL cells)...
> > Reading raster map...
> > r.stats:  100%
> > Calculating statistics...
> > 
> > Number of cells (excluding NULL cells): 4123
> > Minimum: 0
> > Maximum: nan
>             ^
>          ???!!!

(nan = not a number, GRASS uses NULL for the same idea, but NULL is not
the same as nan.)


If there are nan in the cell data, the r.univar calculations can't cope.
The question is: how did nan cells get into the input raster map?

There is a possibility that there is a bug in r.univar..
Try using r.mapcalc to isolate the nans? What does "r.info -r" say?


Hamish




More information about the grass-dev mailing list