コード例 #1
0
from geoist.pfm import sphere, giutils
from geoist import gridder
from geoist.inversion import geometry
from geoist.vis import giplt

# Create a model using geometric objects from fatiando.mesher
# Each model element has a dictionary with its physical properties.
# The spheres have different total magnetization vectors (total = induced +
# remanent + any other effects). Notice that the magnetization has to be a
# vector. Function utils.ang2vec converts intensity, inclination, and
# declination into a 3 component vector for easier handling.
model = [
    geometry.Sphere(
        x=10e3,
        y=10e3,
        z=2e3,
        radius=1.5e3,
        props={'magnetization': giutils.ang2vec(1, inc=50, dec=-30)}),
    geometry.Sphere(
        x=20e3,
        y=20e3,
        z=2e3,
        radius=1.5e3,
        props={'magnetization': giutils.ang2vec(1, inc=-70, dec=30)})
]

# Set the inclination and declination of the geomagnetic field.
inc, dec = -10, 13
# Create a regular grid at a constant height
shape = (300, 300)
area = [0, 30e3, 0, 30e3]
コード例 #2
0
"""

from geoist.pfm import sphere, pftrans, euler, giutils
from geoist import gridder
from geoist.inversion import geometry
from geoist.vis import giplt
import matplotlib.pyplot as plt

# Make some synthetic magnetic data to test our Euler deconvolution.
# The regional field
inc, dec = -45, 0
# Make a model of two spheres magnetized by induction only
model = [
    geometry.Sphere(x=-1000,
                    y=-1000,
                    z=1500,
                    radius=1000,
                    props={'magnetization': giutils.ang2vec(2, inc, dec)}),
    geometry.Sphere(x=1000,
                    y=1500,
                    z=1000,
                    radius=1000,
                    props={'magnetization': giutils.ang2vec(1, inc, dec)})
]

print("Centers of the model spheres:")
print(model[0].center)
print(model[1].center)

# Generate some magnetic data from the model
shape = (100, 100)
コード例 #3
0
"""
import matplotlib.pyplot as plt
import numpy as np

from geoist.pfm import sphere, giutils
from geoist import gridder
from geoist.inversion import geometry
from geoist.vis import giplt

# Create a model using geometric objects from fatiando.mesher
# Each model element has a dictionary with its physical properties.
# We'll use two spheres with opposite density contrast values.
model = [
    geometry.Sphere(x=10e3,
                    y=10e3,
                    z=1.5e3,
                    radius=1.5e3,
                    props={'density': 500}),
    geometry.Sphere(x=20e3,
                    y=20e3,
                    z=1.5e3,
                    radius=1.5e3,
                    props={'density': -500})
]

# Create a regular grid at a constant height
shape = (300, 300)
area = [0, 30e3, 0, 30e3]
x, y, z = gridder.regular(area, shape, z=-100)

fields = [
コード例 #4
0
"""
# 3rd imports
import numpy as np
import matplotlib.pyplot as plt
# local imports
from geoist import gridder
from geoist.inversion import geometry
from geoist.pfm.giutils import ang2vec, contaminate
from geoist.pfm import sphere
from geoist.pfm.magdir import DipoleMagDir
from geoist.vis import giplt

# Make noise-corrupted synthetic data
inc, dec = -10.0, -15.0  # inclination and declination of the Geomagnetic Field
model = [
    geometry.Sphere(3000, 3000, 1000, 1000,
                    {'magnetization': ang2vec(6.0, -20.0, -10.0)}),
    geometry.Sphere(7000, 7000, 1000, 1000,
                    {'magnetization': ang2vec(10.0, 3.0, -67.0)})
]
area = (0, 10000, 0, 10000)
x, y, z = gridder.scatter(area, 1000, z=-150, seed=0)
tf = contaminate(sphere.tf(x, y, z, model, inc, dec), 5.0, seed=0)

# Give the centers of the dipoles
centers = [[3000, 3000, 1000], [7000, 7000, 1000]]

# Estimate the magnetization vectors
solver = DipoleMagDir(x, y, z, tf, inc, dec, centers).fit()

# Print the estimated and true dipole monents, inclinations and declinations
print('Estimated magnetization (intensity, inclination, declination)')