cleanup of TDEM example

This commit is contained in:
Lindsey Heagy
2016-03-14 13:25:09 -07:00
parent a9efb2fc8a
commit 74f4705048
2 changed files with 25 additions and 19 deletions
+19 -13
View File
@@ -131,14 +131,18 @@ class BaseSrc(SimPEG.Survey.BaseSrc):
return getattr(self, '_waveform', None)
@waveform.setter
def waveform(self, val):
# if self.waveform is None:
val._assertMatchesPair(self.waveformPair)
self._waveform = val
if self.waveform is None:
print val
val._assertMatchesPair(self.waveformPair)
self._mapping = val
else:
self._mapping = self.PropMap(val)
def __init__(self, rxList, waveform = None ):
self.waveform = waveform or StepOffWaveform()
SimPEG.Survey.BaseSrc.__init__(self, rxList)
def __init__(self, rxList, waveform = StepOffWaveform(), **kwargs):
self.waveform = waveform
SimPEG.Survey.BaseSrc.__init__(self, rxList, **kwargs)
def bInitial(self, prob):
@@ -172,15 +176,17 @@ class BaseSrc(SimPEG.Survey.BaseSrc):
class MagDipole(BaseSrc):
def __init__(self, rxList, waveform=None, loc=None, orientation='Z', moment=1., mu=mu_0):
self.loc = loc
self.orientation = orientation
assert orientation in ['X','Y','Z'], "Orientation (right now) doesn't actually do anything! The methods in SrcUtils should take care of this..."
self.moment = moment
self.mu = mu
waveform = None
loc = None
orientation = 'Z'
moment = 1.
mu = mu_0
def __init__(self, rxList, **kwargs):
assert self.orientation in ['X','Y','Z'], "Orientation (right now) doesn't actually do anything! The methods in SrcUtils should take care of this..."
self.integrate = False
BaseSrc.__init__(self, rxList, waveform)
BaseSrc.__init__(self, rxList, **kwargs)
def _bfromVectorPotential(self, prob):
if prob._eqLocs is 'FE':
+6 -6
View File
@@ -42,10 +42,10 @@ def run(plotIt=True):
rxOffset=1e-3
rx = EM.TDEM.RxTDEM(np.array([[rxOffset, 0., 30]]), np.logspace(-5,-3, 31), 'bz')
src = EM.TDEM.SrcTDEM_VMD_MVP([rx], np.array([0., 0., 80]))
survey = EM.TDEM.SurveyTDEM([src])
prb = EM.TDEM.ProblemTDEM_b(mesh, mapping=mapping)
rx = EM.TDEM.Rx(np.array([[rxOffset, 0., 30]]), np.logspace(-5,-3, 31), 'bz')
src = EM.TDEM.SurveyTDEM.MagDipole([rx], loc=np.array([0., 0., 80]))
survey = EM.TDEM.Survey([src])
prb = EM.TDEM.Problem_b(mesh, mapping=mapping)
prb.Solver = SolverLU
prb.timeSteps = [(1e-06, 20),(1e-05, 20), (0.0001, 20)]
@@ -53,9 +53,9 @@ def run(plotIt=True):
# create observed data
std = 0.05
survey.dobs = survey.makeSyntheticData(mtrue,std)
survey.std = std
survey.std = std
survey.eps = 1e-5*np.linalg.norm(survey.dobs)
if plotIt: