Combining near-surface geophysical data with the open-source library pyGIMLi
2026-09-20
| Time | Session | Lead |
|---|---|---|
| 09:00-10:30 | 1. Introduction | F. Wagner |
| 10:30-11:00 | Break | |
| 11:00-12:30 | 2. Advanced inversion | N. Menzel |
| 12:30-13:30 | Lunch | |
| 13:30-15:00 | 3. Joint inversion | A. Jaron |
| 15:00-15:30 | Break | |
| 15:30-17:00 | 4. Additional topics & assisted data processing |
Note
Feel free to ask questions at any time during the workshop. We will also have a Q&A session at the end of each part of the workshop.
Binley et al. (2015)
–> model coupling is challenging and requires versatile open-source software

All available in pygimli.physics:
| Method | Forward | Inverse | Dimension |
|---|---|---|---|
| EM | ✓ | ✓ | 1D |
| ERT | ✓ | ✓ | 2D, 3D, 4D |
| Gravimetry | ✓ | ✓ | 2D, 3D |
| Magnetics | ✓ | ✓ | 2D, 3D |
| Petrophysics | ✓ | ✓ | dimensionless |
| Seismics | ✓ | - | 2D |
| SIP | ✓ | ✓ | 1D, 2D, 3D |
| sNMR | ✓ | ✓ | 1D |
| Traveltime | ✓ | ✓ | 2D, (3D) |
| VES | ✓ | ✓ | 1D |
pyGIMLi is organized in three different abstraction levels:
In the application level, ready-to-use method managers and frameworks are provided.
In the modelling level, users can set up customized forward operators that map discretized parameter distributions to a data vector. Once defined, it is straightforward to set up a corresponding inversion workflow or combine the forward operator with existing ones.
The underlying equation level allows to directly access the finite element solvers to solve various partial differential equations on unstructured meshes, i.e. to approach various physical problems with possibly complex 2D and 3D geometries.
The default inversion framework is based on the generalized Gauss-Newton method and is compatible with any given forward operator and thus applicable to various physical problems.
\[ \| \mathbf{W}_\text{d} (\mathbf{F}(\mathbf{m})-\mathbf{d}) \|^2_2 + \lambda \| \mathbf{W}_\text{m} (\mathbf{m}-\mathbf{m_0}) \|^2_2 \rightarrow\min \]
Note
The inversion is physics-independent and very flexible in terms of adding prior information, regularization and integrating different geophysical methods.
LSQRinversion framework enabling additional parameter relations (from Wagner et al., 2019)MultiFrameModelling framework for temporally/spectrally/spatially constrained inversionTimelapseERT class with different strategies, e.g. 4D inversionpip install pygimli for easier installation (e.g. on Google Colab)pyGIMLi objects (Mesh, DataContainer, matrix types, etc.), geostatistical vs. smoothness regularization, treatment of subsurface regions, adding prior data.
“In open source, we feel strongly that to really do something well, you have to get a lot of people involved.”
– Linus Torvalds
#pyGIMLi chat on Mattermost!Everything is exposed through
and the high-level ert.ERTManager class — but every step can also be customized at the modelling or equation level.
pyGIMLi can read various system formats, but internally the unified data format is the basis of the DataContainer class, which is used for all data management and processing steps.
6 # Number of electrodes
# x z
0 0
1 0
2 0 # loose ground
3 0
4 0
5 0
6 # Number of data
# a b m n u i/mA err/%
1 2 3 4 -0.5305165 102.2 2.4
2 3 4 5 -0.5305165 99.9 1.4
3 4 5 6 -0.5305165 95.6 2.6
1 2 4 5 -0.1326291 100.1 7.6
2 3 5 6 -0.1326291 80.2 8.6 # possibly an outlier
1 2 5 6 -0.05305165 77.3 7.5Drinking water reservoir near Cologne, Germany
Severe drought and beetle infestation lead to massive forest diebacks close to reservoir
Geophysical surveys should help to answer questions regarding hydrological settings in near-surface areas at potential reforesting sites
Can we use geophysics in combination with other soil parameter measurements to make suggestions regarding the reforestation of certain areas?

