From f15a628136264bdcf49b86009204be7c81866450 Mon Sep 17 00:00:00 2001 From: GudniRos Date: Thu, 7 Apr 2016 09:01:30 -0700 Subject: [PATCH] Moved the osr import into the projection function. --- SimPEG/MT/Utils/ediFilesUtils.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/SimPEG/MT/Utils/ediFilesUtils.py b/SimPEG/MT/Utils/ediFilesUtils.py index cc8aef8a..d8f5e0ad 100644 --- a/SimPEG/MT/Utils/ediFilesUtils.py +++ b/SimPEG/MT/Utils/ediFilesUtils.py @@ -14,12 +14,7 @@ class EDIimporter: A class to import EDIfiles. """ - # Import the coordinate projections - try: - import osr - except ImportError as e: - print 'Could not import osr, missing the gdal package' - raise e + # Define data converters _impUnitEDI2SI = 4*np.pi*1e-4 # Convert Z[mV/km/nT] (as in EDI)to Z[V/A] SI unit @@ -117,6 +112,12 @@ class EDIimporter: # nOutData=length(obj.data); # obj.data(nOutData+1:nOutData+length(TEMP.data),:) = TEMP.data; def _transfromPoints(self,longD,latD): + # Import the coordinate projections + try: + import osr + except ImportError as e: + print 'Could not import osr, missing the gdal package\nCan not project coordinates' + raise e # Coordinates convertor if self._2out is None: src = osr.SpatialReference()