-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 8c6d002
Showing
1,204 changed files
with
479,231 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Sphinx build info version 1 | ||
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. | ||
config: 16d3360a29ba6d075d2077b5939d3251 | ||
tags: 645f666f9bcd5a90fca523b33c5a78b7 |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
geoana.simpeg.xyz |
45 changes: 45 additions & 0 deletions
45
...049ebf5f8db05b09e65ed55207cc4cf0/geoana-em-static-MagnetostaticSphere-magnetic_field-1.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# Here, we define a sphere with permeability mu_sphere in a uniform magnetostatic field with permeability | ||
# mu_background and plot the total and secondary magnetic fields. | ||
# | ||
import numpy as np | ||
import matplotlib.pyplot as plt | ||
from matplotlib import patches | ||
from mpl_toolkits.axes_grid1 import make_axes_locatable | ||
from geoana.em.static import MagnetostaticSphere | ||
# | ||
# Define the sphere. | ||
# | ||
mu_sphere = 10. ** -1 | ||
mu_background = 10. ** -3 | ||
radius = 1.0 | ||
simulation = MagnetostaticSphere( | ||
location=None, mu_sphere=mu_sphere, mu_background=mu_background, radius=radius, primary_field=None | ||
) | ||
# | ||
# Now we create a set of gridded locations and compute the magnetic fields. | ||
# | ||
X, Y = np.meshgrid(np.linspace(-2*radius, 2*radius, 20), np.linspace(-2*radius, 2*radius, 20)) | ||
Z = np.zeros_like(X) + 0.25 | ||
xyz = np.stack((X, Y, Z), axis=-1) | ||
ht = simulation.magnetic_field(xyz, field='total') | ||
hs = simulation.magnetic_field(xyz, field='secondary') | ||
# | ||
# Finally, we plot the total and secondary magnetic fields. | ||
# | ||
fig, axs = plt.subplots(1, 2, figsize=(18,12)) | ||
titles = ['Total Magnetic Field', 'Secondary Magnetic Field'] | ||
for ax, H, title in zip(axs.flatten(), [ht, hs], titles): | ||
H_amp = np.linalg.norm(H, axis=-1) | ||
im = ax.pcolor(X, Y, H_amp, shading='auto') | ||
divider = make_axes_locatable(ax) | ||
cax = divider.append_axes("right", size="5%", pad=0.05) | ||
cb = plt.colorbar(im, cax=cax) | ||
cb.set_label(label= 'Amplitude ($A/m$)') | ||
ax.streamplot(X, Y, H[..., 0], H[..., 1], density=0.75) | ||
ax.add_patch(patches.Circle((0, 0), radius, fill=False, linestyle='--')) | ||
ax.set_ylabel('Y coordinate ($m$)') | ||
ax.set_xlabel('X coordinate ($m$)') | ||
ax.set_aspect('equal') | ||
ax.set_title(title) | ||
plt.tight_layout() | ||
plt.show() |
34 changes: 34 additions & 0 deletions
34
...ds/05ff2fa7d9719112280af013b3598c83/geoana-em-tdem-TransientPlaneWave-electric_field-1.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Here, we define a transient planewave in the x-direction in a wholespace. | ||
# | ||
from geoana.em.tdem import TransientPlaneWave | ||
import numpy as np | ||
from geoana.utils import ndgrid | ||
from mpl_toolkits.axes_grid1 import make_axes_locatable | ||
import matplotlib.pyplot as plt | ||
# | ||
# Let us begin by defining the transient planewave in the x-direction. | ||
# | ||
time = 1.0 | ||
orientation = 'X' | ||
sigma = 1.0 | ||
simulation = TransientPlaneWave( | ||
time=time, orientation=orientation, sigma=sigma | ||
) | ||
# | ||
# Now we create a set of gridded locations and compute the electric field. | ||
# | ||
x = np.linspace(-1, 1, 20) | ||
z = np.linspace(-1000, 0, 20) | ||
xyz = ndgrid(x, np.array([0]), z) | ||
e_vec = simulation.electric_field(xyz) | ||
ex = e_vec[..., 0] | ||
# | ||
# Finally, we plot the x-oriented electric field. | ||
# | ||
plt.pcolor(x, z, ex.reshape(20, 20), shading='auto') | ||
cb = plt.colorbar() | ||
cb.set_label(label= 'Electric Field ($V/m$)') | ||
plt.ylabel('Z coordinate ($m$)') | ||
plt.xlabel('X coordinate ($m$)') | ||
plt.title('Electric Field of a Transient Planewave in the x-direction in a Wholespace') | ||
plt.show() |
Binary file not shown.
Binary file added
BIN
+21.5 KB
...cc8c718121c0c637b42b4bdeecd7/geoana-em-static-PointCurrentHalfSpace-current_density-1.pdf
Binary file not shown.
Binary file added
BIN
+31.6 KB
...ds/0a78a4777d5711c77741c4d1865abc5f/geoana-em-fdem-HarmonicPlaneWave-electric_field-1.pdf
Binary file not shown.
Binary file added
BIN
+11.7 KB
...ee23d9e7/geoana-em-tdem-vertical_magnetic_flux_time_deriv_horizontal_loop-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 31 additions & 0 deletions
31
...c25dfedb7c71cf82b20ef17513a0696/geoana-em-static-LineCurrentFreeSpace-magnetic_field-1.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Here, we define a horizontal square loop and plot the magnetic field | ||
# on the xz-plane that intercepts at y=0. | ||
# | ||
from geoana.em.static import LineCurrentFreeSpace | ||
from geoana.utils import ndgrid | ||
from geoana.plotting_utils import plot2Ddata | ||
import numpy as np | ||
import matplotlib.pyplot as plt | ||
# | ||
# Let us begin by defining the loop. Note that to create an inductive | ||
# source, we closed the loop. | ||
# | ||
x_nodes = np.array([-0.5, 0.5, 0.5, -0.5, -0.5]) | ||
y_nodes = np.array([-0.5, -0.5, 0.5, 0.5, -0.5]) | ||
z_nodes = np.zeros_like(x_nodes) | ||
nodes = np.c_[x_nodes, y_nodes, z_nodes] | ||
simulation = LineCurrentFreeSpace(nodes) | ||
# | ||
# Now we create a set of gridded locations and compute the magnetic field. | ||
# | ||
xyz = ndgrid(np.linspace(-1, 1, 50), np.array([0]), np.linspace(-1, 1, 50)) | ||
H = simulation.magnetic_field(xyz) | ||
# | ||
# Finally, we plot the magnetic field. | ||
# | ||
fig = plt.figure(figsize=(4, 4)) | ||
ax = fig.add_axes([0.15, 0.15, 0.75, 0.75]) | ||
plot2Ddata(xyz[:, [0, 2]], H[:, [0, 2]], ax=ax, vec=True, scale='log', ncontour=25) | ||
ax.set_xlabel('X') | ||
ax.set_ylabel('Z') | ||
ax.set_title('Magnetic field') |
Binary file added
BIN
+18.3 KB
...67ee18acb2582830287c7e45d41/geoana-gravity-Sphere-gravitational_potential-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+57.8 KB
...c776062581d4c138d84014a8c5effa7/geoana-em-static-ElectrostaticSphere-electric_field-1.pdf
Binary file not shown.
32 changes: 32 additions & 0 deletions
32
...80d4704774fd8867de05810eb/geoana-em-static-MagneticDipoleWholeSpace-vector_potential-1.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Here, we define a z-oriented magnetic dipole and plot the vector | ||
# potential on the xy-plane that intercepts at z=0. | ||
# | ||
from geoana.em.static import MagneticDipoleWholeSpace | ||
from geoana.utils import ndgrid | ||
from geoana.plotting_utils import plot2Ddata | ||
import numpy as np | ||
import matplotlib.pyplot as plt | ||
# | ||
# Let us begin by defining the magnetic dipole. | ||
# | ||
location = np.r_[0., 0., 0.] | ||
orientation = np.r_[0., 0., 1.] | ||
moment = 1. | ||
dipole_object = MagneticDipoleWholeSpace( | ||
location=location, orientation=orientation, moment=moment | ||
) | ||
# | ||
# Now we create a set of gridded locations and compute the vector potential. | ||
# | ||
xyz = ndgrid(np.linspace(-1, 1, 20), np.linspace(-1, 1, 20), np.array([0])) | ||
a = dipole_object.vector_potential(xyz) | ||
# | ||
# Finally, we plot the vector potential on the plane. Given the symmetry, | ||
# there are only horizontal components. | ||
# | ||
fig = plt.figure(figsize=(4, 4)) | ||
ax = fig.add_axes([0.15, 0.15, 0.8, 0.8]) | ||
plot2Ddata(xyz[:, 0:2], a[:, 0:2], ax=ax, vec=True, scale='log') | ||
ax.set_xlabel('X') | ||
ax.set_ylabel('Z') | ||
ax.set_title('Vector potential at z=0') |
32 changes: 32 additions & 0 deletions
32
...1bc0a56939f6b81a4617/geoana-em-static-MagneticDipoleWholeSpace-magnetic_flux_density-1.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Here, we define a z-oriented magnetic dipole and plot the magnetic | ||
# flux density on the xy-plane that intercepts y=0. | ||
# | ||
from geoana.em.static import MagneticDipoleWholeSpace | ||
from geoana.utils import ndgrid | ||
from geoana.plotting_utils import plot2Ddata | ||
import numpy as np | ||
import matplotlib.pyplot as plt | ||
# | ||
# Let us begin by defining the magnetic dipole. | ||
# | ||
location = np.r_[0., 0., 0.] | ||
orientation = np.r_[0., 0., 1.] | ||
moment = 1. | ||
dipole_object = MagneticDipoleWholeSpace( | ||
location=location, orientation=orientation, moment=moment | ||
) | ||
# | ||
# Now we create a set of gridded locations and compute the vector potential. | ||
# | ||
xyz = ndgrid(np.linspace(-1, 1, 20), np.array([0]), np.linspace(-1, 1, 20)) | ||
B = dipole_object.magnetic_flux_density(xyz) | ||
# | ||
# Finally, we plot the vector potential on the plane. Given the symmetry, | ||
# there are only horizontal components. | ||
# | ||
fig = plt.figure(figsize=(4, 4)) | ||
ax = fig.add_axes([0.15, 0.15, 0.8, 0.8]) | ||
plot2Ddata(xyz[:, 0::2], B[:, 0::2], ax=ax, vec=True, scale='log') | ||
ax.set_xlabel('X') | ||
ax.set_ylabel('Z') | ||
ax.set_title('Magnetic flux density at y=0') |
Binary file added
BIN
+18.3 KB
...f5674b4ca4c58bf1c321bb61/geoana-em-tdem-TransientPlaneWave-electric_field-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 29 additions & 0 deletions
29
...nloads/1431bc967a3504f266f06fe58b074465/geoana-gravity-PointMass-gravitational_field-1.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Here, we define a point mass with mass=1kg and plot the gravitational | ||
# field lines in the xy-plane. | ||
# | ||
import numpy as np | ||
import matplotlib.pyplot as plt | ||
from geoana.gravity import PointMass | ||
# | ||
# Define the point mass. | ||
# | ||
location = np.r_[0., 0., 0.] | ||
mass = 1.0 | ||
simulation = PointMass( | ||
mass=mass, location=location | ||
) | ||
# | ||
# Now we create a set of gridded locations and compute the gravitational field. | ||
# | ||
X, Y = np.meshgrid(np.linspace(-1, 1, 20), np.linspace(-1, 1, 20)) | ||
Z = np.zeros_like(X) + 0.25 | ||
xyz = np.stack((X, Y, Z), axis=-1) | ||
g = simulation.gravitational_field(xyz) | ||
# | ||
# Finally, we plot the gravitational field lines. | ||
# | ||
plt.quiver(X, Y, g[:,:,0], g[:,:,1]) | ||
plt.xlabel('x') | ||
plt.ylabel('y') | ||
plt.title('Gravitational Field Lines for a Point Mass') | ||
plt.show() |
Binary file added
BIN
+13.2 KB
...bc08111d6a1be48538d97/geoana-em-static-ElectrostaticSphere-charge_density-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
46 changes: 46 additions & 0 deletions
46
...1a326c15e71fe9acfe5b5142fd70/geoana-em-fdem-ElectricDipoleWholeSpace-current_density-1.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# Here, we define an x-oriented electric dipole and plot the current | ||
# density on the xz-plane that intercepts y=0. | ||
# | ||
from geoana.em.fdem import ElectricDipoleWholeSpace | ||
from geoana.utils import ndgrid | ||
from geoana.plotting_utils import plot2Ddata | ||
import numpy as np | ||
import matplotlib.pyplot as plt | ||
# | ||
# Let us begin by defining the electric current dipole. | ||
# | ||
frequency = np.logspace(1, 3, 3) | ||
location = np.r_[0., 0., 0.] | ||
orientation = np.r_[1., 0., 0.] | ||
current = 1. | ||
sigma = 1.0 | ||
simulation = ElectricDipoleWholeSpace( | ||
frequency, location=location, orientation=orientation, | ||
current=current, sigma=sigma | ||
) | ||
# | ||
# Now we create a set of gridded locations and compute the current density. | ||
# | ||
xyz = ndgrid(np.linspace(-1, 1, 20), np.array([0]), np.linspace(-1, 1, 20)) | ||
J = simulation.current_density(xyz) | ||
# | ||
# Finally, we plot the real and imaginary components of the current density. | ||
# | ||
f_ind = 1 | ||
fig = plt.figure(figsize=(6, 3)) | ||
ax1 = fig.add_axes([0.15, 0.15, 0.40, 0.75]) | ||
plot2Ddata( | ||
xyz[:, 0::2], np.real(J[f_ind, :, 0::2]), vec=True, ax=ax1, scale='log', ncontour=25 | ||
) | ||
ax1.set_xlabel('X') | ||
ax1.set_ylabel('Z') | ||
ax1.autoscale(tight=True) | ||
ax1.set_title('Real component {} Hz'.format(frequency[f_ind])) | ||
ax2 = fig.add_axes([0.6, 0.15, 0.40, 0.75]) | ||
plot2Ddata( | ||
xyz[:, 0::2], np.imag(J[f_ind, :, 0::2]), vec=True, ax=ax2, scale='log', ncontour=25 | ||
) | ||
ax2.set_xlabel('X') | ||
ax2.set_yticks([]) | ||
ax2.autoscale(tight=True) | ||
ax2.set_title('Imag component {} Hz'.format(frequency[f_ind])) |
Binary file added
BIN
+28 KB
...3b9093c9b40ed1aa8e17f2e6a6655/geoana-em-static-PointCurrentHalfSpace-electric_field-1.pdf
Binary file not shown.
Binary file added
BIN
+156 KB
...6a21241f3d87209c54/geoana-em-fdem-MagneticDipoleWholeSpace-magnetic_field-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
35 changes: 35 additions & 0 deletions
35
...c9d88b2ab30515c4db/geoana-em-tdem-ElectricDipoleWholeSpace-magnetic_field_time_deriv-1.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Here, we define a z-oriented electric dipole and plot the time-derivative | ||
# of the magnetic field on the xy-plane that intercepts z=0. | ||
# | ||
from geoana.em.tdem import ElectricDipoleWholeSpace | ||
from geoana.utils import ndgrid | ||
from geoana.plotting_utils import plot2Ddata | ||
import numpy as np | ||
import matplotlib.pyplot as plt | ||
# | ||
# Let us begin by defining the electric current dipole. | ||
# | ||
time = np.logspace(-6, -2, 3) | ||
location = np.r_[0., 0., 0.] | ||
orientation = np.r_[0., 0., 1.] | ||
current = 1. | ||
sigma = 1.0 | ||
simulation = ElectricDipoleWholeSpace( | ||
time, location=location, orientation=orientation, | ||
current=current, sigma=sigma | ||
) | ||
# | ||
# Now we create a set of gridded locations and compute the dh/dt. | ||
# | ||
xyz = ndgrid(np.linspace(-10, 10, 20), np.linspace(-10, 10, 20), np.array([0])) | ||
dHdt = simulation.magnetic_field_time_deriv(xyz) | ||
# | ||
# Finally, we plot dH/dt at the desired locations/times. | ||
# | ||
t_ind = 0 | ||
fig = plt.figure(figsize=(4, 4)) | ||
ax = fig.add_axes([0.15, 0.15, 0.8, 0.8]) | ||
plot2Ddata(xyz[:, 0:2], dHdt[t_ind, :, 0:2], ax=ax, vec=True, scale='log') | ||
ax.set_xlabel('X') | ||
ax.set_ylabel('Y') | ||
ax.set_title('dH/dt at {} s'.format(time[t_ind])) |
Binary file added
BIN
+46.6 KB
...9253328c53f3d6e035c9ba28b80ce87/geoana-gravity-Sphere-gravitational_field-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
46 changes: 46 additions & 0 deletions
46
...c3da5fb9f2c64c55ad12f3e49236d/geoana-em-fdem-ElectricDipoleWholeSpace-magnetic_field-1.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# Here, we define an z-oriented electric dipole and plot the magnetic field | ||
# on the xy-plane that intercepts z=0. | ||
# | ||
from geoana.em.fdem import ElectricDipoleWholeSpace | ||
from geoana.utils import ndgrid | ||
from geoana.plotting_utils import plot2Ddata | ||
import numpy as np | ||
import matplotlib.pyplot as plt | ||
# | ||
# Let us begin by defining the electric current dipole. | ||
# | ||
frequency = np.logspace(1, 3, 3) | ||
location = np.r_[0., 0., 0.] | ||
orientation = np.r_[0., 0., 1.] | ||
current = 1. | ||
sigma = 1.0 | ||
simulation = ElectricDipoleWholeSpace( | ||
frequency, location=location, orientation=orientation, | ||
current=current, sigma=sigma | ||
) | ||
# | ||
# Now we create a set of gridded locations and compute the magnetic field. | ||
# | ||
xyz = ndgrid(np.linspace(-1, 1, 20), np.linspace(-1, 1, 20), np.array([0])) | ||
H = simulation.magnetic_field(xyz) | ||
# | ||
# Finally, we plot the real and imaginary components of the magnetic field. | ||
# | ||
f_ind = 1 | ||
fig = plt.figure(figsize=(6, 3)) | ||
ax1 = fig.add_axes([0.15, 0.15, 0.40, 0.75]) | ||
plot2Ddata( | ||
xyz[:, 0:2], np.real(H[f_ind, :, 0:2]), vec=True, ax=ax1, scale='log', ncontour=25 | ||
) | ||
ax1.set_xlabel('X') | ||
ax1.set_ylabel('Y') | ||
ax1.autoscale(tight=True) | ||
ax1.set_title('Real component {} Hz'.format(frequency[f_ind])) | ||
ax2 = fig.add_axes([0.6, 0.15, 0.40, 0.75]) | ||
plot2Ddata( | ||
xyz[:, 0:2], np.imag(H[f_ind, :, 0:2]), vec=True, ax=ax2, scale='log', ncontour=25 | ||
) | ||
ax2.set_xlabel('X') | ||
ax2.set_yticks([]) | ||
ax2.autoscale(tight=True) | ||
ax2.set_title('Imag component {} Hz'.format(frequency[f_ind])) |
Binary file added
BIN
+36 KB
...ads/1bd1dadb421db24bb7180e17c58ba131/geoana-em-static-ElectrostaticSphere-potential-1.pdf
Binary file not shown.
Binary file added
BIN
+114 KB
...fbf2ce69a3358df1a74f8a375eb6/geoana-em-fdem-MagneticDipoleWholeSpace-magnetic_field-1.pdf
Binary file not shown.
Oops, something went wrong.