Browse Source

i.oif: check the number of input maps (minimum should be 4), update messages

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@59353 15284696-431f-4ddb-bdfa-cd5b030d7da7
Luca Delucchi 11 years ago
parent
commit
9bc75461b9
1 changed files with 8 additions and 4 deletions
  1. 8 4
      scripts/i.oif/i.oif.py

+ 8 - 4
scripts/i.oif/i.oif.py

@@ -73,9 +73,13 @@ def main():
     shell = flags['g']
     serial = flags['s']
     bands = options['input'].split(',')
+
+    if len(bands) < 4:
+        grass.fatal(_("At least four input maps required"))
+
     output = options['output']
     # calculate the Stddev for TM bands
-    grass.message(_("Calculating Standard deviations for all bands..."))
+    grass.message(_("Calculating standard deviations for all bands..."))
     stddev = {}
 
     if serial:
@@ -134,12 +138,12 @@ def main():
     oif.sort(reverse=True)
 
     grass.verbose(_("The Optimum Index Factor analysis result " \
-                    "(Best combination comes first):"))
+                    "(best combination shown first):"))
 
     if shell:
-        fmt = "%s%s%s:%.4f\n"
+        fmt = "%s,%s,%s:%.4f\n"
     else:
-        fmt = "%s%s%s:  %.4f\n"
+        fmt = "%s, %s, %s:  %.4f\n"
 
     if not output or output == '-':
         for v, p in oif: