pyGIMLi

Run geophysical forward modelling and inversion with pyGIMLi for ERT, SRT, SIP, and EM surveys.

155|6|Updated Mar 31, 2026
One-click install
npx skills add https://github.com/lzwei196/KISS-Knowledge-Infrastructure-for-Scientific-Simulation --skill pygimli-lzwei196
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pyGIMLi
Source: https://github.com/lzwei196/KISS-Knowledge-Infrastructure-for-Scientific-Simulation/tree/main/models/pyGIMLi
Command: npx skills add https://github.com/lzwei196/KISS-Knowledge-Infrastructure-for-Scientific-Simulation --skill pygimli-lzwei196

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires numpy, scipy, matplotlib, pygimli, pgcore, and includes scripts (resource) and references (resource) components.

What problem does it solve? Running geophysical inversions with pyGIMLi requires operational expertise scattered across source code, docs, and practice: converting field data formats, applying correct units, configuring regularization, and diagnosing silent failures. This Skill packages that expertise so an AI agent can reliably execute, validate, and recover pyGIMLi workflows. ## Core Features & Use Cases - Staged pipeline tools: Four executable tools cover data conversion (Res2DInv, ABEM, Syscal, SEG-2, CSV to pyGIMLi DataContainer), petrophysical parameter setup, forward/inversion runs, and output parsing to CSV/VTK. - Diagnostic recovery: 18 symptom-to-diagnosis-to-remedy triplets plus a preflight check script catch known failure modes like unit confusion (ms vs s, Ohm vs Ohm·m), duplicate electrodes, and lambda misconfiguration. - Machine-readable model identity: dag.yaml defines inputs, outputs, units, observability, and validation ranks so agents know exactly what the model predicts and how to judge results. - Use Case: Convert a CSV of ERT field measurements with electrode positions into pyGIMLi format, configure region starting models from a rock-type table, run a 2D resistivity inversion targeting chi-squared near 1, and export a coverage-masked resistivity model to VTK. ## Quick Start Run python preflight_check.py in this directory, then ask the agent to invert your ERT field data file with the run_pygimli.py tool using default regularization.

Frequently Asked Questions about pyGIMLi

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run an ERT inversion with pyGIMLi?

Load field data with ert.load or convert it using convert_data_to_gimli.py, create an ERTManager, and call invert with a lambda value such as 20. Monitor chi-squared toward a target of 1 and display the result masked by coverage sensitivity.

What data formats does pyGIMLi support for resistivity and seismic data?

ERT data loads from BERT/GIMLI .dat and .ohm, Res2DInv, ABEM, and Syscal exports. Seismic refraction data uses SEG-2 .sg2 or GIMLI .sgt/.gtt travel time formats, and meshes support .poly, .msh, .vtk, and .bms.

Why is my pyGIMLi inversion producing velocities 1000 times too high?

Travel times were almost certainly supplied in milliseconds instead of seconds. pyGIMLi expects seconds; convert the input or pass the correct time unit so the SRT inversion receives properly scaled data.

Does pyGIMLi invert velocity or slowness for seismic refraction?

pyGIMLi inverts slowness in s/m because the traveltime forward problem is linear in slowness, then reports results as velocity (1/slowness). Applying a log transform to velocity instead of slowness breaks the forward operator.

What regularization lambda should I use in pyGIMLi inversion?

The default lambda is 20, typically reduced by a factor of 2 to 5 per iteration. Lambda too high over-smooths and hides anomalies; too low overfits noise. There is no built-in optimal-lambda selector, so supply or sweep values.

What are the limitations of pyGIMLi for geophysical modelling?

pyGIMLi solves a single steady-state survey snapshot with no time-evolving physics, works only in local Cartesian metres (no lat/lon), and uses locally convergent Gauss-Newton optimization subject to local minima and non-uniqueness.