Updating MT classes,

Working on a example script to forward model impedance data
This commit is contained in:
Gudni Karl Rosenkjaer
2015-02-16 15:35:40 -08:00
parent 9aa94c95b1
commit fb717b5f31
4 changed files with 44 additions and 19 deletions
@@ -0,0 +1,9 @@
# Test script to use simpegMT platform to forward model synthetic data.
# Import
import simpegMT as simpegMT, SimPEG as simpeg
# Make a receiver list
for
+2 -1
View File
@@ -145,6 +145,7 @@ class MTProblem(Problem.BaseProblem):
def getRHS(self, freq, backSigma):
"""
Function to return the right hand side for the system.
:param float freq: Frequency
:param numpy.ndarray (nC,) backSigma: Background conductivity model
:rtype: numpy.ndarray (nE, 2)
@@ -153,7 +154,7 @@ class MTProblem(Problem.BaseProblem):
# Get sources for the frequency
src = self.survey.getSources(freq)
# Make sure that there is 2 polarizations.
assert
# assert len()
# Get the background electric fields
from simpegMT.Sources import homo1DModelSource
eBG_bp = home1DModelSource(self.mesh,freq,backSigma)
+9 -2
View File
@@ -1,6 +1,12 @@
def homo1DModelSource(mesh,freq,bgMod):
'''
Function that calculates and return backround fields
Function that calculates and return background fields
:param Simpeg mesh object mesh: Holds information on the discretization
:param float freq: The frequency to solve at
:param np.array bgMod: Background model to base the calculations on.
:rtype: numpy.ndarray (mesh.nE,2)
:return: eBG_bp, E fields for the background model at both polarizations.
'''
@@ -29,4 +35,5 @@ def homo1DModelSource(mesh,freq,bgMod):
eBG_py = np.vstack((ex_py,simpeg.Utils.mkvc(ey_py,2),ez_py))
# Return the electric fields
return np.hstack((eBG_px,eBG_py))
eBG_bp = np.hstack((eBG_px,eBG_py))
return eBG_bp
+24 -16
View File
@@ -1,4 +1,4 @@
from SimPEG import Survey, Utils, np, sp
from SimPEG import Survey, Utils, Problem, np, sp
class RxMT(Survey.BaseRx):
@@ -12,18 +12,19 @@ class RxMT(Survey.BaseRx):
'zyxi':[['e', 'Ey'],['b','Fx'], 'imag'],
'zyyi':[['e', 'Ey'],['b','Fy'], 'imag'],
'exi':['e', 'Ex', 'imag'],
'eyi':['e', 'Ey', 'imag'],
'ezi':['e', 'Ez', 'imag'],
#TODO: Add tipper fractions as well. Bz/B(x|y)
# 'exi':['e', 'Ex', 'imag'],
# 'eyi':['e', 'Ey', 'imag'],
# 'ezi':['e', 'Ez', 'imag'],
'bxr':['b', 'Fx', 'real'],
'byr':['b', 'Fy', 'real'],
'bzr':['b', 'Fz', 'real'],
'bxi':['b', 'Fx', 'imag'],
'byi':['b', 'Fy', 'imag'],
'bzi':['b', 'Fz', 'imag'],
# 'bxr':['b', 'Fx', 'real'],
# 'byr':['b', 'Fy', 'real'],
# 'bzr':['b', 'Fz', 'real'],
# 'bxi':['b', 'Fx', 'imag'],
# 'byi':['b', 'Fy', 'imag'],
# 'bzi':['b', 'Fz', 'imag'],
}
# TODO: Have locs as single or double coordinates for both or numerator and denominator separately, respectively.
def __init__(self, locs, rxType):
Survey.BaseRx.__init__(self, locs, rxType)
@@ -102,22 +103,26 @@ class RxMT(Survey.BaseRx):
class srcMT(Survey.BaseTx):
'''
Sources for the MT problem.
Use the SimPEG BaseTx, since the source fields share properties with the transmitters.
:param float freq: The frequency of the source
:param list rxList: A list of receivers associated with the source
'''
freq = None #: Frequency (float)
rxPair = RxMT
knownSrcTypes = ['ORTPOL'] # ORThogonal POLarization
knownTxTypes = ['ORTPOL'] # ORThogonal POLarization
def __init__(self, loc, txType, freq, rxList): # remove txType? hardcode to one thing. always polarizations
def __init__(self, freq, rxList): # remove txType? hardcode to one thing. always polarizations
self.freq = float(freq)
Survey.BaseTx.__init__(self, loc, txType, rxList)
Survey.BaseTx.__init__(self, None, 'ORTPOL', rxList)
# Survey.BaseTx.__init__(self, loc, 'polarization', rxList)
class FieldsMT(Survey.Fields):
class FieldsMT(Problem.Fields):
"""Fancy Field Storage for a MT survey."""
knownFields = {'b': 'F', 'e': 'E'}
dtype = complex
@@ -125,7 +130,10 @@ class FieldsMT(Survey.Fields):
class SurveyMT(Survey.BaseSurvey):
"""
docstring for SurveyMT
Survey class for MT. Contains all the sources associated with the survey.
:param list srcList: List of sources associated with the survey
"""
srcPair = srcMT