[GRASS-SVN] r67420 - grass-addons/grass7/raster/r.meb

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Dec 29 05:31:55 PST 2015


Author: pvanbosgeo
Date: 2015-12-29 05:31:55 -0800 (Tue, 29 Dec 2015)
New Revision: 67420

Modified:
   grass-addons/grass7/raster/r.meb/r.meb.py
Log:
bugfix,add progress info

Modified: grass-addons/grass7/raster/r.meb/r.meb.py
===================================================================
--- grass-addons/grass7/raster/r.meb/r.meb.py	2015-12-29 13:14:49 UTC (rev 67419)
+++ grass-addons/grass7/raster/r.meb/r.meb.py	2015-12-29 13:31:55 UTC (rev 67420)
@@ -83,19 +83,19 @@
 
 #%flag
 #% key: m
-#% description: Use minimum values of IES layers to compute MES (MES_min)
+#% description: Use mean values of IES layers to compute MES
 #% guisection: Output
 #%end
 
 #%flag
 #% key: n
-#% description: Use mean values of IES layers to compute MES (MES_av)
+#% description: Use median values of IES layers to compute MES
 #% guisection: Output
 #%end
 
 #%flag
 #% key: o
-#% description: Use median values of IES layers to compute MES (MES_med)
+#% description: Use minimum values of IES layers to compute MES
 #% guisection: Output
 #%end
 
@@ -194,9 +194,6 @@
 # Compute EB for input file (simlay = similarity, reflay = reference layer)
 def EB(simlay, reflay):
 
-    # layer name
-    vn = simlay.split("@")[0]
-
     # Median and mad for whole region (within current mask)
     tmpf4 = tmpname('reb4')
     clean_rast.add(tmpf4)
@@ -227,9 +224,9 @@
     EBstat = abs(d - e) / mad
 
     # Print results to screen and return results
-    grass.info("Median " + vn + " (all region) = " + str('%.3f') %d)
-    grass.info("Median " + vn + " (ref. area) = " + str('%.3f') %e)
-    grass.info("MAD " + vn + " (all region) = " + str('%.3f') %mad)
+    grass.info("Median (all region) = " + str('%.3f') %d)
+    grass.info("Median (ref. area) = " + str('%.3f') %e)
+    grass.info("MAD = " + str('%.3f') %mad)
     grass.info("EB = " + str('%.3f') %EBstat)
 
     # Clean up and return data
@@ -284,6 +281,7 @@
 
     ipi = []
     for j in xrange(len(ipl)):
+        grass.info("Computing ES for layer " + ipl[j])
 
         # Calculate the frequency distribution
         tmpf1 = tmpname('reb1')
@@ -345,25 +343,32 @@
 
     # EB MES
     if flag_m:
+        grass.info("Computing the MES")
         nmn = tmpf0 + "_MES_mean"
         grass.run_command("r.series", quiet=True, output=nmn, input=tuple(ipi), method="average")
         defcol(nmn)
+        grass.info("Computing the EB")
         ebm = EB(simlay=nmn, reflay=tmpref0)
 
     if flag_n:
+        grass.info("Computing the MES")
         nmn = tmpf0 + "_MES_median"
         grass.run_command("r.series", quiet=True, output=nmn, input=tuple(ipi), method="median")
         defcol(nmn)
+        grass.info("Computing the EB")
         ebn = EB(simlay=nmn, reflay=tmpref0)
 
     if flag_o:
+        grass.info("Computing the MES")
         nmn = tmpf0 + "_MES_minimum"
         grass.run_command("r.series", quiet=True, output=nmn, input=tuple(ipi), method="minimum")
         defcol(nmn)
+        grass.info("Computing the EB")
         ebo = EB(simlay=nmn, reflay=tmpref0)
 
     # EB individual layers
     if flag_i:
+        grass.info("Computing the EB for the individual layers")
         ebi = {}
         for mm in xrange(len(ipi)):
             nmn = tmpf0 + "_" + ipn[mm]



More information about the grass-commit mailing list