[GRASS-SVN] r61788 - grass/trunk/scripts/i.pansharpen
svn_grass at osgeo.org
svn_grass at osgeo.org
Wed Sep 3 05:17:48 PDT 2014
Author: martinl
Date: 2014-09-03 05:17:48 -0700 (Wed, 03 Sep 2014)
New Revision: 61788
Modified:
grass/trunk/scripts/i.pansharpen/i.pansharpen.py
Log:
i.pansharpen: check for numpy
Modified: grass/trunk/scripts/i.pansharpen/i.pansharpen.py
===================================================================
--- grass/trunk/scripts/i.pansharpen/i.pansharpen.py 2014-09-03 09:54:03 UTC (rev 61787)
+++ grass/trunk/scripts/i.pansharpen/i.pansharpen.py 2014-09-03 12:17:48 UTC (rev 61788)
@@ -86,10 +86,19 @@
import sys
import os
-import numpy as np
+
+try:
+ import numpy as np
+ hasNumPy = True
+except ImportError:
+ hasNumPy = False
+
import grass.script as grass
def main():
+ if not hasNumPy:
+ grass.fatal(_("Required dependency NumPy not found. Exiting."))
+
sharpen = options['sharpen'] # sharpening algorithm
ms1 = options['ms1'] # blue channel
ms2 = options['ms2'] # green channel
More information about the grass-commit
mailing list