In [30]:
from SimPEG import *
import simpegEM as EM
from simpegem1d import *
from scipy.constants import mu_0
%pylab inline
In [239]:
meshType = 'CYL'
cs, ncx, ncz, npad = 10., 10, 5, 15
hx = [(cs,ncx), (cs,npad,1.3)]
hz = [(cs,npad,-1.3), (cs,ncz), (cs,npad,1.3)]
mesh = Mesh.CylMesh([hx,1,hz], '00C')
In [240]:
active = mesh.vectorCCz<0.
layer1 = (mesh.vectorCCz<0.) & (mesh.vectorCCz>=-60.)
layer2 = (mesh.vectorCCz<-60) & (mesh.vectorCCz>=-100.)
layer3 = (mesh.vectorCCz<-100) & (mesh.vectorCCz>=-200.)
actMap = Maps.ActiveCells(mesh, active, np.log(1e-8), nC=mesh.nCz)
mapping = Maps.ExpMap(mesh) * Maps.Vertical1DMap(mesh) * actMap
In [241]:
sig_half = 1e-3
sigma = np.ones(mesh.nCz)*sig_air
sigma[active] = sig_half
mtrue = np.log(sigma[active])
In [242]:
frequency = np.logspace(2, 5, 31)
xyz_rx = np.r_[8., 0., 30.]
rx1 = EM.FDEM.RxFDEM(xyz_rx.reshape([1,-1]), 'bzr')
rx2 = EM.FDEM.RxFDEM(xyz_rx.reshape([1,-1]), 'bzi')
txList = []
for freq in frequency:
tx = EM.FDEM.TxFDEM(np.array([0., 0., 30.]), 'VMD', freq, [rx1, rx2])
tx.radius = 100.
txList.append(tx)
survey = EM.FDEM.SurveyFDEM(txList)
prb = EM.FDEM.ProblemFDEM_b(mesh, mapping=mapping, verbose=False)
survey.pair(prb)
In [243]:
Bz_simpeg = survey.dpred(mtrue)
In [244]:
FDsurvey = BaseEM1D.EM1DSurveyFD()
FDsurvey.rxLoc = np.array([0., 0., 30.])
FDsurvey.txLoc = np.array([0., 0., 30.])
FDsurvey.fieldtype = 'secondary'
nearthick = np.logspace(-1, 1, 5)
deepthick = np.logspace(1, 2, 10)
hx = np.r_[nearthick, deepthick]
mesh1D = Mesh.TensorMesh([hx], [0.])
depth = -mesh1D.gridN[:-1]
LocSigZ = -mesh1D.gridCC
nlay = depth.size
topo = np.r_[0., 0., 0.]
FDsurvey.depth = depth
FDsurvey.topo = topo
FDsurvey.LocSigZ = LocSigZ
FDsurvey.frequency = frequency
FDsurvey.Nfreq = FDsurvey.frequency.size
FDsurvey.Setup1Dsystem()
expmap = BaseEM1D.BaseEM1DMap(mesh1D)
modelReal = expmap
m_1D = np.log(np.ones(nlay)*sig_half)
FDsurvey.rxType = 'Hz'
FDsurvey.switchRI = 'all'
WT0, WT1, YBASE = DigFilter.LoadWeights()
options = {'WT0': WT0, 'WT1': WT1, 'YBASE': YBASE}
prob = EM1D.EM1D(mesh1D, modelReal, **options)
prob.pair(FDsurvey)
prob.chi = np.zeros(FDsurvey.nlay)
In [245]:
prob.CondType = 'Real'
# prob.survey.txType = 'CircularLoop'
# I = 1e0
# a = 1e2
# prob.survey.I = I
# prob.survey.a = a
prob.survey.txType = 'VMD'
prob.survey.offset = 8
Bz_anal = FDsurvey.dpred(m_1D)
In [246]:
print Hz_anal
In [247]:
Bz_Simpeg = Bz_simpeg.reshape((2,FDsurvey.Nfreq), order='F')
plt.loglog(frequency, -Bz_anal[:FDsurvey.Nfreq], 'k-')
plt.loglog(frequency, -Bz_anal[FDsurvey.Nfreq:], 'b-')
plt.loglog(FDsurvey.frequency, -Bz_Simpeg[0,:], 'ko')
plt.loglog(FDsurvey.frequency, -Bz_Simpeg[1,:], 'bo')
Out[247]:
Discussion: