Fitting SIP signaturesΒΆ

This example highlights some of the capabilities of pyGimli to analyze spectral induced polarization (SIP) signatures.

Generate synthetic data and initialize an SIPSpectrum object

from pygimli.physics.SIP import ColeColeRho
from pygimli.physics import SIPSpectrum
import numpy as np
import pygimli as pg

f = np.logspace(-2, 5, 100)

# term1
Z1 = ColeColeRho(f, rho=1, m=0.1, tau=0.5, c=0.5)
# term2
Z2 = ColeColeRho(f, rho=1, m=0.25, tau=1e-6, c=1.0)
# create sum
rho0 = 100 # (Ohm m)
Z = rho0 * (Z1 + Z2)
amplitude = np.abs(Z)
phase = np.angle(Z)

sip = SIPSpectrum(f=f,
                  amp=amplitude,
                  # note the minus sign: we need to provide -phase[rad]
                  phi=-phase)
sip.showData()
sip.showDataKK()  # check Kramers-Kronig relations
  • ../../_images/sphx_glr_plot_fitting_sip_signatures_001.png
  • ../../_images/sphx_glr_plot_fitting_sip_signatures_002.png

Out:

(<Figure size 640x480 with 2 Axes>, array([<matplotlib.axes._subplots.AxesSubplot object at 0x7f8818954a58>,
       <matplotlib.axes._subplots.AxesSubplot object at 0x7f882edb8e10>],
      dtype=object))

Fit a Cole-Cole model

from pygimli.physics import SIPSpectrum
from pygimli.physics.SIP import ColeColeRho
import numpy as np
import pygimli as pg

f = np.logspace(-2, 5, 100)
m = np.linspace(0.1, 0.9, 5)
tau = 0.01

# generate synthetic data to fit
Z = ColeColeRho(f, rho=100, m=m[0], tau=tau, c=0.5)
amplitude = np.abs(Z)
phase = np.angle(Z)

sip = SIPSpectrum(f=f,
                  amp=amplitude,
                  # note the minus sign: we need to provide -phase[rad]
                  phi=-phase,
)
sip.fitColeCole(useCond=False)  # works for both rho and sigma models
sip.showAll()  # save=True)
pg.wait()
../../_images/sphx_glr_plot_fitting_sip_signatures_003.png

Fit a double Cole-Cole model

from pygimli.physics.SIP import ColeColeRho
import numpy as np
import pygimli as pg

f = np.logspace(-2, 5, 100)

# term1
Z1 = ColeColeRho(f, rho=1, m=0.1, tau=0.5, c=0.5)
# term2
Z2 = ColeColeRho(f, rho=1, m=0.25, tau=1e-6, c=1.0)
# create sum
rho0 = 100 #(Ohm m)
Z = rho0 * (Z1 + Z2)
amplitude = np.abs(Z)
phase = np.angle(Z)

sip = SIPSpectrum(
    f=f,
    amp=amplitude,
    # note the minus sign: we need to provide -phase[rad]
    phi=-phase,
)
sip.fitCCEM()  # fit an SIP Cole-Cole term and an EM term (also Cole-Cole)
sip.showAll()  # save=True)
../../_images/sphx_glr_plot_fitting_sip_signatures_004.png

Out:

(<Figure size 1200x1200 with 2 Axes>, array([<matplotlib.axes._subplots.AxesSubplot object at 0x7f8818bf1198>,
       <matplotlib.axes._subplots.AxesSubplot object at 0x7f8803c6f080>],
      dtype=object))
pg.wait()
../../_images/sphx_glr_plot_fitting_sip_signatures_005.png

Given is a SIP signature for N frequencies in the form of resistivity magnitude and phase values

from pygimli.physics import SIPSpectrum
from pygimli.physics.SIP import ColeColeRho
import numpy as np
import pygimli as pg

f = np.logspace(-2, 5, 100)
m = np.linspace(0.1, 0.9, 5)
tau = 0.01

# generate synthetic data to fit
Z = ColeColeRho(f, rho=100, m=m[0], tau=tau, c=0.5)
amplitude = np.abs(Z)
phase = np.angle(Z)

sip = SIPSpectrum(
    f=f,
    amp=amplitude,
    # note the minus sign: we need to provide -phase[rad]
    phi=-phase,
)
# sip.showData()  # znorm=True)
# sip.showDataKK()  # check Kramers-Kronig relations
# if True:  # determine constant epsilon and remove i omega term
#     sip.removeEpsilonEffect()
#     sip.showDataKK()  # check Kramers-Kronig again after removing epsilon
#   # sip.fitColeCole(useCond=False)  # works for both rho and sigma models
sip.showAll()  # save=True)
../../_images/sphx_glr_plot_fitting_sip_signatures_006.png

Out:

(<Figure size 1200x1200 with 2 Axes>, array([<matplotlib.axes._subplots.AxesSubplot object at 0x7f8818c60518>,
       <matplotlib.axes._subplots.AxesSubplot object at 0x7f8818b5bda0>],
      dtype=object))
sip.fitDebyeModel(new=True, showFit=True)
pg.wait()
../../_images/sphx_glr_plot_fitting_sip_signatures_007.png

Out:

ARMS= 0.00014135944091272931 RRMS= 0.14496805845904442

Gallery generated by Sphinx-Gallery



2019 - GIMLi Development Team
Created using Bootstrap, Sphinx and pyGIMLi 1.0.12+20.g65e71e67 on Mar 10, 2020.