[GRASS-user] Null-value in grass python array

Johannes Radinger johannesradinger at gmail.com
Fri Oct 10 04:32:17 PDT 2014


I am using the GRASS-numpy functionality [1] to read a python numpy.array
from a GRASS raster map (GRASS7):

import grass.script.array as garray

a = garray.array()


Here [2] it says that also the null value can be specified. So what is the
actual null value in GRASS so that the raster map is correctly saved as
numpy.array with numpy.nan where appropriate?

And a second related question: Does grass.script.array.read() respect an
MASK so that areas that are masked will get numpy.nan? Of course this can
also be done within numpy like map[numpy.isnan(mask)] but this again needs
to properly define the nan value when reading the raster mask into an

Best regards,

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20141010/de805154/attachment.html>

More information about the grass-user mailing list