[GRASS-SVN] r71364 - in grass-addons/grass7/raster: r.hypso r.width.funct
svn_grass at osgeo.org
svn_grass at osgeo.org
Thu Aug 10 01:49:22 PDT 2017
Author: madi
Date: 2017-08-10 01:49:22 -0700 (Thu, 10 Aug 2017)
New Revision: 71364
Modified:
grass-addons/grass7/raster/r.hypso/r.hypso.py
grass-addons/grass7/raster/r.width.funct/r.width.funct.py
Log:
used a more robust way to parse cell size
Modified: grass-addons/grass7/raster/r.hypso/r.hypso.py
===================================================================
--- grass-addons/grass7/raster/r.hypso/r.hypso.py 2017-08-10 08:18:48 UTC (rev 71363)
+++ grass-addons/grass7/raster/r.hypso/r.hypso.py 2017-08-10 08:49:22 UTC (rev 71364)
@@ -57,9 +57,7 @@
def main():
stats = grass.read_command('r.stats', input = options['map'], sep = 'space', nv = '*', nsteps = '255', flags = 'inc').split('\n')[:-1]
-
- # res = cellsize
- res = float(grass.read_command('g.region', raster = options['map'], flags = 'm').strip().split('\n')[6].split('=')[1])
+ res = grass.region()['nsres']
zn = np.zeros((len(stats),6),float)
kl = np.zeros((len(stats),2),float)
prc = np.zeros((9,2),float)
Modified: grass-addons/grass7/raster/r.width.funct/r.width.funct.py
===================================================================
--- grass-addons/grass7/raster/r.width.funct/r.width.funct.py 2017-08-10 08:18:48 UTC (rev 71363)
+++ grass-addons/grass7/raster/r.width.funct/r.width.funct.py 2017-08-10 08:49:22 UTC (rev 71364)
@@ -52,8 +52,7 @@
stats = grass.read_command('r.stats', input = options['map'], sep = 'space', nv = '*', nsteps = '255', flags = 'Anc').split('\n')[:-1]
# res = cellsize
- res1 = grass.read_command('g.region', raster = options['map'], flags = 'm')
- res = int(res1.strip().split('\n')[6].split('=')[1])
+ res = grass.region()['nsres']
zn = np.zeros((len(stats),4),float)
kl = np.zeros((len(stats),2),float)
More information about the grass-commit
mailing list