In [2]:
%pylab inline
import sys
sys.path.append('../')

import numpy as np
from scipy import sparse as sp
import matplotlib.pyplot as plt
from SimPEG import TensorMesh


Welcome to pylab, a matplotlib-based Python environment [backend: module://IPython.kernel.zmq.pylab.backend_inline].
For more information, type 'help(pylab)'.

Set up mesh


In [3]:
x0 = np.zeros(3)
h1 = np.ones(100)
h2 = np.ones(100)*0.5
h3 = np.ones(100)*0.5
mesh = TensorMesh([h1,h2,h3],x0)

Location and of sources


In [4]:
# make loop centre dipole locations
loc = array(([32.3,19.8,48.3],[15,35.2,25.9]))
Lx = array((3))
Ly = array((8))
dipoleDirection = array(([3,1]))

Get simple loop and dipole source


In [6]:
e = mesh.simpleLoopSource(loc,Lx,Ly)
b = mesh.magneticDipoleSource(loc,dipoleDirection)

Plot results


In [26]:
plt.colorbar(mesh.plotImage(log(mesh.r(b[:,0],'F','Fx','V')),'Fx'))
plt.colorbar(mesh.plotImage(log(mesh.r(b[:,0],'F','Fy','V')),'Fy'))
plt.colorbar(mesh.plotImage(log(mesh.r(b[:,0],'F','Fz','V')),'Fz'))


-c:3: RuntimeWarning: invalid value encountered in log
Out[26]:
<matplotlib.colorbar.Colorbar instance at 0x0000000059840608>

In [14]:
plt.colorbar(mesh.plotImage(log(mesh.r(b[:,1],'F','Fx','V')),'Fx'))


Out[14]:
<matplotlib.colorbar.Colorbar instance at 0x0000000036273CC8>

In [27]:
plt.colorbar(mesh.plotImage(log(mesh.r(b[:,1],'F','Fx','V')),'Fx'))
plt.colorbar(mesh.plotImage(log(mesh.r(b[:,1],'F','Fy','V')),'Fy'))
plt.colorbar(mesh.plotImage(log(mesh.r(b[:,1],'F','Fz','V')),'Fz'))


Out[27]:
<matplotlib.colorbar.Colorbar instance at 0x00000000676AFC48>

In [22]:
plt.colorbar(mesh.plotImage(log(mesh.r(e[:,0],'E','Ex','V')),'Ex',1))
plt.colorbar(mesh.plotImage(log(mesh.r(e[:,0],'E','Ey','V')),'Ey',2))


Out[22]:
<matplotlib.colorbar.Colorbar instance at 0x000000004999C648>

In [25]:
plt.colorbar(mesh.plotImage(mesh.r(e[:,1],'E','Ex','V'),'Ex',1))
plt.colorbar(mesh.plotImage(mesh.r(e[:,1],'E','Ey','V'),'Ey',2))


Out[25]:
<matplotlib.colorbar.Colorbar instance at 0x0000000059776748>