.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "glr_examples/view/plot_phase_sensistive_skew.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 or to run this example in your browser via Binder .. rst-class:: sphx-glr-example-title .. _sphx_glr_glr_examples_view_plot_phase_sensistive_skew.py: ================================================= Plot Skew 1D/2D ================================================= Phase-sensitive skew visualization in one-dimensional and two dimensional. .. GENERATED FROM PYTHON SOURCE LINES 10-13 .. code-block:: Python # Author: L.Kouadio # Licence: BSD-3-clause .. GENERATED FROM PYTHON SOURCE LINES 14-41 'Skew' is also known as the conventional asymmetry parameter based on the Z magnitude. Mosly, the :term:`EM` signal is influenced by several factors such as the dimensionality of the propagation medium and the physical anomalies, which can distort the EM field both locally and regionally. The distortion of Z was determined from the quantification of its asymmetry and the deviation from the conditions that define its dimensionality. The parameters used for this purpose are all rotational invariant because the Z components involved in its definition are independent of the orientation system used. The conventional asymmetry parameter based on the Z magnitude is the skew defined by Swift (1967) [1]_ and Bahr (1991) [2]_. - ``swift`` for the removal of distorsion proposed by Swift in 1967. if the value close to 0., it assumes the 1D and 2D structures, and 3D otherwise. - ``bahr`` for the removal of distorsion proposed by Bahr in 1991. The threshold is set to 0.3 and above this value the structures are 3D. However, Values of :math:`\eta` > 0.3 are considered to represent 3D data. Phase-sensitive skews less than 0.1 indicate 1D, 2D, or distorted 2D (3-D /2-D) cases. Values of :math:`mu` between 0.1 and 0.3 indicate modified 3D/2D structures. Here is an example of implementation using the :class:`watex.view.TPlot` class of module :mod:`watex.view`. we start by importing ``watex`` as: .. GENERATED FROM PYTHON SOURCE LINES 41-48 .. code-block:: Python import numpy as np import watex as wx from watex.methods import EMAP from watex.view import TPlot, plot2d .. GENERATED FROM PYTHON SOURCE LINES 49-50 * `Swift method` .. GENERATED FROM PYTHON SOURCE LINES 50-55 .. code-block:: Python test_data = wx.fetch_data ('edis', samples =37, return_data =True ) tplot = TPlot(fig_size =(11, 5), marker ='x').fit(test_data) tplot.plt_style='classic' tplot.plotSkew(method ='swift', threshold_line=True) .. image-sg:: /glr_examples/view/images/sphx_glr_plot_phase_sensistive_skew_001.png :alt: plot phase sensistive skew :srcset: /glr_examples/view/images/sphx_glr_plot_phase_sensistive_skew_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none <'TPlot':survey_area=None, distance=50.0, prefix='S', window_size=5, component='xy', mode='same', method='slinear', out='srho', how='py', c=2> .. GENERATED FROM PYTHON SOURCE LINES 56-59 For any specific reasons, the user can check the influence of the existing outliers in the data. This is possible by turning off the parameter ``suppress_outliers`` to ``False`` like .. GENERATED FROM PYTHON SOURCE LINES 59-61 .. code-block:: Python tplot.plotSkew(method ='swift', threshold_line=True, suppress_outliers=False ) .. image-sg:: /glr_examples/view/images/sphx_glr_plot_phase_sensistive_skew_002.png :alt: plot phase sensistive skew :srcset: /glr_examples/view/images/sphx_glr_plot_phase_sensistive_skew_002.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none <'TPlot':survey_area=None, distance=50.0, prefix='S', window_size=5, component='xy', mode='same', method='slinear', out='srho', how='py', c=2> .. GENERATED FROM PYTHON SOURCE LINES 62-64 * `Bahr method (default)` .. GENERATED FROM PYTHON SOURCE LINES 64-67 .. code-block:: Python tplot.plotSkew(threshold_line=True, suppress_outliers=False ) .. image-sg:: /glr_examples/view/images/sphx_glr_plot_phase_sensistive_skew_003.png :alt: plot phase sensistive skew :srcset: /glr_examples/view/images/sphx_glr_plot_phase_sensistive_skew_003.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none <'TPlot':survey_area=None, distance=50.0, prefix='S', window_size=5, component='xy', mode='same', method='slinear', out='srho', how='py', c=2> .. GENERATED FROM PYTHON SOURCE LINES 68-75 * Plot skew in two-dimensional It is possible to visualize the skew into two-dimensional by computing the skew value from :class:`~watex.methods.Processing` class and call the boilerplate plot2d function :func:`~watex.view.plot2d` for visualization. In addition, setting the `return_skewness` parameter to ``skew`` returns only the skew value. The default behavior returns both the skew and the rotation all of invariant :math:`\eta`. .. GENERATED FROM PYTHON SOURCE LINES 75-88 .. code-block:: Python skv = EMAP ().fit(test_data).skew(return_skewness='skew') # to return only skew value, plot2d (skv, y = np.log10 (tplot.p_.freqs_ ), distance =50., # distance between stations top_label='Stations', show_grid =True, fig_size = ( 11, 5 ), cmap = 'bwr', font_size =7, ylabel ='Log10Frequency[$H_z$]', xlabel='Distance (m)', cb_label ='Skew: swift', ) .. image-sg:: /glr_examples/view/images/sphx_glr_plot_phase_sensistive_skew_004.png :alt: plot phase sensistive skew :srcset: /glr_examples/view/images/sphx_glr_plot_phase_sensistive_skew_004.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none .. GENERATED FROM PYTHON SOURCE LINES 89-95 As shown in Figure above, the value of skew is smaller than 0.4 at most sites, indicating a 2D structure. Only a few sites near the fault have a value of skew greater than 0.4, indicating an obvious 3D structure. Thus, the electricity model of the research area can be approximated to a 2D structure for inversion. In the next example, we will suppress the outliers in the data. .. GENERATED FROM PYTHON SOURCE LINES 95-107 .. code-block:: Python skv = EMAP ().fit(test_data).skew( return_skewness='skew', suppress_outliers = True) plot2d (skv, y = np.log10 (tplot.p_.freqs_ ), distance =50., show_grid =True, fig_size = ( 11, 5 ), cmap = 'bwr', font_size =7, ylabel ='Log10Frequency[$H_z$]', xlabel='Distance (m)', cb_label ='Skew: Swift', ) .. image-sg:: /glr_examples/view/images/sphx_glr_plot_phase_sensistive_skew_005.png :alt: plot phase sensistive skew :srcset: /glr_examples/view/images/sphx_glr_plot_phase_sensistive_skew_005.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none .. GENERATED FROM PYTHON SOURCE LINES 108-122 The figure above shows the 2D skewness when some outliers are suppressed. Here most of sites shown a skew less than 0.4 althrough the outliers are suppressed. Most of structures are 2D dimensional therefore the 2D inversion can be performed. The blank lines show the data points assumed to be outliers expressed by missing, noised data or weak signals. .. topic:: References .. [1] Swift, C., 1967. A magnetotelluric investigation of an electrical conductivity anomaly in the southwestern United States. Ph.D. Thesis, MIT Press. Cambridge. .. [2] Bahr, K., 1991. Geological noise in magnetotelluric data: a classification of distortion types. Physics of the Earth and Planetary Interiors 66 (1–2), 24–38. .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 3.848 seconds) .. _sphx_glr_download_glr_examples_view_plot_phase_sensistive_skew.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: binder-badge .. image:: images/binder_badge_logo.svg :target: https://mybinder.org/v2/gh/watex/watex/0.3.X?urlpath=lab/tree/notebooks/glr_examples/view/plot_phase_sensistive_skew.ipynb :alt: Launch binder :width: 150 px .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_phase_sensistive_skew.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_phase_sensistive_skew.py ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_