.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "gallery/fdomain/src_rec_comparison.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_fdomain_src_rec_comparison.py: Comparison of all source-receiver combinations ============================================== Comparison of all source-receiver combinations; both electric and magnetic. We compute the secondary field for a simple model of a 1 Ωm halfspace below air. The source is 50 m above the surface in the air, receivers are on the surface, frequency is 1 Hz. .. GENERATED FROM PYTHON SOURCE LINES 12-17 .. code-block:: Python import empymod import numpy as np import matplotlib.pyplot as plt plt.style.use('ggplot') .. GENERATED FROM PYTHON SOURCE LINES 18-20 Define Model ------------ .. GENERATED FROM PYTHON SOURCE LINES 20-35 .. code-block:: Python x = np.linspace(-10, 10, 101)*1000 rx = np.tile(x[:, None], x.size) ry = rx.transpose() inp = { 'src': [0, 0, -50], 'rec': [rx.ravel(), ry.ravel(), 0], 'depth': 0, 'res': [2e14, 1], 'freqtime': 1, 'xdirect': None, # Secondary field comp., req. empymod >= v1.6.1. 'htarg': {'pts_per_dec': -1}, # To speed-up the computation 'verb': 0, } .. GENERATED FROM PYTHON SOURCE LINES 36-38 Compute ------- .. GENERATED FROM PYTHON SOURCE LINES 38-48 .. code-block:: Python # All possible combinations pab = (np.arange(60)+11).reshape(6, 10)[:, :6].ravel() print(pab) # Compute and store them in fs fs = dict() for ab in pab: fs[str(ab)] = empymod.dipole(ab=ab, **inp).reshape(rx.shape).amp() .. rst-class:: sphx-glr-script-out .. code-block:: none [11 12 13 14 15 16 21 22 23 24 25 26 31 32 33 34 35 36 41 42 43 44 45 46 51 52 53 54 55 56 61 62 63 64 65 66] .. GENERATED FROM PYTHON SOURCE LINES 49-51 Plot ---- .. GENERATED FROM PYTHON SOURCE LINES 51-111 .. code-block:: Python fig, axs = plt.subplots(6, 6, figsize=(10, 11.5), constrained_layout=True) axs = axs.ravel() fig.suptitle('Comparison of all source-receiver combinations, electric ' + 'and magnetic', fontsize=16) # Labels label1 = ['ˣ', 'ʸ', 'ᶻ'] label2 = ['E', 'H'] # Colour settings vmin = 1e-14 vmax = 1e-0 props = {'levels': np.logspace(np.log10(vmin), np.log10(vmax), 50), 'locator': plt.matplotlib.ticker.LogLocator()} # Loop over combinations for i, val in enumerate(pab): ax = axs[i] # Axis settings ax.set_xlim(min(x)/1000, max(x)/1000) ax.set_ylim(min(x)/1000, max(x)/1000) ax.axis('equal') # Plot the contour cf = ax.contourf(rx/1000, ry/1000, fs[str(val)].clip(vmin, vmax), **props) # Add titels if i < 6: label = 'Src: ' label += label2[0] if i < 3 else label2[1] label += label1[i % 3] ax.xaxis.set_label_position("top") ax.set_xlabel(label, fontsize=12) if i % 6 == 5: label = 'Rec: ' label += label2[0] if i < 18 else label2[1] label += label1[(i // 6) % 3] ax.yaxis.set_label_position("right") ax.set_ylabel(label, fontsize=12) # Remove unnecessary tick labels if i < 30: ax.set_xticks([-10, 0, 10], ()) if i % 6 != 0: ax.set_yticks([-10, 0, 10], ()) # Add offset labels if i == 32: ax.set_xlabel('X-Offset (km)', fontsize=14) elif i == 18: ax.set_ylabel('y-Offset (km)', fontsize=14) # Colour bar cb = plt.colorbar( cf, ax=axs, orientation='horizontal', ticks=np.logspace(np.log10(vmin), np.log10(vmax), 8)) cb.set_label('Amplitude in V/m (electric receiver) or T (magnetic receiver)') .. image-sg:: /gallery/fdomain/images/sphx_glr_src_rec_comparison_001.png :alt: Comparison of all source-receiver combinations, electric and magnetic :srcset: /gallery/fdomain/images/sphx_glr_src_rec_comparison_001.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 112-113 .. code-block:: Python empymod.Report() .. raw:: html
Sat Jan 17 19:14:55 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 2.112 seconds) **Estimated memory usage:** 215 MB .. _sphx_glr_download_gallery_fdomain_src_rec_comparison.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: src_rec_comparison.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: src_rec_comparison.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: src_rec_comparison.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_