[GRASS-SVN] r68676 - grass-addons/grass7/raster/r.diversity
svn_grass at osgeo.org
svn_grass at osgeo.org
Mon Jun 13 02:52:42 PDT 2016
Author: lucadelu
Date: 2016-06-13 02:52:42 -0700 (Mon, 13 Jun 2016)
New Revision: 68676
Modified:
grass-addons/grass7/raster/r.diversity/r.diversity.py
Log:
r.diversity: fixed bugs related to #3058
Modified: grass-addons/grass7/raster/r.diversity/r.diversity.py
===================================================================
--- grass-addons/grass7/raster/r.diversity/r.diversity.py 2016-06-13 03:28:34 UTC (rev 68675)
+++ grass-addons/grass7/raster/r.diversity/r.diversity.py 2016-06-13 09:52:42 UTC (rev 68676)
@@ -133,20 +133,20 @@
if grass.verbosity() > 2:
quiet = False
# if method and exclude option are not null return an error
- if methods != '' and excludes != '':
+ if methods != 'simpson,shannon,pielou,renyi' and excludes != '':
grass.fatal(_("You can either use 'method' or 'exclude' option but not both"))
+ # calculate not excluded index
+ elif excludes != '':
+ excludes = excludes.split(',')
+ checkAlpha(excludes, alpha_value, True)
+ calculateE(rlidir, map_in, map_out, resolution, alpha_value, excludes,
+ quiet, overwrite)
# calculate method
elif methods != '':
methods = methods.split(',')
checkAlpha(methods, alpha_value)
calculateM(rlidir, map_in, map_out, resolution, alpha_value, methods,
quiet, overwrite)
- # calculate not excluded index
- elif excludes != '':
- excludes = excludes.split(',')
- checkAlpha(excludes, alpha_value, True)
- calculateE(rlidir, map_in, map_out, resolution, alpha_value, excludes,
- quiet, overwrite)
# remove configuration files
if not flags['t']:
removeConfFile(resolution, rlidir)
@@ -259,7 +259,7 @@
# transform string to int and check if is a odd number
for i in range(len(reso)):
# check if is a odd number
- reso[i] = float(reso[i])
+ reso[i] = int(reso[i])
if reso[i] % 2 == 0:
# return the error advice
grass.fatal(_("The size/alpha setting must be an odd number " \
More information about the grass-commit
mailing list