.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "glr_examples/applications/plot_nsamt_tensor_recovery.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_applications_plot_nsamt_tensor_recovery.py: ============================ NSAMT tensors recovery ============================ Recovers NSAMT tensors from sample of EDI files. .. GENERATED FROM PYTHON SOURCE LINES 8-11 .. code-block:: default # Author: L.Kouadio # Licence: BSD-3-clause .. GENERATED FROM PYTHON SOURCE LINES 12-19 Tensor recovery is necessary when dealing with NSAMT data. The code below is an example to recover the weak and missing frequency signal using .em processing methods. The tensor recovery and the data quality control are ensured by the methods :meth:`~watex.methods.Processing.zrestore` and :meth:`~watex.methods.Processing.qc` respectively. The :mod:`~watex.view.TPlot` module from .view is used for the visualization. For a demonstration, I collect twelve samples of EDI objects stored in the software as: .. GENERATED FROM PYTHON SOURCE LINES 19-25 .. code-block:: default from watex.datasets import load_edis from watex.methods import Processing from watex.view import TPlot edi_data = load_edis (return_data =True, samples =12 ) new_Z =Processing().fit(edi_data ).zrestore () .. GENERATED FROM PYTHON SOURCE LINES 26-34 The method :meth:`~watex.methods.Processing.exportedis` can be used to export the new tensor (new_Z) ready for modeling. In the example below (umcommented), I use raw non-preprocessed EDI data as ``raw_data`` that includes missing tensor and weak frequency signals. The complete case data history data can be available upon request. Thus the recovered resistivity tensor from randomly sites E12 and E27 can be visualized by feeding the “raw_data” to the fit method of :mod:`~watex.view.TPlot` as follow: .. GENERATED FROM PYTHON SOURCE LINES 34-36 .. code-block:: default # >>> TPlot().fit(<>).plot_multiple_recovery (sites =['E12', 'E27']) .. GENERATED FROM PYTHON SOURCE LINES 37-38 Refer to :doc:`EM method ` for the output .. GENERATED FROM PYTHON SOURCE LINES 40-43 After recovering the signal, the latter exhibits a field strength amplitude for the next processing step like filtering. A simple filtering like adaptative moving average (AMA) proposed by Torres-verdìn and Bostick, (1992) can be used by simply calling: .. GENERATED FROM PYTHON SOURCE LINES 43-47 .. code-block:: default edi_corrected =Processing (window_size =5, c =2 ).fit(edi_data ).ama () # where 'c' is a window-width expansion factor inputted to the filter adaptation process to control # the roll-off characteristics of the Hanning window (Torres-verdìn and Bostick, 1992). .. GENERATED FROM PYTHON SOURCE LINES 48-53 Note that, like all the :mod:`~watex.view` plotting classes, :class:`~watex.view.TPlot` inherits from a global abstract base class parameters :class:`~watex.utils.box.BasePlot`. Thus, each plot can flexibly be customized according to the user's desire. For instance, to visualize the corrected 2D tensors, one can customize its plot as: .. GENERATED FROM PYTHON SOURCE LINES 53-60 .. code-block:: default plot_kws = dict( ylabel = '$Log_{10}Frequency [Hz]$', xlabel = '$Distance(m)$', cb_label = '$Log_{10}Rhoa[\Omega.m]$', fig_size =(6, 3), font_size =7) .. GENERATED FROM PYTHON SOURCE LINES 61-62 Let visualize the raw-tensor and compared to the filtered tensors .. GENERATED FROM PYTHON SOURCE LINES 62-65 .. code-block:: default TPlot(**plot_kws).fit(edi_data).plot_tensor2d(to_log10 =True) .. image-sg:: /glr_examples/applications/images/sphx_glr_plot_nsamt_tensor_recovery_001.png :alt: plot nsamt tensor recovery :srcset: /glr_examples/applications/images/sphx_glr_plot_nsamt_tensor_recovery_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none .. GENERATED FROM PYTHON SOURCE LINES 66-69 Let visualize the filtered tensors pass to parameter `ffilter`: * Triming moving average (TMA) ( ``tma`` is the default filter) .. GENERATED FROM PYTHON SOURCE LINES 69-71 .. code-block:: default TPlot(**plot_kws ).fit(edi_data). plot_ctensor2d (to_log10=True) .. image-sg:: /glr_examples/applications/images/sphx_glr_plot_nsamt_tensor_recovery_002.png :alt: plot nsamt tensor recovery :srcset: /glr_examples/applications/images/sphx_glr_plot_nsamt_tensor_recovery_002.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none .. GENERATED FROM PYTHON SOURCE LINES 72-73 * Fixed-length-dipole (FLMA) .. GENERATED FROM PYTHON SOURCE LINES 73-76 .. code-block:: default TPlot(**plot_kws ).fit(edi_data).plot_ctensor2d(to_log10 =True, ffilter ='flma') .. image-sg:: /glr_examples/applications/images/sphx_glr_plot_nsamt_tensor_recovery_003.png :alt: plot nsamt tensor recovery :srcset: /glr_examples/applications/images/sphx_glr_plot_nsamt_tensor_recovery_003.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none .. GENERATED FROM PYTHON SOURCE LINES 77-78 * Fixed-length-dipole (FLMA) .. GENERATED FROM PYTHON SOURCE LINES 78-80 .. code-block:: default TPlot(**plot_kws ).fit(edi_data).plot_ctensor2d(to_log10 =True, ffilter ='ama') .. image-sg:: /glr_examples/applications/images/sphx_glr_plot_nsamt_tensor_recovery_004.png :alt: plot nsamt tensor recovery :srcset: /glr_examples/applications/images/sphx_glr_plot_nsamt_tensor_recovery_004.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none .. rst-class:: sphx-glr-timing **Total running time of the script:** ( 0 minutes 3.374 seconds) .. _sphx_glr_download_glr_examples_applications_plot_nsamt_tensor_recovery.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/master?urlpath=lab/tree/notebooks/glr_examples/applications/plot_nsamt_tensor_recovery.ipynb :alt: Launch binder :width: 150 px .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_nsamt_tensor_recovery.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_nsamt_tensor_recovery.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_