[GRASS-SVN] r58621 - grass-addons/grass7/raster/r.diversity
svn_grass at osgeo.org
svn_grass at osgeo.org
Sun Jan 5 15:55:56 PST 2014
Author: neteler
Date: 2014-01-05 15:55:56 -0800 (Sun, 05 Jan 2014)
New Revision: 58621
Modified:
grass-addons/grass7/raster/r.diversity/r.diversity.html
grass-addons/grass7/raster/r.diversity/r.diversity.py
Log:
r.diversity: parameter name updates for G7
Modified: grass-addons/grass7/raster/r.diversity/r.diversity.html
===================================================================
--- grass-addons/grass7/raster/r.diversity/r.diversity.html 2014-01-05 23:44:38 UTC (rev 58620)
+++ grass-addons/grass7/raster/r.diversity/r.diversity.html 2014-01-05 23:55:56 UTC (rev 58621)
@@ -24,29 +24,33 @@
resulting map:<br>
<div class="code"><pre>
-r.null setnull=-1 map=my_map
+r.null map=my_map setnull=-1
</pre></div>
<h2>EXAMPLES</h2>
-To calculate the set of indices from a NDVI map, with a moving window of 3 x 3 pixel, run:
+To calculate the set of indices from a NDVI map, with a moving window
+of 3 x 3 pixel, run:
<div class="code"><pre>
-r.diversity input=ndvi_map out=test alpha=0.5
+r.diversity input=ndvi_map output=diversity alpha=0.5
</pre></div>
-To calculate the set of indices from a NDVI map, with a moving window of 7 x 7 pixel, run:
+To calculate the set of indices from a NDVI map, with a moving window
+of 7 x 7 pixel, run:
<div class="code"><pre>
-r.diversity input=ndvi_map out=test alpha=0.5 size=7
+r.diversity input=ndvi_map output=diversity alpha=0.5 size=7
</pre></div>
-To calculate only Pielou and Simpson indices from a NDVI map, with several moving window (3 x 3, 5 x 5, 7 x 7, 9 x 9), run:
+To calculate only Pielou and Simpson indices from a NDVI map, with
+several moving window (3 x 3, 5 x 5, 7 x 7, 9 x 9), run:
<div class="code"><pre>
-r.diversity input=ndvi_map out=test size=3-9 method=pielou,simpson
+r.diversity input=ndvi_map output=diversity size=3-9 method=pielou,simpson
</pre></div>
-To calculate all methods excluding Pielou from a NDVI map, with two moving window (3 x 3, 9 x 9), run:
+To calculate all methods excluding Pielou from a NDVI map, with two moving
+window (3 x 3, 9 x 9), run:
<div class="code"><pre>
-r.diversity input=ndvi_map out=test size=3,9 exclude=pielou alpha=2
+r.diversity input=ndvi_map output=diversity size=3,9 exclude=pielou alpha=3
</pre></div>
<h2>SEE ALSO</h2>
Modified: grass-addons/grass7/raster/r.diversity/r.diversity.py
===================================================================
--- grass-addons/grass7/raster/r.diversity/r.diversity.py 2014-01-05 23:44:38 UTC (rev 58620)
+++ grass-addons/grass7/raster/r.diversity/r.diversity.py 2014-01-05 23:55:56 UTC (rev 58621)
@@ -154,14 +154,14 @@
for r in res:
createConfFile(r,map_in,home)
r = str(r)
- grass.run_command('r.li.simpson', map = map_in, out = map_out +
+ grass.run_command('r.li.simpson', input = map_in, output = map_out +
'_simpson_size_' + r, conf = 'conf_diversity_' + r)
- grass.run_command('r.li.shannon', map = map_in, out = map_out +
+ grass.run_command('r.li.shannon', input = map_in, output = map_out +
'_shannon_size_' + r, conf = 'conf_diversity_' + r)
- grass.run_command('r.li.pielou', map = map_in, out = map_out +
+ grass.run_command('r.li.pielou', input = map_in, output = map_out +
'_pielou_size_' + r, conf = 'conf_diversity_' + r)
for alp in alpha:
- grass.run_command('r.li.renyi', map = map_in, out = map_out+
+ grass.run_command('r.li.renyi', input = map_in, output = map_out+
'_renyi_size_' + r + '_alpha_'+ str(alp), conf =
'conf_diversity_' + r, alpha = alp)
@@ -175,11 +175,11 @@
for i in method:
if i == 'renyi':
for alp in alpha:
- grass.run_command('r.li.renyi', map = map_in, out =
+ grass.run_command('r.li.renyi', input = map_in, output =
map_out + '_renyi_size_' + r + '_alpha_' + str(alp),
conf = 'conf_diversity_' + r, alpha = alp)
else:
- grass.run_command('r.li.' + i, map = map_in, out = map_out +
+ grass.run_command('r.li.' + i, input = map_in, output = map_out +
'_' + i + '_size_' + r, conf = 'conf_diversity_' + r)
# calculate only method excluded with exclude option
@@ -196,11 +196,11 @@
if method.count(i) == 0:
if i == 'renyi':
for alp in alpha:
- grass.run_command('r.li.renyi', map = map_in, out =
+ grass.run_command('r.li.renyi', input = map_in, output =
map_out + '_renyi_size_' + r + '_alpha_' + str(alp),
conf = 'conf_diversity_' + r, alpha = alp)
else:
- grass.run_command('r.li.' + i, map = map_in, out = map_out +
+ grass.run_command('r.li.' + i, input = map_in, output = map_out +
'_' + i+ '_size_' + r, conf = 'conf_diversity_' + r)
# check if alpha value it's set when renyi entropy must be calculate
@@ -257,13 +257,13 @@
else:
typ = 'value'
reso = [res]
- # trasforn string to int and check if is a odd number
+ # 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])
if reso[i] % 2 == 0:
# return the error advice
- print "Your size option could not contain odd number"
+ print "The size/alpha setting must be an integer number (found %d)" % reso[i]
sys.exit(1)
# create a range
if typ == 'range':
More information about the grass-commit
mailing list