[GRASS-SVN] r56474 - grass/trunk/scripts/i.pansharpen
svn_grass at osgeo.org
svn_grass at osgeo.org
Wed May 29 05:43:15 PDT 2013
Author: neteler
Date: 2013-05-29 05:43:15 -0700 (Wed, 29 May 2013)
New Revision: 56474
Modified:
grass/trunk/scripts/i.pansharpen/i.pansharpen.py
Log:
i.pansharpen: raise fatal error if input data pixels are NULL only
Modified: grass/trunk/scripts/i.pansharpen/i.pansharpen.py
===================================================================
--- grass/trunk/scripts/i.pansharpen/i.pansharpen.py 2013-05-29 12:12:04 UTC (rev 56473)
+++ grass/trunk/scripts/i.pansharpen/i.pansharpen.py 2013-05-29 12:43:15 UTC (rev 56474)
@@ -214,6 +214,9 @@
#initial PCA with RGB channels
pca_out = grass.read_command('i.pca', quiet=True, rescale='0,0', input='%s,%s,%s' % (ms1, ms2, ms3), output_prefix='tmp%s.pca' % pid)
+ if len(pca_out) < 1:
+ grass.fatal(_("Input has no data. Check region settings."))
+
b1evect = []
b2evect = []
b3evect = []
@@ -365,7 +368,10 @@
stats_dict[j] = int(stats_dict[j])
if j != '*':
total_cells += stats_dict[j]
-
+
+ if total_cells < 1:
+ grass.fatal(_("Input has no data. Check region settings."))
+
# Make a 2x256 structured array for each image with a
# cumulative distribution function (CDF) for each grey value.
# Grey value is the integer (i4) and cdf is float (f4).
More information about the grass-commit
mailing list