Skip to content

Commit

Permalink
Deploy to GitHub pages
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] authored Dec 6, 2024
0 parents commit 9930206
Show file tree
Hide file tree
Showing 1,748 changed files with 148,985 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .buildinfo
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: 6f51335818d187508385da20397d2891
tags: 645f666f9bcd5a90fca523b33c5a78b7
Empty file added .nojekyll
Empty file.
1 change: 1 addition & 0 deletions CNAME
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
em.geosci.xyz
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
14 changes: 14 additions & 0 deletions _downloads/16cd09a07d48eeea36e78d708acd6083/index-1.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
L = 1.
R = 2000.
alpha = np.logspace(-3, 3, 100)
Q = (alpha ** 2 + 1j * alpha) / (1 + alpha ** 2)
fig = plt.figure(figsize=(5, 3))
ax1 = plt.subplot(111)
ax1.semilogx(alpha, Q.real, 'k', lw=3)
ax1.semilogx(alpha, Q.imag, 'r', lw=3)
ax1.grid(True)
ax1.legend(("Real","Imaginary"), loc=2)
ax1.set_xlabel("Induction number ($\\alpha$)")
ax1.set_ylabel("Response function (Q)")
plt.tight_layout()
plt.show()
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
from matplotlib import patches
from geoana.em.static import ElectrostaticSphere

sig0 = 10.**-3. # conductivity of the whole-space in S/m
sig1 = 10.**-1. # conductivity of the sphere in S/m
R = 50. # radius of the sphere in m
E0 = 1. # inducing field strength in V/m

sphere = ElectrostaticSphere(R, sig1, sig0, E0) # create the sphere object

n = 50 #level of discretization
xr = np.linspace(-2.*R, 2.*R, n) # X-axis discretization
yr = xr.copy() # Y-axis discretization
X, Y = np.meshgrid(xr, yr)
Z = np.zeros_like(X)

potentials = sphere.potential((X, Y, Z), field='primary')

fig, ax = plt.subplots(1,1, figsize = (8,6))
im = ax.pcolor(X, Y, potentials, shading='auto')
cb = plt.colorbar(im)
cb.set_label(label='Potential ($V$)')
ax.add_patch(patches.Circle([0,0], R, fill=False, linestyle='--'))

ax.set_title('Primary Potential')
ax.set_ylabel('Y coordinate ($m$)')
ax.set_xlabel('X coordinate ($m$)')
ax.set_aspect('equal')
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
from matplotlib import patches
from geoana.em.static import ElectrostaticSphere

sig0 = 10.**-3. # conductivity of the whole-space in S/m
sig1 = 10.**-1. # conductivity of the sphere in S/m
sig2 = 10.**-5. # conductivity of the sphere in S/m
R = 50. # radius of the sphere in m
E0 = 1. # inducing field strength in V/m

sphere1 = ElectrostaticSphere(R, sig1, sig0, E0) # create the sphere object
sphere2 = ElectrostaticSphere(R, sig2, sig0, E0) # create the sphere object

n = 50 #level of discretization
xr = np.linspace(-2.*R, 2.*R, n) # X-axis discretization
yr = xr.copy() # Y-axis discretization
X, Y = np.meshgrid(xr, yr)
Z = np.zeros_like(X)

Et1, Ep1, Es1 = sphere1.electric_field((X, Y, Z), field='all')
Et2, Ep2, Es2 = sphere2.electric_field((X, Y, Z), field='all')

