[GRASS-SVN] r67163 - grass-addons/grass7/raster/r.bioclim

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Dec 16 01:23:13 PST 2015


Author: mmetz
Date: 2015-12-16 01:23:13 -0800 (Wed, 16 Dec 2015)
New Revision: 67163

Modified:
   grass-addons/grass7/raster/r.bioclim/r.bioclim.py
Log:
r.bioclim: fix BIO15 for precipitation = 0

Modified: grass-addons/grass7/raster/r.bioclim/r.bioclim.py
===================================================================
--- grass-addons/grass7/raster/r.bioclim/r.bioclim.py	2015-12-16 08:34:45 UTC (rev 67162)
+++ grass-addons/grass7/raster/r.bioclim/r.bioclim.py	2015-12-16 09:23:13 UTC (rev 67163)
@@ -502,7 +502,7 @@
     grass.run_command('r.series', input = prec,
                       output = "%s,%s" % (precavg, precstddev),
                       method = 'average,stddev')
-    grass.mapcalc("$bio = round(100.0 * $precstddev / $precavg)",
+    grass.mapcalc("$bio = if($precavg == 0, 0, round(100.0 * $precstddev / $precavg))",
                   bio = outpre + '.bio15',
                   precstddev = precstddev,
                   precavg = precavg)



More information about the grass-commit mailing list