PK WaX#H ziolkowski2007.ipynb{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"%matplotlib notebook"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"\n# Ziolkowski et al., 2007\n\nReproducing Figure 3 of Ziolkowski et al., 2007, Geophysics. This is a land\nMTEM example.\n\n**Reference**\n\n- **Ziolkowski, A., B. Hobbs, and D. Wright, 2007**, Multitransient\n electromagnetic demonstration survey in France: Geophysics, 72, F197-F209;\n DOI: [10.1190/1.2735802](https://doi.org/10.1190/1.2735802).\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"import empymod\nimport numpy as np\nfrom copy import deepcopy as dc\nimport matplotlib.pyplot as plt"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Computation\n\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"# Time\nt = np.linspace(0.001, 0.06, 101)\n\n# Target model\ninp2 = {'src': [0, 0, 0.001],\n 'rec': [1000, 0, 0.001],\n 'depth': [0, 500, 525],\n 'res': [2e14, 20, 500, 20],\n 'freqtime': t,\n 'verb': 1}\n\n# HS model\ninp1 = dc(inp2)\ninp1['depth'] = inp2['depth'][0]\ninp1['res'] = inp2['res'][:2]\n\n# Compute responses\nsths = empymod.dipole(**inp1, signal=1) # Step, HS\nsttg = empymod.dipole(**inp2, signal=1) # \" \" Target\nimhs = empymod.dipole(**inp1, signal=0, ft='fftlog') # Impulse, HS\nimtg = empymod.dipole(**inp2, signal=0, ft='fftlog') # \" \" Target"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Plot\n\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"plt.figure(figsize=(9, 4))\nplt.subplots_adjust(wspace=.3)\n\n# Step response\nplt.subplot(121)\nplt.title('(a)')\nplt.plot(np.r_[0, 0, t], np.r_[0, sths[0], sths], 'k',\n label='Uniform half-space')\nplt.plot(np.r_[0, 0, t], np.r_[0, sttg[0], sttg], 'r',\n label='Hydrocarbon reservoir')\nplt.axis([-.02, 0.06, 0, 8e-9])\nplt.xlabel('Time (s)')\nplt.ylabel('Electric field amplitude (V/m/A-m)')\nplt.legend()\n\n# Impulse response\nplt.subplot(122)\nplt.title('(b)')\n\n# Normalize by max-response\nntg = np.max(np.r_[imtg, imhs])\n\nplt.plot(np.r_[0, 0, t], np.r_[2, 0, imhs/ntg], 'k',\n label='Uniform half-space')\nplt.plot(np.r_[0, t], np.r_[0, imtg/ntg], 'r', label='Hydrocarbon reservoir')\nplt.axis([-.02, 0.06, 0, 1.02])\nplt.xlabel('Time (s)')\nplt.ylabel(r'Normalized derivative ($\\Omega$/m$^2$/s)')\nplt.legend()\nplt.show()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Original Figure\n\nFigure 3 of Ziolkowski et al., 2007, Geophysics:\n\n\n\n\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"empymod.Report()"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.6"
}
},
"nbformat": 4,
"nbformat_minor": 0
}PK RaXr7l l hunziker2015.ipynb{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"%matplotlib notebook"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"\n# Hunziker et al., 2015, Geophysics\n\nReproducing Figure 3 of the manual from `EMmod`. This example does, as such,\nnot actually reproduce a figure of Hunziker et al., 2015, but of the manual\nthat comes with the software accompanying the paper. With the software comes an\nexample input file named `simplemod.scr`, and the corresponding result is shown\nin the manual of the code in Figure 3.\n\nIf you are interested in reproducing the figures of the actual paper have a\nlook at the notebooks in the repo [article-geo2017](https://github.com/emsig/article-geo2017).\n\n**Reference**\n\n- **Hunziker, J., J. Thorbecke, and E. Slob, 2015**, The electromagnetic\n response in a layered vertical transverse isotropic medium: A new look at an\n old problem: Geophysics, 80(1), F1\u2013F18; DOI: [10.1190/geo2013-0411.1](https://doi.org/10.1190/geo2013-0411.1); Software:\n [software.seg.org/2015/0001](https://software.seg.org/2015/0001).\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"import empymod\nimport numpy as np\nimport matplotlib.pyplot as plt"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Compute the data\n\nCompute the electric field with the parameters defined in `simplemod.scr`.\n\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"# x- and y-offsets\nx = np.arange(4000)*7-1999.5*7\ny = np.arange(1500)*10-749.5*10\n\n# Create 2D arrays of them\nrx = np.repeat([x, ], np.size(y), axis=0)\nry = np.repeat([y, ], np.size(x), axis=0)\nry = ry.transpose()\n\n# Compute the electric field\nefield = empymod.dipole(\n src=[0, 0, 150],\n rec=[rx.ravel(), ry.ravel(), 200],\n depth=[0, 200, 1000, 1200],\n res=[2e14, 1/3, 1, 50, 1],\n aniso=[1, 1, np.sqrt(10), 1, 1],\n freqtime=0.5,\n epermH=[1, 80, 17, 2.1, 17],\n epermV=[1, 80, 17, 2.1, 17],\n mpermH=[1, 1, 1, 1, 1],\n mpermV=[1, 1, 1, 1, 1],\n ab=11,\n htarg={'pts_per_dec': -1},\n).reshape(np.shape(rx))"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Plot\n\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"# Create a similar colormap as Hunziker et al., 2015.\ncmap = plt.cm.get_cmap(\"jet\", 61)\n\nplt.figure(figsize=(9, 8))\n\n# 1. Amplitude\nplt.subplot(211)\nplt.title('Amplitude (V/m)')\nplt.xlabel('Offset (km)')\nplt.ylabel('Offset (km)')\nplt.pcolormesh(x/1e3, y/1e3, np.log10(efield.amp()),\n cmap=cmap, vmin=-16, vmax=-7, shading='nearest')\nplt.colorbar()\n\n# 2. Phase\nplt.subplot(212)\nplt.title('Phase (\u00b0)')\nplt.xlabel('Offset (km)')\nplt.ylabel('Offset (km)')\nplt.pcolormesh(x/1e3, y/1e3, efield.pha(deg=False, unwrap=False, lag=True),\n cmap=cmap, vmin=-np.pi, vmax=np.pi, shading='nearest')\nplt.colorbar()\n\nplt.tight_layout()\nplt.show()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Original Figure\n\nFigure 3 of the manual of `EMmod`.\n\n\n\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"empymod.Report()"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.6"
}
},
"nbformat": 4,
"nbformat_minor": 0
}PK MaẌ́b b constable2006.ipynb{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"%matplotlib notebook"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"\n# Constable and Weiss, 2006\n\nReproducing Figure 3 of Constable and Weiss, 2006, Geophysics. This is a marine\nCSEM example.\n\n**Reference**\n\n- **Constable, S., and C. J. Weiss, 2006**, Mapping thin resistors and\n hydrocarbons with marine EM methods: Insights from 1D modeling: Geophysics,\n 71, G43-G51; DOI: [10.1190/1.2187748](https://doi.org/10.1190/1.2187748).\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"import empymod\nimport numpy as np\nfrom copy import deepcopy as dc\nimport matplotlib.pyplot as plt\n\nempymod.set_minimum(min_off=1e-10)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Computation\n\nNote: Exact reproduction is not possible, as source and receiver depths are\nnot explicitly specified in the publication. I made a few checks, and it\nlooks like a source-depth of 900 meter gives good accordance. Receivers are\non the sea-floor.\n\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"# Offsets\nx = np.linspace(0, 20000, 101)\n\n# TG model\ninp3 = {'src': [0, 0, 900],\n 'rec': [x, np.zeros(x.shape), 1000],\n 'depth': [0, 1000, 2000, 2100],\n 'res': [2e14, 0.3, 1, 100, 1],\n 'freqtime': 1,\n 'verb': 1}\n\n# HS model\ninp4 = dc(inp3)\ninp4['depth'] = inp3['depth'][:2]\ninp4['res'] = inp3['res'][:3]\n\n# Compute radial responses\nrhs = empymod.dipole(**inp4) # Step, HS\nrhs = empymod.utils.EMArray(np.nan_to_num(rhs))\nrtg = empymod.dipole(**inp3) # \" \" Target\nrtg = empymod.utils.EMArray(np.nan_to_num(rtg))\n\n# Compute azimuthal response\nahs = empymod.dipole(**inp4, ab=22) # Step, HS\nahs = empymod.utils.EMArray(np.nan_to_num(ahs))\natg = empymod.dipole(**inp3, ab=22) # \" \" Target\natg = empymod.utils.EMArray(np.nan_to_num(atg))"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Plot\n\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"plt.figure(figsize=(9, 13))\nplt.subplots_adjust(wspace=.3, hspace=.3)\noldsettings = np.geterr()\n_ = np.seterr(all='ignore')\n\n# Radial amplitude\nplt.subplot(321)\nplt.title('(a) Radial mode fields')\nplt.plot(x/1000, np.log10(rtg.amp()), 'k', label='Model')\nplt.plot(x/1000, np.log10(rhs.amp()), 'k-.', label='Half-space response')\nplt.axis([0, 20, -18, -8])\nplt.xlabel('Range (km)')\nplt.ylabel(r'Log$_{10}$(E-field magnitude, V/Am$^2$)')\nplt.legend()\n\n# Radial phase\nplt.subplot(323)\nplt.title('(b) Radial mode phase')\nplt.plot(x/1000, rtg.pha(deg=True), 'k')\nplt.plot(x/1000, rhs.pha(deg=True), 'k-.')\nplt.axis([0, 20, -500, 0])\nplt.xlabel('Range (km)')\nplt.ylabel('Phase (degrees)')\n\n# Azimuthal amplitude\nplt.subplot(325)\nplt.title('(c) Azimuthal mode fields')\nplt.plot(x/1000, np.log10(atg.amp()), 'k', label='Model')\nplt.plot(x/1000, np.log10(ahs.amp()), 'k-.', label='Half-space response')\nplt.axis([0, 20, -18, -8])\nplt.xlabel('Range (km)')\nplt.ylabel(r'Log$_{10}$(E-field magnitude, V/Am$^2$)')\nplt.legend()\n\n# Azimuthal phase\nplt.subplot(322)\nplt.title('(d) Azimuthal mode phase')\nplt.plot(x/1000, atg.pha(deg=True)+180, 'k')\nplt.plot(x/1000, ahs.pha(deg=True)+180, 'k-.')\nplt.axis([0, 20, -500, 0])\nplt.xlabel('Range (km)')\nplt.ylabel('Phase (degrees)')\n\n# Normalized\nplt.subplot(324)\nplt.title('(e) Normalized E-field magnitude')\nplt.plot(x/1000, np.abs(rtg/rhs), 'k', label='Radial')\nplt.plot(x/1000, np.abs(atg/ahs), 'k--', label='Azimuthal')\nplt.axis([0, 20, 0, 70])\nplt.xlabel('Range (km)')\nplt.legend()\n\nplt.show()\n_ = np.seterr(**oldsettings)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Original Figure\n\nFigure 3 of Constable and Weiss, 2006, Geophysics:\n\n\n\n\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"empymod.Report()"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.6"
}
},
"nbformat": 4,
"nbformat_minor": 0
}PK VaXrL L ward1988.ipynb{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"%matplotlib notebook"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"\n# Ward and Hohmann, 1988, SEG\n\nFrequency and time-domain modelling of magnetic loop sources and magnetic\nreceivers.\n\nReproducing Figures 2.2-2.5, 4.2-4.5, and 4.7-4.8 of Ward and Hohmann (1988):\nFrequency- and time-domain isotropic solutions for a full-space (2.2-2.5) and a\nhalf-space (4.2-4.5, 4.7-4.8), where source and receiver are at the interface.\nSource is a loop, receiver is a magnetic dipole.\n\n**Reference**\n\n- **Ward, S. H., and G. W. Hohmann, 1988**, Electromagnetic theory for\n geophysical applications, Chapter 4 of Electromagnetic Methods in Applied\n Geophysics: SEG, Investigations in Geophysics No. 3, 130--311; DOI:\n [10.1190/1.9781560802631.ch4](https://doi.org/10.1190/1.9781560802631.ch4).\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"import empymod\nimport numpy as np\nfrom scipy.special import erf\nimport matplotlib.pyplot as plt\nfrom scipy.constants import mu_0"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Ward and Hohmann, 1988, Fig 4.4\n\nWard and Hohmann (1988), Equations 4.69a and 4.70:\n\n\\begin{align}h_z = \\frac{m}{4\\pi r^3} \\left[\n \\frac{9}{2\\theta^2 r^2} \\rm{erf}(\\theta r) - \\rm{erf}(\\theta r) -\n \\frac{1}{\\pi^{1/2}} \\left(\\frac{9}{\\theta r} + 4\\theta r\\right)\n \\exp(-\\theta^2 r^2) \\right] \\, , \\qquad (4.69\\rm{a})\\end{align}\n\nand\n\n\\begin{align}\\frac{\\partial h_z}{\\partial t} = -\\frac{m\\rho}{2\\pi\\mu_0 r^5} \\left[\n 9\\rm{erf}(\\theta r) -\n \\frac{2\\theta r}{\\pi^{1/2}} \\left(9 + 6\\theta^2 r^2 +\n 4\\theta^4 r^4\\right) \\exp(-\\theta^2 r^2) \\right] \\, , \\qquad (4.70)\\end{align}\n\nwhere\n\n\\begin{align}\\theta = \\sqrt{\\frac{\\mu_0}{4t\\rho}} \\, ,\\end{align}\n\n$t$ is time in s, $\\rho$ is resistivity in\n$\\Omega\\,\\text{m}$, $r$ is offset in m, and $m$ the\nmagnetic moment in $\\text{A}\\,\\text{m}^2$ .\n\n### Analytical solutions\n\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"def hz(t, res, r, m=1.):\n r\"\"\"Return equation 4.69a, Ward and Hohmann, 1988.\n\n Switch-off response (i.e., Hz(t)) of a homogeneous isotropic half-space,\n where the vertical magnetic source and receiver are at the interface.\n\n Parameters\n ----------\n t : array\n Times (t)\n res : float\n Halfspace resistivity (Ohm.m)\n r : float\n Offset (m)\n m : float, optional\n Magnetic moment, default is 1.\n\n Returns\n -------\n hz : array\n Vertical magnetic field (A/m)\n\n \"\"\"\n theta = np.sqrt(mu_0/(4*res*t))\n theta_r = theta*r\n\n s = 9/(2*theta_r**2)*erf(theta_r) - erf(theta_r)\n s -= (9/theta_r+4*theta_r)*np.exp(-theta_r**2)/np.sqrt(np.pi)\n s *= m/(4*np.pi*r**3)\n\n return s"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"def dhzdt(t, res, r, m=1.):\n r\"\"\"Return equation 4.70, Ward and Hohmann, 1988.\n\n Impulse response (i.e., dHz(t)/dt) of a homogeneous isotropic half-space,\n where the vertical magnetic source and receiver are at the interface.\n\n Parameters\n ----------\n t : array\n Times (t)\n res : float\n Halfspace resistivity (Ohm.m)\n r : float\n Offset (m)\n m : float, optional\n Magnetic moment, default is 1.\n\n Returns\n -------\n dhz : array\n Time-derivative of the vertical magnetic field (A/m/s)\n\n \"\"\"\n theta = np.sqrt(mu_0/(4*res*t))\n theta_r = theta*r\n\n s = (9 + 6 * theta_r**2 + 4 * theta_r**4) * np.exp(-theta_r**2)\n s *= -2 * theta_r / np.sqrt(np.pi)\n s += 9 * erf(theta_r)\n s *= -(m*res)/(2*np.pi*mu_0*r**5)\n\n return s"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Survey parameters\n\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"time = np.logspace(-8, 0, 301)\n\nsrc = [0, 0, 0, 0, 90]\nrec = [100, 0, 0, 0, 90]\ndepth = 0\nres = [2e14, 100]"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Analytical result\n\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"hz_ana = hz(time, res[1], rec[0])\ndhz_ana = dhzdt(time, res[1], rec[0])"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Numerical result\n\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"eperm = [0, 0] # Reduce early time numerical noise (diffusive approx for air)\ninp = {'src': src, 'rec': rec, 'depth': depth, 'res': res,\n 'freqtime': time, 'verb': 1, 'xdirect': True, 'epermH': eperm}\n\nhz_num = empymod.loop(signal=-1, **inp)\ndhz_num = empymod.loop(signal=0, **inp)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Plot the result\n\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"def pos(data):\n \"\"\"Return positive data; set negative data to NaN.\"\"\"\n return np.where(data > 0, data, np.nan)\n\n\nplt.figure(figsize=(5, 6))\n\nplt.plot(time*1e3, pos(dhz_ana), 'k-', lw=2, label='Ward & Hohmann')\nplt.plot(time*1e3, pos(-dhz_ana), 'k--', lw=2)\nplt.plot(time*1e3, pos(dhz_num), 'C1-', label='empymod; dHz/dt')\nplt.plot(time*1e3, pos(-dhz_num), 'C1--')\n\nplt.plot(time*1e3, pos(hz_ana), 'k-', lw=2)\nplt.plot(time*1e3, pos(-hz_ana), 'k--', lw=2)\nplt.plot(time*1e3, pos(hz_num), 'C0-', label='empymod; Hz')\nplt.plot(time*1e3, pos(-hz_num), 'C0--')\n\nplt.xscale('log')\nplt.yscale('log')\nplt.xlim([1e-5, 1e3])\nplt.yticks(10**np.arange(-11., 0))\nplt.ylim([1e-11, 1e-1])\nplt.xlabel('time (ms)')\nplt.legend()\n\nplt.show()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Original Figure\n\n\n\nNote that $h_z$ has the opposite sign in the original figure, which is\nprobably a typo (it is not what their equation yields).\n\n\nThe following examples are just compared to the figures, without the provided\nanalytical solutions.\n\n## Ward and Hohmann, 1988, Fig 4.2\n\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"# Survey parameters\nfreq = np.logspace(-1, 5, 301)\nsrc = [0, 0, 0, 0, 90]\nrec = [100, 0, 0, 0, 90]\ndepth = 0\nres = [2e14, 100]\n\n# Computation\ninp = {'src': src, 'rec': rec, 'depth': depth, 'res': res,\n 'freqtime': freq, 'verb': 1}\nfhz_num = empymod.loop(**inp)\n\n# Figure\nplt.figure(figsize=(5, 5))\n\nplt.plot(freq, pos(fhz_num.real), 'C0-', label='Real')\nplt.plot(freq, pos(-fhz_num.real), 'C0--')\n\nplt.plot(freq, pos(fhz_num.imag), 'C1-', label='Imaginary')\nplt.plot(freq, pos(-fhz_num.imag), 'C1--')\n\nplt.xscale('log')\nplt.yscale('log')\nplt.xlim([1e-1, 1e5])\nplt.ylim([1e-12, 1e-6])\nplt.xlabel('FREQUENCY (Hz)')\nplt.ylabel('$H_z$ (A/m)')\nplt.legend()\n\nplt.tight_layout()\n\nplt.show()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Original Figure\n\n\n\n## Ward and Hohmann, 1988, Fig 4.3\n\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"# Survey parameters\nfreq = np.logspace(-1, 5, 301)\nsrc = [0, 0, 0, 0, 90]\nrec = [100, 0, 0, 0, 0]\ndepth = 0\nres = [2e14, 100]\n\n# Computation\ninp = {'src': src, 'rec': rec, 'depth': depth, 'res': res,\n 'freqtime': freq, 'verb': 1}\nfhz_num = empymod.loop(**inp)\n\n# Figure\nplt.figure(figsize=(5, 5))\n\nplt.plot(freq, pos(fhz_num.real), 'C0-', label='Real')\nplt.plot(freq, pos(-fhz_num.real), 'C0--')\n\nplt.plot(freq, pos(fhz_num.imag), 'C1-', label='Imaginary')\nplt.plot(freq, pos(-fhz_num.imag), 'C1--')\n\nplt.xscale('log')\nplt.yscale('log')\nplt.xlim([1e-1, 1e5])\nplt.ylim([1e-12, 1e-6])\nplt.xlabel('FREQUENCY (Hz)')\nplt.ylabel(r'$H_{\\rho}$ (A/m)')\nplt.legend()\n\nplt.tight_layout()\n\nplt.show()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Original Figure\n\n\n## Ward and Hohmann, 1988, Fig 4.5\n\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"# Survey parameters\ntime = np.logspace(-6, 0.5, 301)\nsrc = [0, 0, 0, 0, 90]\nrec = [100, 0, 0, 0, 0]\ndepth = 0\nres = [2e14, 100]\n\n# Computation\ninp = {'src': src, 'rec': rec, 'depth': depth, 'res': res,\n 'epermH': eperm, 'freqtime': time, 'verb': 1}\nfhz_num = empymod.loop(signal=1, **inp)\nfdhz_num = empymod.loop(signal=0, **inp)\n\n# Figure\nplt.figure(figsize=(5, 6))\n\nax1 = plt.subplot(111)\nplt.plot(time*1e3, pos(fdhz_num), 'C0-', label='dHz/dt')\nplt.plot(time*1e3, pos(-fdhz_num), 'C0--')\n\nplt.xscale('log')\nplt.yscale('log')\nplt.xlim([1e-3, 2e3])\nplt.yticks(10**np.arange(-11., -1))\nplt.ylim([1e-11, 1e-1])\nplt.xlabel('time (ms)')\nplt.ylabel(r'$\\frac{\\partial h_{\\rho}}{\\partial t}$ (A/m-s)')\nplt.legend(loc=8)\n\nax2 = ax1.twinx()\n\nplt.plot(time*1e3, pos(fhz_num), 'C1-', label='Hz')\nplt.plot(time*1e3, pos(-fhz_num), 'C1--')\n\nplt.xscale('log')\nplt.yscale('log')\nplt.xlim([1e-3, 2e3])\nplt.yticks(10**np.arange(-16., -7))\nplt.ylim([1e-17, 1e-7])\nplt.ylabel(r'$h_{\\rho}$ (A/m)')\nplt.legend(loc=5)\n\nplt.tight_layout()\nplt.show()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Original Figure\n\n\n\n## Ward and Hohmann, 1988, Fig 4.7\n\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"# Survey parameters\nradius = 50\narea = radius**2*np.pi\nfreq = np.logspace(-1, np.log10(250000), 301)\nsrc = [radius, 0, 0, 90, 0]\nrec = [0, 0, 0, 0, 90]\ndepth = 0\nres = [2e14, 100]\nstrength = area/(radius/2)\nmrec = True\n\n# Computation\ninp = {'src': src, 'rec': rec, 'depth': depth, 'res': res,\n 'freqtime': freq, 'strength': strength, 'mrec': mrec,\n 'verb': 1}\nfhz_num = empymod.bipole(**inp)\n\n# Figure\nplt.figure(figsize=(5, 5))\n\nplt.plot(freq, pos(fhz_num.real), 'C0-', label='Real')\nplt.plot(freq, pos(-fhz_num.real), 'C0--')\n\nplt.plot(freq, pos(fhz_num.imag), 'C1-', label='Imaginary')\nplt.plot(freq, pos(-fhz_num.imag), 'C1--')\n\nplt.xscale('log')\nplt.yscale('log')\nplt.xlim([1e-1, 1e6])\nplt.ylim([1e-8, 1e-1])\nplt.xlabel('frequency (Hz)')\nplt.ylabel('$H_z$ (A/m)')\nplt.legend()\n\nplt.tight_layout()\n\nplt.show()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Original Figure\n\n\n\n## Ward and Hohmann, 1988, Fig 4.8\n\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"# Survey parameters\nradius = 50\narea = radius**2*np.pi\ntime = np.logspace(-7, -1, 301)\nsrc = [radius, 0, 0, 90, 0]\nrec = [0, 0, 0, 0, 90]\ndepth = 0\nres = [2e14, 100]\nstrength = area/(radius/2)\nmrec = True\n\n# Computation\ninp = {'src': src, 'rec': rec, 'depth': depth, 'res': res,\n 'freqtime': time, 'strength': strength, 'mrec': mrec,\n 'epermH': eperm, 'verb': 1}\n\nfhz_num = empymod.bipole(signal=-1, **inp)\nfdhz_num = empymod.bipole(signal=0, **inp)\n\n# Figure\nplt.figure(figsize=(4, 6))\n\nax1 = plt.subplot(111)\nplt.plot(time*1e3, pos(fdhz_num), 'C0-', label=r'dhz/dt (A/m-s)')\nplt.plot(time*1e3, pos(-fdhz_num), 'C0--')\n\nplt.plot(time*1e3, pos(fhz_num), 'C1-', label='hz (A/m)')\nplt.plot(time*1e3, pos(-fhz_num), 'C1--')\n\nplt.xscale('log')\nplt.yscale('log')\nplt.xlim([1e-4, 1e2])\nplt.yticks(10**np.arange(-7., 4))\nplt.ylim([1e-7, 5e3])\n\nplt.xlabel('time (ms)')\nplt.legend()\n\nplt.tight_layout()\nplt.show()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Original Figure\n\n\n\n## Ward and Hohmann, 1988, Fig 2.2\n\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"# Survey parameters\nfreq = np.logspace(-2, 5, 301)\nsrc = [0, 0, 0, 0, 0]\nrec = [0, 100, 0, 0, 0]\ndepth = []\nres = 100\n\n# Computation\ninp = {'src': src, 'rec': rec, 'depth': depth, 'res': res,\n 'freqtime': freq, 'verb': 1}\nfhz_num = empymod.loop(**inp)\n\n# Figure\nplt.figure(figsize=(5, 5))\n\nplt.plot(freq, pos(fhz_num.real), 'C0-', label='Real')\nplt.plot(freq, pos(-fhz_num.real), 'C0--')\n\nplt.plot(freq, pos(fhz_num.imag), 'C1-', label='Imaginary')\nplt.plot(freq, pos(-fhz_num.imag), 'C1--')\n\nplt.xscale('log')\nplt.yscale('log')\nplt.xlim([1e-2, 1e5])\nplt.ylim([1e-13, 1e-6])\nplt.xlabel('frequency (Hz)')\nplt.ylabel('$H_z$ (A/m)')\nplt.legend()\n\nplt.tight_layout()\n\nplt.show()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Original Figure\n\n\n\n## Ward and Hohmann, 1988, Fig 2.3\n\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"# Survey parameters\nfreq = np.logspace(-2, 5, 301)\nsrc = [0, 0, 0, 0, 0]\nrec = [100, 0, 0, 0, 0]\ndepth = []\nres = 100\n\n# Computation\ninp = {'src': src, 'rec': rec, 'depth': depth, 'res': res,\n 'freqtime': freq, 'verb': 1}\nfhz_num = empymod.loop(**inp)\n\n# Figure\nplt.figure(figsize=(5, 5))\n\nplt.plot(freq, pos(fhz_num.real), 'C0-', label='Real')\nplt.plot(freq, pos(-fhz_num.real), 'C0--')\n\nplt.plot(freq, pos(fhz_num.imag), 'C1-', label='Imaginary')\nplt.plot(freq, pos(-fhz_num.imag), 'C1--')\n\nplt.xscale('log')\nplt.yscale('log')\nplt.xlim([1e-2, 1e5])\nplt.ylim([1e-13, 1e-6])\nplt.xlabel('Frequency (Hz)')\nplt.ylabel(r'$H_{\\rho}$ (A/m)')\nplt.legend()\n\nplt.tight_layout()\nplt.show()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Original Figure\n\n\n\n## Ward and Hohmann, 1988, Fig 2.4\n\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"# Survey parameters\ntime = np.logspace(-7, 0, 301)\nsrc = [0, 0, 0, 0, 0]\nrec = [0, 100, 0, 0, 0]\ndepth = []\nres = 100\n\n# Computation\ninp = {'src': src, 'rec': rec, 'depth': depth, 'res': res,\n 'xdirect': True, 'freqtime': time, 'verb': 1}\nfhz_num = empymod.loop(signal=1, **inp)\nfdhz_num = empymod.loop(signal=0, **inp)\n\n# Figure\nplt.figure(figsize=(5, 5))\n\nax1 = plt.subplot(111)\n\nplt.plot(time*1e3, pos(fdhz_num), 'C0-', label='dHz/dt')\nplt.plot(time*1e3, pos(-fdhz_num), 'C0--')\n\nplt.xscale('log')\nplt.yscale('log')\nplt.xlim([1e-4, 1e3])\nplt.yticks(10**np.arange(-12., -1))\nplt.ylim([1e-12, 1e-2])\nplt.xlabel('time (ms)')\nplt.ylabel(r'$\\frac{\\partial h_{\\rho}}{\\partial t}$ (A/m-s)')\nplt.legend(loc=8)\n\nax2 = ax1.twinx()\n\nplt.plot(time*1e3, pos(fhz_num), 'C1-', label='Hz')\nplt.plot(time*1e3, pos(-fhz_num), 'C1--')\n\nplt.xscale('log')\nplt.yscale('log')\nplt.xlim([1e-4, 1e3])\nplt.yticks(10**np.arange(-14., -3))\nplt.ylim([1e-14, 1e-4])\nplt.ylabel(r'$h_{\\rho}$ (A/m)')\nplt.legend(loc=5)\n\nplt.tight_layout()\nplt.show()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Original Figure\n\n\n\n## Ward and Hohmann, 1988, Fig 2.5\n\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"# Survey parameters\ntime = np.logspace(-7, 0, 301)\nsrc = [0, 0, 0, 0, 0]\nrec = [100, 0, 0, 0, 0]\ndepth = []\nres = 100\n\n# Computation\ninp = {'src': src, 'rec': rec, 'depth': depth, 'res': res,\n 'xdirect': True, 'freqtime': time, 'verb': 1}\nfhz_num = empymod.loop(signal=1, **inp)\nfdhz_num = empymod.loop(signal=0, **inp)\n\n# Figure\nplt.figure(figsize=(5, 5))\n\nax1 = plt.subplot(111)\n\nplt.plot(time*1e3, pos(fdhz_num), 'C0-', label='dHz/dt')\nplt.plot(time*1e3, pos(-fdhz_num), 'C0--')\n\nplt.xscale('log')\nplt.yscale('log')\nplt.xlim([1e-4, 1e3])\nplt.yticks(10**np.arange(-12., -1))\nplt.ylim([1e-12, 1e-2])\nplt.xlabel('time (ms)')\nplt.ylabel(r'$\\frac{\\partial h_{\\rho}}{\\partial t}$ (A/m-s)')\nplt.legend(loc=8)\n\nax2 = ax1.twinx()\n\nplt.plot(time*1e3, pos(fhz_num), 'C1-', label='Hz')\nplt.plot(time*1e3, pos(-fhz_num), 'C1--')\n\nplt.xscale('log')\nplt.yscale('log')\nplt.xlim([1e-4, 1e3])\nplt.yticks(10**np.arange(-16., -5))\nplt.ylim([1e-16, 1e-6])\nplt.ylabel(r'$h_{\\rho}$ (A/m)')\nplt.legend(loc=5)\n\nplt.tight_layout()\nplt.show()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Original Figure\n\n\n\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"empymod.Report()"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.6"
}
},
"nbformat": 4,
"nbformat_minor": 0
}PK WaX#H ziolkowski2007.ipynbPK RaXr7l l hunziker2015.ipynbPK MaẌ́b b M! constable2006.ipynbPK VaXrL L 5 ward1988.ipynbPK