fig, axs = plt.subplots(2,2,figsize=(18,12))
Es = [Et1, Et2, Es1, Es2]
titles = [
'Conductive Sphere: \n Total Electric Field',
'Resistive Sphere: \n Total Electric Field',
'Conductive Sphere: \n Secondary Electric Field',
'Resistive Sphere: \n Secondary Electric Field',
]
for ax, E, title in zip(axs.flatten(), Es, titles):
E_amp = np.linalg.norm(E, axis=-1)
im = ax.pcolor(X, Y, E_amp, shading='auto')
cb = plt.colorbar(im, ax=ax)
cb.set_label(label= 'Amplitude ($V/m$)')
ax.streamplot(X, Y, E[..., 0], E[..., 1], color='gray', linewidth=2., density=0.75)
ax.add_patch(patches.Circle([0,0], R, 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()
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
from matplotlib import patches
from geoana.em.static import ElectrostaticSphere

sig0 = 10.**-3. # conductivity of the whole-space in S/m
sig1 = 10.**-1. # conductivity of the sphere in S/m
sig2 = 10.**-5. # conductivity of the sphere in S/m
R = 50. # radius of the sphere in m
E0 = 1. # inducing field strength in V/m

sphere1 = ElectrostaticSphere(R, sig1, sig0, E0) # create the sphere object
sphere2 = ElectrostaticSphere(R, sig2, sig0, E0) # create the sphere object

n = 50 #level of discretization
xr = np.linspace(-2.*R, 2.*R, n) # X-axis discretization
yr = xr.copy() # Y-axis discretization
X, Y = np.meshgrid(xr, yr)
Z = np.zeros_like(X)

Jt1, Jp1, Js1 = sphere1.current_density((X, Y, Z), field='all')
Jt2, Jp2, Js2 = sphere2.current_density((X, Y, Z), field='all')

fig, axs = plt.subplots(2,2,figsize=(18,12))
Js = [Jt1, Jt2, Js1, Js2]
titles = [
'Conductive Sphere: \n Total Current Density',
'Resistive Sphere: \n Total Current Density',
'Conductive Sphere: \n Secondary Current Density',
'Resistive Sphere: \n Secondary Current Density',
]
for ax, J, title in zip(axs.flatten(), Js, titles):
J_amp = np.linalg.norm(J, axis=-1)
im = ax.pcolor(X, Y, J_amp, shading='auto')
cb = plt.colorbar(im, ax=ax)
cb.set_label(label='Current Density ($A/m^2$)')
ax.streamplot(X, Y, J[..., 0], J[..., 1], color='gray', linewidth=2., density=0.75)
ax.add_patch(patches.Circle([0,0], R, 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()
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
from matplotlib import patches
from geoana.em.static import ElectrostaticSphere

sig0 = 10.**-3. # conductivity of the whole-space in S/m
sig1 = 10.**-1. # conductivity of the sphere in S/m
sig2 = 1.310344828 * 10**-3.
R0 = 20. # radius of the sphere in m
R1 = 40.
E0 = 1. # inducing field strength in V/m

sphere1 = ElectrostaticSphere(R0, sig1, sig0, E0) # create the sphere object
sphere2 = ElectrostaticSphere(R1, sig2, sig0, E0) # create the sphere object

n = 31 #level of discretization
xr = np.linspace(-100, 100, n) # X-axis dipole midpoints
yr = xr.copy() # Y-axis dipole midpoints
X, Y = np.meshgrid(xr, yr)
Z = np.zeros_like(X)

Dx = np.linspace(-100, 100, n)
Dy = np.linspace(-100, 100, n)
Dz = np.zeros(n)
electrode_spacing = 10

Mx = Dx - 0.5 * electrode_spacing/np.sqrt(2)
My = Dy - 0.5 * electrode_spacing/np.sqrt(2)
Mz = Dz
Nx = Dx + 0.5 * electrode_spacing/np.sqrt(2)
Ny = Dy + 0.5 * electrode_spacing/np.sqrt(2)
Nz = Dz

fig = plt.figure(figsize=(20, 20))
ax0 = plt.subplot2grid((20, 12), (0, 0), colspan=6, rowspan=6)
ax1 = plt.subplot2grid((20, 12), (0, 6), colspan=6, rowspan=6)
ax2 = plt.subplot2grid((20, 12), (8, 0), colspan=6, rowspan=6)
ax3 = plt.subplot2grid((20, 12), (8, 6), colspan=6, rowspan=6)
ax4 = plt.subplot2grid((20, 12), (16, 2), colspan=9, rowspan=4)

R = 50
for ax, color, sig_circ, r in zip([ax0, ax1], [[0.6, 0.1, 0.1], [0.1, 0.1, 0.6]], [sig1, sig2], [R0, R1]):
circle = patches.Circle([0,0],radius=r, alpha=0.4, color=color, linewidth=1.5)
ax.add_patch(circle)
ax.arrow(0., 0., np.sqrt(2.)*r/2., np.sqrt(2.)*r/2., head_width=0., head_length=0.)

for y in np.linspace(-2 * R, 2 * R, 10):
ax.arrow(-2*R, y, 0.3*R, 0.0, head_width=5., head_length=2., color='k')

ax.text(0, -r/2., f'$\sigma_1$={sig_circ*1000:3.3f} mS/m')
ax.text(0, -1.5*r, f'$\sigma_0$={sig0*1000:3.3f} mS/m')
ax.text(0.5*np.cos(np.pi/6)*r, 0.5*np.sin(np.pi/6)*r, f'R={r:1.0f} m')
ax.text(-1.8*R, 1.3*R, f'$\mathbf{{E_0}} = {E0:1.0f} \mathbf{{\hat{{x}}}}$ V/m')

ax.set_facecolor([0.4, 0.7, 0.4, 0.3])
ax.set_xlim([-2 * R, 2 * R])
ax.set_ylim([-2 * R, 2 * R])
ax.set_ylabel('Y coordinate ($m$)')
ax.set_xlabel('X coordinate ($m$)')
ax.set_aspect('equal')

Vt1 = sphere1.potential((X, Y, Z), field='total')
Vt2 = sphere2.potential((X, Y, Z), field='total')
titles = [
'Conductive Sphere: \n Total Potential',
'Resistive Sphere: \n Total Potential',
]

for ax, V, title, r in zip([ax2, ax3], [Vt1, Vt2], titles, [R0, R1]):
im = ax.pcolor(X, Y, V, shading='auto')
cb = plt.colorbar(im, ax=ax)
cb.set_label(label='Potential ($V$)')
ax.add_patch(patches.Circle([0,0], r, fill=False, linestyle='--'))

ax.set_title(title)
ax.set_ylabel('Y coordinate ($m$)')
ax.set_xlabel('X coordinate ($m$)')
ax.set_aspect('equal')

ax.plot(Dx, Dy, color='gray')
ax.scatter(Dx, Dx, color='black', label="Dipole Midpoint")
ax.scatter(np.r_[Mx, Nx], np.r_[My, Ny], color='red', label="Electrodes")
ax.legend(loc='best')

VM1 = sphere1.potential((Mx, My, Mz), field='total')
VN1 = sphere1.potential((Nx, Ny, Nz), field='total')

VM2 = sphere2.potential((Mx, My, Mz), field='total')
VN2 = sphere2.potential((Nx, Ny, Nz), field='total')

#Plot the Data (from Configuration 0)
ax4.plot(np.sqrt(2)*np.linspace(-100, 100, n), VM1-VN1,
marker='o', color='red', linewidth=3., label='Left Model Response' )
ax4.plot(np.sqrt(2)*np.linspace(-100, 100, n), VM2-VN2,
marker='o', color='blue', linewidth=3., label='Right Model Response' )
ax4.set_xlabel('Profile Distance ($m$)')
ax4.set_ylabel('Potential Difference ($V$)')
ax4.legend(loc='best')

plt.show()
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
from matplotlib import patches
from geoana.em.static import ElectrostaticSphere

sig0 = 10.**-3. # conductivity of the whole-space in S/m
sig1 = 10.**-1. # conductivity of the sphere in S/m
sig2 = 10.**-5. # conductivity of the sphere in S/m
R = 50. # radius of the sphere in m
E0 = 1. # inducing field strength in V/m

sphere1 = ElectrostaticSphere(R, sig1, sig0, E0) # create the sphere object
sphere2 = ElectrostaticSphere(R, sig2, sig0, E0) # create the sphere object

n = 50 #level of discretization
xr = np.linspace(-2.*R, 2.*R, n) # X-axis discretization
yr = xr.copy() # Y-axis discretization
X, Y = np.meshgrid(xr, yr)
Z = np.zeros_like(X)

q1 = sphere1.charge_density((X, Y, Z), dr=xr[1]-xr[0])
q2 = sphere2.charge_density((X, Y, Z), dr=xr[1]-xr[0])

fig, axs = plt.subplots(1,2,figsize=(18,6))
qs = [q1, q2]
titles = ['Conductive Sphere: \n Charge Accumulation', 'Resistive Sphere: \n Charge Accumulation']

for ax, q, title in zip(axs, qs, titles):
im = ax.pcolor(X, Y, q, shading='auto')
cb1 = plt.colorbar(im, ax=ax)
cb1.set_label(label= 'Charge Density ($C/m^2$)')
ax.add_patch(patches.Circle([0,0], R, fill=False, linestyle='--'))

ax.set_ylabel('Y coordinate ($m$)')
ax.set_xlabel('X coordinate ($m$)')
ax.set_title(title)
ax.set_aspect('equal')

plt.tight_layout()
plt.show()
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
from matplotlib import patches
from geoana.em.static import ElectrostaticSphere

sig0 = 10.**-3. # conductivity of the whole-space in S/m
sig1 = 10.**-1. # conductivity of the sphere in S/m
sig2 = 10.**-5. # conductivity of the sphere in S/m
R = 50. # radius of the sphere in m
E0 = 1. # inducing field strength in V/m

sphere1 = ElectrostaticSphere(R, sig1, sig0, E0) # create the sphere object
sphere2 = ElectrostaticSphere(R, sig2, sig0, E0) # create the sphere object

n = 31 #level of discretization
xr = np.linspace(-100, 100, n) # X-axis dipole midpoints
yr = xr.copy() # Y-axis dipole midpoints
X, Y = np.meshgrid(xr, yr)
Z = np.zeros_like(X)

Dx = np.linspace(-100, 100, n)
Dy = np.linspace(-100, 100, n)
Dz = np.zeros(n)
electrode_spacing = 10

Mx = Dx - 0.5 * electrode_spacing/np.sqrt(2)
My = Dy - 0.5 * electrode_spacing/np.sqrt(2)
Mz = Dz
Nx = Dx + 0.5 * electrode_spacing/np.sqrt(2)
Ny = Dy + 0.5 * electrode_spacing/np.sqrt(2)
Nz = Dz

fig = plt.figure(figsize=(20, 20))
ax0 = plt.subplot2grid((20, 12), (0, 0), colspan=6, rowspan=6)
ax1 = plt.subplot2grid((20, 12), (0, 6), colspan=6, rowspan=6)
ax2 = plt.subplot2grid((20, 12), (8, 0), colspan=6, rowspan=6)
ax3 = plt.subplot2grid((20, 12), (8, 6), colspan=6, rowspan=6)
ax4 = plt.subplot2grid((20, 12), (16, 2), colspan=9, rowspan=4)

for ax, color, sig_circ in zip([ax0, ax1], [[0.6, 0.1, 0.1], [0.1, 0.1, 0.6]], [sig1, sig2]):
circle = patches.Circle([0,0],radius=R, alpha=0.4, color=color, linewidth=1.5)
ax.add_patch(circle)
ax.arrow(0., 0., np.sqrt(2.)*R/2., np.sqrt(2.)*R/2., head_width=0., head_length=0.)

for y in np.linspace(-2 * R, 2 * R, 10):
ax.arrow(-2*R, y, 0.3*R, 0.0, head_width=5., head_length=2., color='k')

ax.text(0, -R/2., f'$\sigma_1$={sig_circ*1000:3.3f} mS/m')
ax.text(0, -1.5*R, f'$\sigma_0$={sig0*1000:3.3f} mS/m')
ax.text(0.5*np.cos(np.pi/6)*R, 0.5*np.sin(np.pi/6)*R, f'R={R:1.0f} m')
ax.text(-1.8*R, 1.3*R, f'$\mathbf{{E_0}} = {E0:1.0f} \mathbf{{\hat{{x}}}}$ V/m')

ax.set_facecolor([0.4, 0.7, 0.4, 0.3])
ax.set_xlim([-2 * R, 2 * R])
ax.set_ylim([-2 * R, 2 * R])
ax.set_ylabel('Y coordinate ($m$)')
ax.set_xlabel('X coordinate ($m$)')
ax.set_aspect('equal')

Vt1 = sphere1.potential((X, Y, Z), field='total')
Vt2 = sphere2.potential((X, Y, Z), field='total')
titles = [
'Conductive Sphere: \n Total Potential',
'Resistive Sphere: \n Total Potential',
]

for ax, V, title in zip([ax2, ax3], [Vt1, Vt2], titles):
im = ax.pcolor(X, Y, V, shading='auto')
cb = plt.colorbar(im, ax=ax)
cb.set_label(label='Potential ($V$)')
ax.add_patch(patches.Circle([0,0], R, fill=False, linestyle='--'))

ax.set_title(title)
ax.set_ylabel('Y coordinate ($m$)')
ax.set_xlabel('X coordinate ($m$)')
ax.set_aspect('equal')

ax.plot(Dx, Dy, color='gray')
ax.scatter(Dx, Dx, color='black', label="Dipole Midpoint")
ax.scatter(np.r_[Mx, Nx], np.r_[My, Ny], color='red', label="Electrodes")
ax.legend(loc='best')

VM1 = sphere1.potential((Mx, My, Mz), field='total')
VN1 = sphere1.potential((Nx, Ny, Nz), field='total')

VM2 = sphere2.potential((Mx, My, Mz), field='total')
VN2 = sphere2.potential((Nx, Ny, Nz), field='total')

#Plot the Data (from Configuration 0)
ax4.plot(np.sqrt(2)*np.linspace(-100, 100, n), VM1-VN1,
marker='o', color='red', linewidth=3., label='Left Model Response' )
ax4.plot(np.sqrt(2)*np.linspace(-100, 100, n), VM2-VN2,
marker='o', color='blue', linewidth=3., label='Right Model Response' )
ax4.set_xlabel('Profile Distance ($m$)')
ax4.set_ylabel('Potential Difference ($V$)')
ax4.legend(loc='best')

plt.show()
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit 9930206

Please sign in to comment.