Hi,

In GRASS 7 (RC1) python it is possible to export a raster map to an array
which can be used e.g. by Numpy.

For example:

import grass.script.array as garray
x1 = garray.array()
x1.read("my_raster")

It seems that this creates a temporary file in the .tmp folder of the
respective
location. I am not sure if this has been existing before, but these
temporary
files are not deleted after e.g. x1 is not used anymore (i.e. the
calculation of
the script finished). So do I need to manually (in the python script) close
that x1 so
that the associated temporary file gets deleted (and if yes how?)? Otherwise
when using this procedure to do numpy calculations in loops the tmp-files
pile up quite fast.

Of course I can empty the tmp folder after every loop, but I am not sure
if this is really the right way.

Any suggestions?

/Johannes
_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

Reply via email to