[GRASS-user] r.covar and its n-value

Moritz Lennert mlennert at club.worldonline.be
Mon May 5 06:35:54 PDT 2014


On 02/05/14 11:27, Moritz Lennert wrote:
> On 01/05/14 20:12, Vladimír Fárek wrote:
>> Hello friends,
>> I'm little bit confused about the r.covar correlation outputs. Do
>> r.covar counts all cells in compared grids, or uses it only
>> sample-cells? How to find out the n-value of given outputs?
>
> n is the number of non-null cells in the current region. Null cells are
> all cells for which at least one of the map has a null-value.
>
> I just committed a small addition to r.covar in grass_trunk that also
> outputs the N value.

It's now in all branches.

So either recompile r.covar with the change, or (if you are on windows) 
wait for a new snapshot executable.

In the meantime you can
find out all the cells that have non-null values in all maps like this:

g.region rast=map1,map2[,map3,...]
r.mapcalc "testnull = if(isnull(map1) || isnull(map2) [|| isnull(map3) 
|| ...], 0, 1)"
r.univar testnull

Look at sum.

Moritz


More information about the grass-user mailing list