Commit 0082284c authored by Florian Wagner's avatar Florian Wagner

Minor

parent b35a3ffa
# -*- coding: utf-8 -*-
"""Simplistic version a complete ERT Modelling->Inversion example."""
import pybert as pb
import pygimli as pg
import pygimli.meshtools as mt # save space
import pybert as pb
# Create geometry definition for the modelling domain.
# worldMarker=True indicates the default boundary conditions for the ERT
world = mt.createWorld(start=[-50, 0], end=[50, -50],
layers=[-1, -5], worldMarker=True)
world = mt.createWorld(start=[-50, 0], end=[50, -50], layers=[-1, -5],
worldMarker=True)
# Create some heterogeneous circular
block = mt.createCircle(pos=[0, -3.], radius=1, marker=4,
boundaryMarker=10, area=0.1)
block = mt.createCircle(pos=[0, -3.], radius=1, marker=4, boundaryMarker=10,
area=0.1)
# Merge geometry definition into a Piecewise Linear Complex (PLC)
geom = mt.mergePLC([world, block])
......@@ -53,8 +52,8 @@ ert = pb.ERTManager()
# and return a data container with apparent resistivity values,
# geometric factors and estimated data errors specified by the noise setting.
# The noise is also added to the data.
data = ert.simulate(mesh, res=rhomap, scheme=scheme,
noiseLevel=1, noiseAbs=1e-6)
data = ert.simulate(mesh, res=rhomap, scheme=scheme, noiseLevel=1,
noiseAbs=1e-6)
# Optional: you can filter all values and tokens in the data container.
print('Simulated rhoa', data('rhoa'), max(data('rhoa')))
......@@ -87,10 +86,14 @@ ert.showResultAndFit()
# Optional: provide a custom mesh to the inversion
grid = pg.createGrid(x=pg.utils.grange(start=-12, end=12, n=33),
y=-pg.utils.grange(0.5, 8, n=8, log=True))
mesh = pg.meshtools.appendTriangleBoundary(grid, xbound=50, ybound=50)
model = ert.invert(data, mesh=mesh, lam=20)
ert.showResultAndFit()
chi2 = ert.inv.getChi2()
print(chi2)
# Stop the script here and wait until all figure are closed.
pg.wait()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment