[GRASS-SVN] r64049 - grass-addons/grass7/raster/r.mess
svn_grass at osgeo.org
svn_grass at osgeo.org
Sat Jan 10 15:04:51 PST 2015
Author: pvanbosgeo
Date: 2015-01-10 15:04:51 -0800 (Sat, 10 Jan 2015)
New Revision: 64049
Modified:
grass-addons/grass7/raster/r.mess/r.mess.py
Log:
bugfix
Modified: grass-addons/grass7/raster/r.mess/r.mess.py
===================================================================
--- grass-addons/grass7/raster/r.mess/r.mess.py 2015-01-10 20:25:47 UTC (rev 64048)
+++ grass-addons/grass7/raster/r.mess/r.mess.py 2015-01-10 23:04:51 UTC (rev 64049)
@@ -266,7 +266,7 @@
stval = {}
for line in p.stdout:
[val,count] = line.strip(os.linesep).split(';')
- stval[int(val)] = int(count)
+ stval[float(val)] = float(count)
p.wait()
sstval = sorted(stval.items(), key=operator.itemgetter(0))
sstval = np.matrix(sstval)
@@ -311,7 +311,7 @@
a2 = np.hstack([np.array(sstval.T[0])[0,:] -1, (e2)])
b1 = np.hstack([(0), c])
- tmprule = tempfile.mkstemp()
+ tmprule = tempfile.mkstemp(suffix=ipn[i])
text_file = open(tmprule[1], "w")
for k in np.arange(0,len(b1.T)):
rtmp = str(int(a1[k])) + ":" + str(int(a2[k])) + ":" + str(b1[k])
@@ -337,6 +337,7 @@
grass.mapcalc("MASK1 = 1 * MASK", overwrite=True)
grass.run_command("r.mask", quiet=True, flags="r")
grass.run_command("g.remove", quiet=True, flags="fb", type="raster", pattern=rname)
+ grass.run_command("g.rename", raster=("MASK1","MASK"))
grass.run_command("g.remove", quiet=True, flags="f", type="raster", pattern=tmpf0)
#----------------------------------------------------------------------------
More information about the grass-commit
mailing list