pygimli
Skill67 starsChanged 10 months agoMITView on GitHub
Multi-method geophysical modelling and inversion framework. Use when the agent needs to: (1) Perform electrical resistivity tomography (ERT) inversion, (2) Run seismic refraction tomography (SRT), (3) Model induced polarization (IP) data, (4) Simulate ground penetrating radar (GPR), (5) Create finite element meshes for geophysical problems, (6) Perform joint inversions of multiple datasets, (7) Forward model geophysical responses, (8) Analyze time-lapse monitoring data.
In this repository41 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- bouleSkill
- brugesSkill
- devitoSkill
- disbaSkill
- discretizeSkill
- dlisioSkill
- ensaioSkill
- flopySkill
- gemgisSkill
- gempySkill
- geolimeSkill
- geostatspySkill
- gnnwrSkill
- gprpySkill
- harmonicaSkill
- landlabSkill
- lasioSkill
- loopstructuralSkill
- mplstereonetSkill
- mtpySkill
- obspySkill
- pastasSkill
- petropySkill
- poochSkill
- pygmtSkill
- pyleoclimSkill
- pylopsSkill
- pyroliteSkill
- pyvistaSkill
- rockhoundSkill
- scikit-gstatSkill
- segyioSkill
- segysakSkill
- simpegSkill
- striplogSkill
- using-geoscience-skillsSkill
- verdeSkill
- wellySkill
- xarraySkill
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 167
Check data quality: - remove outliers before inversion
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
pyGIMLi - Geophysical Inversion
Quick Reference
import pygimli as pg
from pygimli.physics import ert, srt
# Load ERT data
data = ert.load("survey.ohm")
# Invert
mgr = ert.ERTManager(data)
model = mgr.invert(lam=20, verbose=True)
# View result
mgr.showResult()Key Classes
| Class | Purpose |
pg.Mesh | Finite element meshes |
pg.DataContainer | Survey data and geometry |
pg.Inversion | Base inversion framework |
ert.ERTManager | ERT processing and inversion |
srt.SRTManager | Seismic refraction inversion |
Essential Operations
Load and View ERT Data
import pygimli as pg
from pygimli.physics import ert
data = ert.load("survey.ohm")
print(f"Measurements: {data.size()}")
ert.showData(data) # PseudosectionERT Inversion
from pygimli.physics import ert
mgr = ert.ERTManager(data)
model = mgr.invert(
lam=20, # Regularization
verbose=True
)
mgr.showResult()
resistivity = mgr.modelSeismic Refraction
from pygimli.physics import srt
data = srt.load("traveltimes.sgt")
mgr = srt.SRTManager(data)
model = mgr.invert(lam=30, zWeight=0.3)
mgr.showResult()Create Custom Mesh
import pygimli as pg
from pygimli.physics import ert
data = ert.load("survey.ohm")
mesh = pg.meshtools.createParaMesh(
data.sensors(),
quality=34.0,
paraMaxCellSize=5,
boundary=2
)
pg.show(mesh)Save and Export
# Save mesh and model
mgr.mesh.save("result_mesh.bms")
pg.save(model, "resistivity_model.vector")
# Export to VTK for ParaView
mgr.mesh.exportVTK("result", mgr.model)Array Types
| Code | Array |
wa | Wenner-alpha |
wb | Wenner-beta |
dd | Dipole-dipole |
pd | Pole-dipole |
pp | Pole-pole |
slm | Schlumberger |
gr | Gradient |
Data Formats
| Format | Extension | Description |
| BERT/pyGIMLi | .ohm | Unified data format |
| Syscal | .txt | IRIS export |
| Res2DInv | .dat | 2D inversion format |
| ABEM | .ohm | ABEM Terrameter |
| SRT | .sgt | Seismic traveltimes |
When to Use vs Alternatives
| Scenario | Recommendation |
| Standard ERT inversion with common arrays | pyGIMLi - simplest API, built-in array types |
| Seismic refraction tomography (SRT) | pyGIMLi - integrated SRT manager |
| Multi-method inversion (DC, magnetics, gravity, EM) | SimPEG - broader method coverage |
| Commercial ERT processing with reporting | Res2DInv - industry standard, GUI-based |
| Custom forward operators or research flexibility | SimPEG - more modular design |
| FEM-based geophysical modelling | pyGIMLi - native FEM mesh support |
Choose pyGIMLi when: You need near-surface geophysical inversion (ERT, SRT, IP) with
minimal code. Its manager classes (ERTManager, SRTManager) handle the full workflow
from data loading to inversion to visualization in a few lines.
Avoid pyGIMLi when: You need methods beyond near-surface (use SimPEG), or you require a commercial-grade reporting pipeline.
Common Workflows
ERT data inversion and visualization
- Load ERT data file with
ert.load("survey.ohm") - Inspect data: check measurement count with
data.size(), plot pseudosection - Remove outliers or bad data points
- Create
ERTManagerwith data - Run inversion:
mgr.invert(lam=20)(start with higher lambda) - Check chi-squared value (target ~ 1)
- Visualize result with
mgr.showResult() - Export mesh and model to VTK for ParaView:
mgr.mesh.exportVTK() - Adjust lambda and zWeight if needed, re-invert
Inversion Tips
- Start with higher lambda (50-100) and decrease
- Check data quality - remove outliers before inversion
- Use zWeight < 1 for layered structures
- Check coverage - low coverage = poorly resolved
- Chi-squared ~ 1 indicates good fit without overfitting
References
- Geophysical Methods - Supported methods and workflows
- Mesh Generation - Mesh creation and quality control
Scripts
- scripts/ert_inversion.py - Complete ERT inversion workflow
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

