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
Z = rho0 * (Z1 + Z2)
amplitude = np.abs(Z)
phase = np.angle(Z)

sip = SIPSpectrum(
    f=f,
    amp=np.abs(Z),
    # note the minus sign: we need to provide -phase[rad]
    phi=-np.angle(Z),
)
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

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=np.abs(Z),
    # note the minus sign: we need to provide -phase[rad]
    phi=-np.angle(Z),
)
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
Z = rho0 * (Z1 + Z2)
amplitude = np.abs(Z)
phase = np.angle(Z)

sip = SIPSpectrum(
    f=f,
    amp=np.abs(Z),
    # note the minus sign: we need to provide -phase[rad]
    phi=-np.angle(Z),
)
sip.fitCCEM()  # fit an SIP Cole-Cole term and an EM term (also Cole-Cole)

# %% create titles and plot data, fit and model
sip.showAll()  # save=True)
# %%
pg.wait()
../../_images/sphx_glr_plot_fitting_sip_signatures_004.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=np.abs(Z),
    # note the minus sign: we need to provide -phase[rad]
    phi=-np.angle(Z),
)
# 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

# %% create titles and plot data, fit and model
sip.showAll()  # save=True)
# %%
sip.fitDebyeModel(new=True, showFit=True)
pg.wait()
  • ../../_images/sphx_glr_plot_fitting_sip_signatures_005.png
  • ../../_images/sphx_glr_plot_fitting_sip_signatures_006.png

Total running time of the script: ( 0 minutes 2.857 seconds)

Generated by Sphinx-Gallery

News (Aug 2017):
pyGIMLi Paper out now! Download PDF here.


© 2017 - GIMLi Development Team
Created using Bootstrap and Sphinx. Last updated on Oct 15, 2017.