{ "cells": [ { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "# Checkout www.pygimli.org for more examples\n%matplotlib inline" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\nGenerating SIP signatures\n-------------------------\n\nThis example highlights some of the capabilities of pyGimli to generate\nspectral induced polarization (SIP) signatures.\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Generate a Cole-Cole signature\n\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "from pygimli.physics.SIP import modelColeColeRho\nimport numpy as np\nimport pygimli as pg\nimport matplotlib as mpl\n\nf = np.logspace(-2, 5, 100)\n\nZ = modelColeColeRho(f, rho=10, m=0.1, tau=0.04, c=0.5)\n\nfig, axes = pg.plt.subplots(2, 2, figsize=(15 / 2.54, 10 / 2.54), sharex=True)\n\nax = axes[0, 0]\nax.semilogx(f, np.abs(Z), '.-')\nax.set_ylabel(r'$|Z|$ ($\\Omega$m)')\nax = axes[0, 1]\nax.semilogx(f, -np.angle(Z) * 1e3, '.-')\nax.set_ylabel(r'$-\\phi$ (mrad)')\nax = axes[1, 0]\nY = 1 / Z\nax.loglog(f, np.real(Y), '.-')\nax.set_xlabel('Frequency (Hz)')\nax.set_ylabel(r\"$\\sigma'$ (S$/$m)\")\nax = axes[1, 1]\nax.loglog(f, np.imag(Y), '.-')\nax.set_xlabel('Frequency (Hz)')\nax.set_ylabel(r\"$\\sigma''$ (S$/$m)\")\n\nfor ax in axes.flat:\n ax.xaxis.set_major_locator(mpl.ticker.LogLocator(numticks=5))\nfig.tight_layout()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Generate a double Cole-Cole signature\n\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "from pygimli.physics.SIP import modelColeColeRho\nimport numpy as np\nimport pygimli as pg\n\nf = np.logspace(-2, 5, 100)\n\n# term1\nZ1 = modelColeColeRho(f, rho=1, m=0.1, tau=0.5, c=0.5)\n# term2\nZ2 = modelColeColeRho(f, rho=1, m=0.25, tau=0.0001, c=0.8)\n# create sum\nrho0 = 100\nZ = rho0 * (Z1 + Z2)\n\nfig, axes = pg.plt.subplots(2, 2, figsize=(15 / 2.54, 10 / 2.54))\nax = axes[0, 0]\nax.semilogx(f, np.abs(Z), '.-')\nax.set_ylabel(r'$|Z|$ ($\\Omega$m)')\nax = axes[0, 1]\nax.semilogx(f, -np.angle(Z) * 1e3, '.-')\nax.set_ylabel(r'$-\\phi$ (mrad)')\nax = axes[1, 0]\nY = 1 / Z\nax.loglog(f, np.real(Y), '.-')\nax.set_xlabel('Frequency (Hz)')\nax.set_ylabel(r\"$\\sigma'$ (S$/$m)\")\nax = axes[1, 1]\nax.loglog(f, np.imag(Y), '.-')\nax.set_xlabel('Frequency (Hz)')\nax.set_ylabel(r\"$\\sigma''$ (S$/$m)\")\n\nfor ax in axes.flat:\n ax.xaxis.set_major_locator(\n mpl.ticker.LogLocator(numticks=5)\n )\nfig.tight_layout()" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.7.3" } }, "nbformat": 4, "nbformat_minor": 0 }