ertkit
Resistivity imaging for groundwater exploration, with an honest account of what the data can resolve.
ertkit is a Python package for inverting vertical electrical sounding (VES) data, with 2.5-D electrical resistivity tomography (ERT) to follow. Each result comes with what is needed to judge it:
- a data error model, and a fit to the noise level rather than to every digit of the data;
- sensitivity and depth of investigation, so that unresolved parts of a model are marked as such;
- parameter uncertainty, with the range of equivalent models that fit the data equally well planned for release 0.2.
Why another resistivity code?
Boreholes are often sited from resistivity models whose reliability was never quantified. Open tools such as pyGIMLi, SimPEG and ResIPy already provide excellent modeling and inversion. ertkit focuses on three things: making reliability the default output, publishing a verification report with every release, and keeping the code small enough to teach from. The design document gives the full statement of need, the mathematics and the verification plan.
Installation
pip install ertkit # Python 3.12 or later
pip install "ertkit[plot]" # with plotting (matplotlib)
Quick start
import numpy as np
import ertkit
from ertkit import ves
truth = ves.LayeredModel(resistivity=[150.0, 30.0, 800.0], thickness=[2.0, 15.0])
survey = ves.Survey.schlumberger(ab2=np.geomspace(2.5, 200.0, 22), mn2=0.5)
data = ves.Sounding.synthetic(truth, survey, ertkit.ErrorModel(relative=0.03), rng=5)
# Field data: data = ves.read_csv("sounding.csv")
fit = ves.invert_few_layer(data, n_layers=3, rng=0)
print(fit.summary()) # layers with uncertainty factors (x/), depths +- sd, fit
smooth = ves.invert_smooth(data)
print(f"depth of investigation: {smooth.doi:.0f} m")
The first print shows:
LayerFit: chi2 = 16.1 for 22 data (target 17, ratio 0.947)
converged: True (`ftol` termination condition is satisfied.)
layer resistivity (ohm m) thickness (m) depth (m)
1 144.6 x/ 1.04 2.04 x/ 1.04 2.04 +- 0.075
2 30.18 x/ 1.03 15.2 x/ 1.05 17.3 +- 0.69
3 787.9 x/ 1.12 half-space
p-value: 0.517
Here x/ 1.04 means "multiplied or divided by 1.04" (one standard
deviation).
Status
Release 0.1.1 covers vertical electrical sounding: a layered-earth forward
model, few-layer inversion with linearized uncertainty, smooth inversion with
sensitivity and a depth of investigation, CSV input and plotting. This patch
screens weak synthetic signals before adding noise, corrects smooth-inversion
stopping summaries, and requires at least three layers for a smooth grid.
Two-layer fitting remains available through invert_few_layer. Planned releases:
| Release | Content |
|---|---|
| 0.1 | VES: layered-earth forward model, few-layer and smooth inversion, linearized uncertainty, sensitivity and depth of investigation |
| 0.2 | VES equivalence analysis |
| 0.3 | 2.5-D ERT forward modeling |
| 0.4 | ERT inversion with an error model and cumulative sensitivity |
| 0.5 | ERT depth of investigation and uncertainty maps |
| 0.6 | Field data formats and an end-to-end field example |
| 1.0 | Stable public API |
Documentation
The documentation at https://abdgafartunde.github.io/ertkit/ has the user guide, worked examples, the API reference and the verification report, generated by the test suite for each release.
Contributing
Bug reports, questions and suggestions are welcome on the issue tracker. To work on the code, install uv and run:
git clone https://github.com/abdgafartunde/ertkit.git
cd ertkit
uv sync
uv run pytest
See the contributing guide and the Code of Conduct.
Citing
Each release is archived on Zenodo with a DOI; to cite ertkit in general, use the concept DOI 10.5281/zenodo.23385097, which always resolves to the latest version. Citation metadata are in CITATION.cff; please also cite the methods ertkit implements.
License
MIT; see LICENSE.
Metadata
Release files for ertkit 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ertkit-0.1.1.tar.gz | 220.9 kB | With provenance | Details for ertkit-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ertkit-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for ertkit-0.1.1-py3-none-any.whl |
Total release size: 262.3 kB
Release files / ertkit-0.1.1.tar.gz
| Download URL | ertkit-0.1.1.tar.gz |
|---|---|
| Size | 220.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a87338c4f5b1212181769fe4038a421f3d7a038899c41c35346cfe13474e8c04
|
|
BLAKE2b-256 checksum How to use checksums |
6fbe30e384ee9bccc8a3c4e926f76eb2af80720073580b29c83903280a6e3c3d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 9, 2026.
Transparency logRelease files / ertkit-0.1.1-py3-none-any.whl
| Download URL | ertkit-0.1.1-py3-none-any.whl |
|---|---|
| Size | 41.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b948a73d431f4ec4f9b695789ca6250cf561ab2d43953a729eddc188ebd53389
|
|
BLAKE2b-256 checksum How to use checksums |
014b0693fd5ea345fa8ab94bdacfc9a5df72ae37f29cd8dcceeab4a4dce275ea
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 9, 2026.
Transparency logSecurity for ertkit 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for ertkit-0.1.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 9, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.