[GRASS-SVN] r61288 - grass/trunk/scripts/i.oif
svn_grass at osgeo.org
svn_grass at osgeo.org
Mon Jul 21 02:02:42 PDT 2014
Author: huhabla
Date: 2014-07-21 02:02:42 -0700 (Mon, 21 Jul 2014)
New Revision: 61288
Modified:
grass/trunk/scripts/i.oif/i.oif.py
Log:
i.oif: Fixed r.covar output parsing
Modified: grass/trunk/scripts/i.oif/i.oif.py
===================================================================
--- grass/trunk/scripts/i.oif/i.oif.py 2014-07-20 16:03:02 UTC (rev 61287)
+++ grass/trunk/scripts/i.oif/i.oif.py 2014-07-21 09:02:42 UTC (rev 61288)
@@ -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