From 6eabd68a1d6e3d3cafa4ebf46aeca55fb18d789e Mon Sep 17 00:00:00 2001 From: GudniRos Date: Fri, 1 May 2015 13:01:13 -0700 Subject: [PATCH] Updated to src implementation of SimPEG. --- simpegMT/ProblemMT.py | 4 ++-- simpegMT/SurveyMT.py | 20 +++++--------------- 2 files changed, 7 insertions(+), 17 deletions(-) diff --git a/simpegMT/ProblemMT.py b/simpegMT/ProblemMT.py index e4617158..9967a5d4 100644 --- a/simpegMT/ProblemMT.py +++ b/simpegMT/ProblemMT.py @@ -114,7 +114,7 @@ class MTProblem(Problem.BaseProblem): print 'Starting work for {:.3e}'.format(freq) sys.stdout.flush() A = self.getA(freq) - rhs = self.getRHS(freq,m_back) + rhs, ep = self.getRHS(freq,m_back) Ainv = self.Solver(A, **self.solverOpts) e = Ainv * rhs @@ -198,7 +198,7 @@ class MTProblem(Problem.BaseProblem): eBG_bp = homo1DModelSource(self.mesh,freq,backSigma) Abg = self.getAbg(freq) - return -Abg*eBG_bp + return -Abg*eBG_bp, eBG_bp ################################################################## # Inversion stuff diff --git a/simpegMT/SurveyMT.py b/simpegMT/SurveyMT.py index aa4f269e..7bc7165e 100644 --- a/simpegMT/SurveyMT.py +++ b/simpegMT/SurveyMT.py @@ -131,10 +131,10 @@ class RxMT(Survey.BaseRx): # Call this Source or polarization or something...? # Note: Might need to add tests to make sure that both polarization have the same rxList. -class srcMT(Survey.BaseTx): +class srcMT(Survey.BaseSrc): ''' Sources for the MT problem. - Use the SimPEG BaseTx, since the source fields share properties with the transmitters. + Use the SimPEG BaseSrc, 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 @@ -145,12 +145,11 @@ class srcMT(Survey.BaseTx): rxPair = RxMT - knownTxTypes = ['pol_xy','pol_x','pol_y'] # ORThogonal POLarization + knownSrcTypes = ['pol_xy','pol_x','pol_y'] # ORThogonal POLarization - def __init__(self, freq, rxList, srcPol = 'pol_xy'): # remove txType? hardcode to one thing. always polarizations + def __init__(self, freq, rxList, srcPol = 'pol_xy'): # remove rxType? hardcode to one thing. always polarizations self.freq = float(freq) - Survey.BaseTx.__init__(self, None, srcPol, rxList) - # Survey.BaseTx.__init__(self, loc, 'polarization', rxList) + Survey.BaseSrc.__init__(self, None, srcPol, rxList) @@ -173,7 +172,6 @@ class SurveyMT(Survey.BaseSurvey): def __init__(self, srcList, **kwargs): # Sort these by frequency self.srcList = srcList - self.txList = self.srcList # Hack - make txList index srcList, since it is used in the backend. Survey.BaseSurvey.__init__(self, **kwargs) _freqDict = {} @@ -194,14 +192,6 @@ class SurveyMT(Survey.BaseSurvey): def nFreq(self): """Number of frequencies""" return len(self._freqDict) - # Don't need this - # @property - # def nTxByFreq(self): - # if getattr(self, '_nTxByFreq', None) is None: - # self._nTxByFreq = {} - # for freq in self.freqs: - # self._nTxByFreq[freq] = len(self.getTransmitters(freq)) - # return self._nTxByFreq # TODO: Rename to getSources def getSources(self, freq):