[GRASS-SVN] r72662 - grass-addons/grass7/raster/r.valley.bottom
svn_grass at osgeo.org
svn_grass at osgeo.org
Tue May 1 22:24:22 PDT 2018
Author: spawley
Date: 2018-05-01 22:24:21 -0700 (Tue, 01 May 2018)
New Revision: 72662
Modified:
grass-addons/grass7/raster/r.valley.bottom/r.valley.bottom.py
Log:
r.valley.bottom simplify r.mapcalc expression for elevation percentile calculation
Modified: grass-addons/grass7/raster/r.valley.bottom/r.valley.bottom.py
===================================================================
--- grass-addons/grass7/raster/r.valley.bottom/r.valley.bottom.py 2018-05-02 05:19:17 UTC (rev 72661)
+++ grass-addons/grass7/raster/r.valley.bottom/r.valley.bottom.py 2018-05-02 05:24:21 UTC (rev 72662)
@@ -247,7 +247,7 @@
for d in offsets:
valid = ','.join(map(str, d))
invalid = ','.join([str(-d[0]), str(-d[1])])
- terms.append("if(isnull({input}[{d}]), if(isnull({input}[{e}] <= {input}), {input}, {input}[{e}] <= {input}), {input}[{d}] <= {input})".format(
+ terms.append("if(isnull({input}[{d}]), if(isnull({input}[{e}]), 1, {input}[{e}]<={input}), {input}[{d}]<={input})".format(
input=input_grown, d=valid, e=invalid))
expr = "{x} = ({s}) / {n}".format(x=PCTL, s=" + ".join(terms), n=n_pixels)
More information about the grass-commit
mailing list