Note
If you have pyGIMLi and Jupyter installed, please open an empty notebook.
We familiarized ourselves with the method managers to process and invert ERT and SRT data.
We loaded, filtered, and inverted field data using pyGIMLi and qualitatively evaluated the results
We applied tools that allow us to quantitatively compare and qualitatively evaluate the single inversion results, such as…
We implemented ways to further improve our individual inversions by penalizing individual data points with increased misfit.
Get to know the possibilities of including a-priori information as constraints into inversions.
Incorporate geological and structural a-priori information into regularization.
Incorporate reflectors visible in GPR measurements as constraints in ERT.
Apply interactive tools to extract constraints from images or models.
Structural information can be a useful addition to any inversion to reduce ambiguity.
Goal: give “hints” to the inversion as to where we expect parameter jumps / contrasts.
Possible sources of information:
Those information can be easily integrated into the mesh used for inversion
Wagner & Uhlemann (2021)
Most commonly applied constraints: including one or multiple 1D point sources of information
Structural / geological information or geophysical data from well logging
In most cases, borehole data give sharp boundaries between lithologies that can be utilized to constrain the inversion
Goal: by including borehole data, the inversion also aims at explaining the additional information within its error bounds, leading to an oftenmost more refined model

Alternative way to smoothness-constrained inversions using a covariance matrix to quantify the correlation of model parameters in different cells (Jordi et al., 2018)
Based on geological or structural analysis, an estimation of i) vertical and horizontal correlation lengths, ii) the dip angle and iii) the strike direction (in 3D) is included into the inversion
The resulting covariance matrix is given as:
\[ \mathbf{C}_{\text{M,i,j}} = \sigma^2 exp\left(-3 \sqrt{\left(\frac{\mathbf{H_{x,i,j}}}{I_x}\right)^2 + \left(\frac{\mathbf{H_{y,i,j}}}{I_y}\right)^2 + \left(\frac{\mathbf{H_{z,i,j}}}{I_z}\right)^2}\right) \tag{1}\]
Each row of the covariance matrix contains the spatial correlation function for one particular cell.
Example notebook: Applying geostatistical constraints
Alternative way to smoothness-constrained inversions using a covariance matrix to quantify the correlation of model parameters in different cells (Jordi et al., 2018)
Based on geological or structural analysis, an estimation of i) vertical and horizontal correlation lengths, ii) the dip angle and iii) the strike direction (in 3D) is included into the inversion
The resulting correlation for a single model cell looks as follows:
Structural information can not only be derived from geological or structural information, but also from measurements using other geophysical methods.
In our case: measured GPR data are loaded and reflector is picked to define a structural constraint to further refine an ERT inversion.
Other possibilities: 1D downhole geophysical measurements, other wave methods (reflection seismics), …
We applied advanced regularization techniques to our individual inversions
We constrained the individual inversions using
We evaluated and compared the constrained models and quantified the effect of adding a-priori information
Learn the necessary steps to successfully perform a joint inversion.
Apply the cross-gradient algorithm to jointly invert SRT and ERT using actual field data.
Evaluate and compare the joint inversion results to individually inverted data sets.
Optional: Apply the algorithm to your own data sets!

If two methods are sensitive to different physical properties (e.g. electrical resistivity \(\rho\) by using ERT and acoustic velocity \(v\) by using SRT) we can use different types of joint inversion algorithms to link the two model parameter spaces.
One possible approach is to couple both methods by using a petrophysical relationship between the two physical properties. This is called petrophysically coupled joint inversion. For example the water saturation can be used to link the electrical resistivity and acoustic velocity of the subsurface.
If a petrophysical relationship is not known or cannot be applied, we can use a structurally coupled joint inversion. In this case, we assume that the two physical properties are structurally related, i.e. they have similar spatial distributions. This can be achieved by using a cross-gradient constraint in the inversion.
For this purpose, we define the cross-gradient function \(\Phi_{cg}\) as the integral of the squared magnitude of the cross product of the gradients of the two physical properties:
\[\Phi_{cg} = \int \left| \nabla \mathbf{\rho}(i) \times \nabla \mathbf{v}(i) \right|^{2}\]
Wagner & Uhlemann (2021)
which type of joint inversion to use depends on the physical properties of the methods used.
If the methods are sensitive to the same physical property, a classical joint inversion can be used.
If the methods are sensitive to different physical properties, a petrophysically coupled or structurally coupled joint inversion can be used.
A petrophysically coupled joint inversion requires a known petrophysical relationship between the two physical properties.
Often, a structurally coupled joint inversion is used, which requires no petrophysical relationship between the two physical properties.

pyGIMLi workshop, EAGE NSG 2026, Thessaloniki