[GRASS-SVN] r52442 - grass-addons/grass7/imagery/i.histo.match

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Jul 24 05:48:03 PDT 2012


Author: lucadelu
Date: 2012-07-24 05:48:02 -0700 (Tue, 24 Jul 2012)
New Revision: 52442

Modified:
   grass-addons/grass7/imagery/i.histo.match/i.histo.match.py
Log:
improvements on hamish and micheal suggestions

Modified: grass-addons/grass7/imagery/i.histo.match/i.histo.match.py
===================================================================
--- grass-addons/grass7/imagery/i.histo.match/i.histo.match.py	2012-07-24 11:50:32 UTC (rev 52441)
+++ grass-addons/grass7/imagery/i.histo.match/i.histo.match.py	2012-07-24 12:48:02 UTC (rev 52442)
@@ -122,8 +122,8 @@
             # update cdf with new value
             if val != 0 and numPixel != 0:
                 update_cdf = round(float(val) / float(numPixel), 6)
-                update_cdf = "UPDATE t%s SET cdf=%s WHERE (grey_value=%i)" % (n,
-                                                            iname, update_cdf,) 
+                update_cdf = "UPDATE t%s SET cdf=%s WHERE (grey_value=%i)" % (
+                                                            iname, update_cdf,n)
                 curs.execute(update_cdf)
                 db.commit()
     db.commit()
@@ -167,7 +167,7 @@
         cHist = cHist + int(average)
         # insert new values into average table
         if cHist != 0 and pixelTot != 0:
-            cdf = round(float(cHist) / float(pixelTot), 6)
+            cdf = float(cHist) / float(pixelTot)
             insert = "INSERT INTO %s VALUES (%i, %i, %i, %s)" % (table_ave, n, 
                                                     int(average), cHist, cdf)
             curs.execute(insert)



More information about the grass-commit mailing list