Moved the osr import into the projection function.

This commit is contained in:
GudniRos
2016-04-07 09:01:30 -07:00
parent fb60f45a3c
commit f15a628136
+7 -6
View File
@@ -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()