[GRASS-SVN] r49097 - grass/trunk/lib/python

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Nov 4 18:06:05 EDT 2011


Author: neteler
Date: 2011-11-04 15:06:05 -0700 (Fri, 04 Nov 2011)
New Revision: 49097

Modified:
   grass/trunk/lib/python/array.py
Log:
+code example

Modified: grass/trunk/lib/python/array.py
===================================================================
--- grass/trunk/lib/python/array.py	2011-11-04 22:05:56 UTC (rev 49096)
+++ grass/trunk/lib/python/array.py	2011-11-04 22:06:05 UTC (rev 49097)
@@ -7,8 +7,12 @@
 Usage:
 
 @code
-from grass.script import array as garray
-...
+    map = 'elevation'
+    x = garray.array()
+    x.read(map)
+    # calculate something on array
+    x[...] = x / 50.
+    x.write(map + ".new")
 @endcode
 
 (C) 2010-2011 by Glynn Clements and the GRASS Development Team



More information about the grass-commit mailing list