.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "gallery/reproducing/hunziker2015.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr_gallery_reproducing_hunziker2015.py: Hunziker et al., 2015, Geophysics ================================= Reproducing Figure 3 of the manual from ``EMmod``. This example does, as such, not actually reproduce a figure of Hunziker et al., 2015, but of the manual that comes with the software accompanying the paper. With the software comes an example input file named ``simplemod.scr``, and the corresponding result is shown in the manual of the code in Figure 3. If you are interested in reproducing the figures of the actual paper, have a look at the notebooks in the repo `article-geo2017 `_. **Reference** - **Hunziker, J., J. Thorbecke, and E. Slob, 2015**, The electromagnetic response in a layered vertical transverse isotropic medium: A new look at an old problem: Geophysics, 80(1), F1–F18; DOI: `10.1190/geo2013-0411.1 `_; Software: `wiki.seg.org/wiki/Software:emmod `_. .. GENERATED FROM PYTHON SOURCE LINES 25-29 .. code-block:: Python import empymod import numpy as np import matplotlib.pyplot as plt .. GENERATED FROM PYTHON SOURCE LINES 30-34 Compute the data ---------------- Compute the electric field with the parameters defined in ``simplemod.scr``. .. GENERATED FROM PYTHON SOURCE LINES 34-59 .. code-block:: Python # x- and y-offsets x = np.arange(4000)*7 - 1999.5*7 y = np.arange(1500)*10 - 749.5*10 # Create 2D arrays of them rx = np.tile(x[:, None], y.size).T ry = np.tile(y[:, None], x.size) # Compute the electric field efield = empymod.dipole( src=[0, 0, -150], rec=[rx.ravel(), ry.ravel(), -200], depth=[0, -200, -1000, -1200], res=[2e14, 1/3, 1, 50, 1], aniso=[1, 1, np.sqrt(10), 1, 1], freqtime=0.5, epermH=[1, 80, 17, 2.1, 17], epermV=[1, 80, 17, 2.1, 17], mpermH=[1, 1, 1, 1, 1], mpermV=[1, 1, 1, 1, 1], ab=11, htarg={'pts_per_dec': -1}, ).reshape(rx.shape) .. rst-class:: sphx-glr-script-out .. code-block:: none :: empymod END; runtime = 0:00:01.532950 :: 1 kernel call(s) .. GENERATED FROM PYTHON SOURCE LINES 60-62 Plot ---- .. GENERATED FROM PYTHON SOURCE LINES 62-93 .. code-block:: Python # Create a similar colormap as Hunziker et al., 2015. cmap = plt.get_cmap("jet", 61) fig, (ax1, ax2) = plt.subplots( 2, 1, figsize=(8, 7), sharex=True, constrained_layout=True) # 1. Amplitude ax1.set_title('Amplitude (V/m)') cf1 = ax1.pcolormesh( x/1e3, y/1e3, np.log10(efield.amp()), cmap=cmap, vmin=-16, vmax=-7, shading='nearest', ) plt.colorbar(cf1, ticks=np.array([-16, -14, -12, -10, -8])) # 2. Phase ax2.set_title('Phase (°)') ax2.set_xlabel('Offset (km)') cf2 = ax2.pcolormesh( x/1e3, y/1e3, efield.pha(deg=False, unwrap=False, lag=True), cmap=cmap, vmin=-np.pi, vmax=np.pi, shading='nearest', ) plt.colorbar(cf2, ticks=np.array([-2, 0, 2])) for ax in [ax1, ax2]: ax.axis('equal') ax.set_ylim([y.max(), y.min()]) ax.set_yticks([5, 0, -5]) ax.set_ylabel('Offset (km)') .. image-sg:: /gallery/reproducing/images/sphx_glr_hunziker2015_001.png :alt: Amplitude (V/m), Phase (°) :srcset: /gallery/reproducing/images/sphx_glr_hunziker2015_001.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 94-100 Original Figure --------------- Figure 3 of the manual of `EMmod`. .. image:: ../../_static/figures/Hunziker2015.png .. GENERATED FROM PYTHON SOURCE LINES 102-103 .. code-block:: Python empymod.Report() .. raw:: html
Sat Jan 17 19:16:37 2026 UTC
OS Linux (Ubuntu 22.04) CPU(s) 2 Machine x86_64
Architecture 64bit RAM 7.6 GiB Environment Python
File system ext4
Python 3.11.12 (main, May 6 2025, 10:45:53) [GCC 11.4.0]
numpy 2.3.5 scipy 1.17.0 numba 0.63.1
empymod 2.5.4.dev4+g4866dc83a libdlf 0.3.0 IPython 9.9.0
matplotlib 3.10.8


.. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 6.080 seconds) **Estimated memory usage:** 926 MB .. _sphx_glr_download_gallery_reproducing_hunziker2015.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: hunziker2015.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: hunziker2015.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: hunziker2015.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_