[GRASS-SVN] r66156 - grass-addons/grass7/raster/r.biodiversity

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Sep 10 01:35:30 PDT 2015


Author: pvanbosgeo
Date: 2015-09-10 01:35:30 -0700 (Thu, 10 Sep 2015)
New Revision: 66156

Modified:
   grass-addons/grass7/raster/r.biodiversity/r.biodiversity.py
Log:
Bug fix

Modified: grass-addons/grass7/raster/r.biodiversity/r.biodiversity.py
===================================================================
--- grass-addons/grass7/raster/r.biodiversity/r.biodiversity.py	2015-09-09 18:21:10 UTC (rev 66155)
+++ grass-addons/grass7/raster/r.biodiversity/r.biodiversity.py	2015-09-10 08:35:30 UTC (rev 66156)
@@ -277,28 +277,28 @@
                       out_div=out_div,
                       in_div=in_div,
                       quiet=True)
-        if 2.0 not in Qoriginal:
+        if 2.0 not in Qoriginal and not flag_p and not flag_g:
             grass.run_command("g.remove", flags="f", type="raster", 
                               name=in_div, quiet=True)
        
     #--------------------------------------------------------------------------
     # Inversed Simpson index
     #--------------------------------------------------------------------------
-    if flag_d:
+    if flag_p:
         out_div = OUT + "_invsimpson"      
         in_div = OUT + "_Renyi_2_0"
         grass.mapcalc("$out_div = exp($in_div)",
                       out_div=out_div,
                       in_div=in_div,
                       quiet=True)
-        if 2.0 not in Qoriginal:
+        if 2.0 not in Qoriginal and not flag_g:
             grass.run_command("g.remove", flags="f", type="raster", 
                               name=in_div, quiet=True)
         
     #--------------------------------------------------------------------------
     # Gini Simpson index
     #--------------------------------------------------------------------------
-    if flag_d:
+    if flag_g:
         out_div = OUT + "_ginisimpson"      
         in_div = OUT + "_Renyi_2_0"
         grass.mapcalc("$out_div = 1.0 - (1.0 / exp($in_div))",



More information about the grass-commit mailing list