[GRASS-SVN] r61289 - in grass/branches/releasebranch_7_0: . scripts/i.oif

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Jul 21 02:05:45 PDT 2014


Author: neteler
Date: 2014-07-21 02:05:45 -0700 (Mon, 21 Jul 2014)
New Revision: 61289

Modified:
   grass/branches/releasebranch_7_0/
   grass/branches/releasebranch_7_0/scripts/i.oif/i.oif.py
Log:
i.oif: Fixed r.covar output parsing (backport of r61288)


Property changes on: grass/branches/releasebranch_7_0
___________________________________________________________________
Added: svn:mergeinfo
   + /grass/trunk:61288

Modified: grass/branches/releasebranch_7_0/scripts/i.oif/i.oif.py
===================================================================
--- grass/branches/releasebranch_7_0/scripts/i.oif/i.oif.py	2014-07-21 09:02:42 UTC (rev 61288)
+++ grass/branches/releasebranch_7_0/scripts/i.oif/i.oif.py	2014-07-21 09:05:45 UTC (rev 61289)
@@ -125,7 +125,10 @@
     correlation = {}
     s = grass.read_command('r.covar', flags='r', map=[band for band in bands],
                            quiet=True)
-    for i, row in zip(bands, s.splitlines()):
+
+    # We need to skip the first line, since r.covar prints the number of values
+    lines = s.splitlines()
+    for i, row in zip(bands, lines[1:]):
         for j, cell in zip(bands, row.split(' ')):
             correlation[i, j] = float(cell)
 



More information about the grass-commit mailing list