.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "gallery/fdomain/full_vs_diffusive.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note Click :ref:`here ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_gallery_fdomain_full_vs_diffusive.py: Full wavefield vs diffusive approx. for a fullspace =================================================== Play around to see that the difference is getting bigger for - higher frequencies, - higher eperm/mperm. .. GENERATED FROM PYTHON SOURCE LINES 11-16 .. code-block:: default import empymod import numpy as np import matplotlib.pyplot as plt plt.style.use('ggplot') .. GENERATED FROM PYTHON SOURCE LINES 17-19 Define model ------------ .. GENERATED FROM PYTHON SOURCE LINES 19-42 .. code-block:: default x = (np.arange(526))*20-500 rx = np.repeat([x, ], np.size(x), axis=0) ry = rx.transpose() zsrc = 150 zrec = 200 res = 1/3 freq = 0.5 ab = 11 aniso = np.sqrt(3/.3) perm = 1 inp = { 'src': [0, 0, zsrc], 'rec': [rx.ravel(), ry.ravel(), zrec], 'res': res, 'freqtime': freq, 'aniso': aniso, 'ab': ab, 'epermH': perm, 'mpermH': perm, 'verb': 0 } .. GENERATED FROM PYTHON SOURCE LINES 43-45 Computation ----------- .. GENERATED FROM PYTHON SOURCE LINES 45-59 .. code-block:: default # Halfspace hs = empymod.analytical(**inp, solution='dfs') hs = hs.reshape(np.shape(rx)) # Fullspace fs = empymod.analytical(**inp) fs = fs.reshape(np.shape(rx)) # Relative error (%) amperr = np.abs((fs.amp() - hs.amp())/fs.amp())*100 phaerr = np.abs((fs.pha(unwrap=False) - hs.pha(unwrap=False)) / fs.pha(unwrap=False))*100 .. GENERATED FROM PYTHON SOURCE LINES 60-62 Plot ---- .. GENERATED FROM PYTHON SOURCE LINES 62-103 .. code-block:: default fig, axs = plt.subplots(figsize=(10, 4.2), nrows=1, ncols=2) # Min and max, properties vmin = 1e-10 vmax = 1e0 props = {'levels': np.logspace(np.log10(vmin), np.log10(vmax), 50), 'locator': plt.matplotlib.ticker.LogLocator(), 'cmap': 'Greys'} # Plot amplitude error plt.sca(axs[0]) plt.title(r'(a) Amplitude') cf1 = plt.contourf(rx/1000, ry/1000, amperr.clip(vmin, vmax), **props) plt.ylabel('Crossline offset (km)') plt.xlabel('Inline offset (km)') plt.xlim(min(x)/1000, max(x)/1000) plt.ylim(min(x)/1000, max(x)/1000) plt.axis('equal') # Plot phase error plt.sca(axs[1]) plt.title(r'(b) Phase') cf2 = plt.contourf(rx/1000, ry/1000, phaerr.clip(vmin, vmax), **props) plt.xlabel('Inline offset (km)') plt.xlim(min(x)/1000, max(x)/1000) plt.ylim(min(x)/1000, max(x)/1000) plt.axis('equal') # Title plt.suptitle('Analytical fullspace solution\nDifference between full ' + 'wavefield and diffusive approximation.', y=1.1) # Plot colorbar cax, kw = plt.matplotlib.colorbar.make_axes( [axs[0], axs[1]], location='right', fraction=.05, pad=0.05, aspect=20) cb = plt.colorbar(cf2, cax=cax, ticks=10**(-(np.arange(13.)[::-1])+2), **kw) cb.set_label(r'Relative Error $(\%)$') # Show plt.show() .. image-sg:: /gallery/fdomain/images/sphx_glr_full_vs_diffusive_001.png :alt: Analytical fullspace solution Difference between full wavefield and diffusive approximation., (a) Amplitude, (b) Phase :srcset: /gallery/fdomain/images/sphx_glr_full_vs_diffusive_001.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 104-106 .. code-block:: default empymod.Report() .. raw:: html
Sat Oct 15 19:18:40 2022 UTC
OS Linux CPU(s) 2 Machine x86_64
Architecture 64bit RAM 7.6 GiB Environment Python
File system ext4
Python 3.8.6 (default, Oct 19 2020, 15:10:29) [GCC 7.5.0]
numpy 1.23.4 scipy 1.9.2 numba 0.56.3
empymod 2.2.1 IPython 8.5.0 matplotlib 3.6.1


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