In [ ]:
"""
GravMag: 3D forward modeling of total-field magnetic anomaly using triaxial
ellipsoids (model with induced and remanent magnetization)
"""
# Import the required modules
from fatiando import mesher_v, gridder, utils
from fatiando.gravmag import triaxial_ellipsoid
from fatiando.vis import mpl
# The local-geomagnetic field
inten,inc, dec = 60000., 30, -15
model = [mesher_v.TriaxialEllipsoid(-2500.,-2500.,500.,2000.,100.,50.,0.,0.,0.,
{'remanence': [100, 90., 0.],
'k': [0.2, 0.1, 0.05, 0., 90., 90.]}),
mesher_v.TriaxialEllipsoid(2500.,2500.,500.,2000.,100.,50.,0.,0.,0.,
{'remanence': [100, 90., 0.],
'k': [0.2, 0.1, 0.05, 0., 90., 90.]})]
# Create a regular grid at 0m height
shape = (200, 200)
area = [-5000, 5000, -5000, 5000]
xp, yp, zp = gridder.regular(area, shape, z=0)
# Calculate the anomaly for a given regional field
tf = triaxial_ellipsoid.tf(xp,yp,zp,model,inten,inc,dec)
# Plot
mpl.figure()
mpl.title("Total-field anomaly (nT)")
mpl.axis('scaled')
mpl.contourf(yp, xp, tf, shape, 15)
mpl.colorbar()
mpl.xlabel('East y (km)')
mpl.ylabel('North x (km)')
mpl.m2km()
mpl.show()
In [ ]: