diff --git a/simpegMT/Examples/simple3DfowardProblem.py b/simpegMT/Examples/simple3DfowardProblem.py new file mode 100644 index 00000000..ee0f0bad --- /dev/null +++ b/simpegMT/Examples/simple3DfowardProblem.py @@ -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 \ No newline at end of file diff --git a/simpegMT/ProblemMT.py b/simpegMT/ProblemMT.py index 159c26eb..04fabe30 100644 --- a/simpegMT/ProblemMT.py +++ b/simpegMT/ProblemMT.py @@ -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) diff --git a/simpegMT/Sources/backgroundModelSources.py b/simpegMT/Sources/backgroundModelSources.py index d5e97750..f74b4ad1 100644 --- a/simpegMT/Sources/backgroundModelSources.py +++ b/simpegMT/Sources/backgroundModelSources.py @@ -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)) \ No newline at end of file + eBG_bp = np.hstack((eBG_px,eBG_py)) + return eBG_bp \ No newline at end of file diff --git a/simpegMT/SurveyMT.py b/simpegMT/SurveyMT.py index 80a77d53..829d99b7 100644 --- a/simpegMT/SurveyMT.py +++ b/simpegMT/SurveyMT.py @@ -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