[GRASS-SVN] r47184 - grass-addons/grass7/raster/r.threshold
svn_grass at osgeo.org
svn_grass at osgeo.org
Wed Jul 20 07:05:25 EDT 2011
Author: madi
Date: 2011-07-20 04:05:25 -0700 (Wed, 20 Jul 2011)
New Revision: 47184
Modified:
grass-addons/grass7/raster/r.threshold/r.threshold.py
Log:
managing negative values in flow accum map added
Modified: grass-addons/grass7/raster/r.threshold/r.threshold.py
===================================================================
--- grass-addons/grass7/raster/r.threshold/r.threshold.py 2011-07-20 07:37:49 UTC (rev 47183)
+++ grass-addons/grass7/raster/r.threshold/r.threshold.py 2011-07-20 11:05:25 UTC (rev 47184)
@@ -31,7 +31,6 @@
import grass.script as grass
-import grass.script.array as garray
import os, sys
import math
import numpy as np
@@ -62,7 +61,10 @@
index = np.where(distance==min(distance))
th = area[index]
- grass.message("Suggested threshold is %d" % th )
+ if th < 0:
+ grass.message("Warning: Flow accumulation contains negative values")
+ else:
+ grass.message("Suggested threshold is %d" % th )
grass.message( 'Done!' )
More information about the grass-commit
mailing list