welly
Skill67 starsChanged 10 months agoMITView on GitHub
Subsurface well data analysis toolkit for loading, processing, and analyzing well logs, projects, and formation tops. Built on lasio with enhanced curve processing. Use when the agent needs to: (1) Load wells from LAS files with metadata, (2) Work with multi-well Projects, (3) Process curves (despike, smooth, resample, normalize), (4) Manage formation tops, (5) Export well data to DataFrame/LAS/CSV, (6) Perform cross-well analysis and QC.
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
- pygimliSkill
- pygmtSkill
- pyleoclimSkill
- pylopsSkill
- pyroliteSkill
- pyvistaSkill
- rockhoundSkill
- scikit-gstatSkill
- segyioSkill
- segysakSkill
- simpegSkill
- striplogSkill
- using-geoscience-skillsSkill
- verdeSkill
- xarraySkill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 3 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 144
Despike before analysis: - remove outliers with curve.despike()
- Very specific: line 145
Resample to common basis: - use curve.resample() for cross-well comparison
- Distinctive: line 146
welly extends lasio: - all lasio functionality available
- Distinctive: line 159
Use lasio instead: when you only need to read/write LAS files, handle malformed headers, or need fine control over LAS formatting.
- Distinctive: line 162
Use petropy instead: when your focus is formation evaluation calculations (shale volume, porosity, water saturation) rather than data …
≈ “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
welly - Well Data Analysis
The examples are checked with welly 0.5.2. This release imports
pkg_resources, so its environment needs setuptools<81. The repository's
scientific test requirements record the other tested dependency versions.
Quick Reference
from welly import Well, Project
# Load single well
w = Well.from_las('well.las')
# Access data
df = w.df() # DataFrame
gr = w.data['GR'] # Curve object
values = gr.values # numpy array
depth = gr.basis # depth array
# Well info
print(w.name, w.uwi)
print(w.data.keys()) # Available curves
# Load multiple wells
p = Project.from_las('wells/*.las')
for well in p:
print(well.name)Key Classes
| Class | Purpose |
Well | Single well with curves, location, tops |
Project | Collection of wells for multi-well workflows |
Curve | Log curve with depth basis, units, and processing methods |
Essential Operations
Access Curve Data
gr = w.data['GR']
print(gr.mnemonic, gr.units) # Metadata
print(gr.start, gr.stop, gr.step) # Depth rangeProcess Curves
import numpy as np
gr = w.data['GR']
# Clean and filter
gr_clean = gr.despike(window_length=5, z=2)
gr_smooth = gr_clean.apply(window_length=11, func1d=np.nanmean)
w.data['GR'] = gr_clean # Use the cleaned curve in subsequent well exports.
# Optional dimensionless display array; retain GR's physical API units in w.
values = gr_clean.as_numpy().ravel()
finite = np.isfinite(values)
gr_norm = np.full_like(values, np.nan, dtype=float)
if finite.any() and np.ptp(values[finite]) > 0:
gr_norm[finite] = (values[finite] - values[finite].min()) / np.ptp(values[finite])
gr_resampled = gr_clean.to_basis(step=0.5)
gr_window = gr_clean.to_basis(start=1500, stop=1510) # Outside support is NaN.See the Curve API for
despike, apply, and to_basis parameters. Review filtering against thin beds
before treating the processed curve as interpretation input.
Work with Formation Tops
w.tops = {
'TopFormationA': 1500.0,
'TopFormationB': 1750.0,
}
for name, depth in w.tops.items():
print(f"{name}: {depth} m")Multi-Well Project
from welly import Project
p = Project.from_las('wells/*.las')
print(f"Loaded {len(p)} wells")
# Filter and analyze
for w in p:
if 'GR' in w.data:
print(f"{w.name}: GR mean={w.data['GR'].values.mean():.1f}")Export Data
# To DataFrame
df = w.df()
# To LAS file
w.to_las('output.las')
# To CSV
df.to_csv('well_data.csv')Common Curve Mnemonics
| Mnemonic | Description | Units |
| GR | Gamma Ray | GAPI |
| NPHI | Neutron Porosity | v/v |
| RHOB | Bulk Density | g/cc |
| DT | Sonic | us/ft |
| RT/ILD | Deep Resistivity | ohm.m |
| CALI | Caliper | in |
Tips
- Use Project for multi-well workflows - easier than managing individual files
- Check units - welly tracks units, ensure consistency
- Despike before analysis - remove outliers with
curve.despike() - Resample to common basis - use
curve.resample()for cross-well comparison - welly extends lasio - all lasio functionality available
When to Use vs Alternatives
| Tool | Best For |
| welly | Multi-well projects, curve processing, formation tops management |
| lasio | Low-level LAS file I/O, header manipulation, malformed files |
| petropy | Petrophysical calculations (Vsh, porosity, Sw, permeability) |
Use welly when you need to manage wells as objects with curves, tops, and metadata -- especially for multi-well QC and cross-well analysis via Project.
Use lasio instead when you only need to read/write LAS files, handle malformed headers, or need fine control over LAS formatting.
Use petropy instead when your focus is formation evaluation calculations (shale volume, porosity, water saturation) rather than data management.
Common Workflows
Load and QC a multi-well project
- [ ] Load wells with `Project.from_las('wells/*.las')`
- [ ] Check well count and names: `len(p)`, iterate wells
- [ ] Verify required curves exist in each well (`'GR' in w.data`)
- [ ] Despike and clean noisy curves: `curve.despike()`
- [ ] Resample to common depth basis for cross-well comparison
- [ ] Compute summary statistics per well (mean, min, max)
- [ ] Export cleaned data to LAS or DataFrameReferences
- Curve Processing - Despike, smooth, normalize, resample methods
- Project Workflows - Multi-well analysis patterns
Scripts
- scripts/well_qc.py - QC well data for gaps and issues
- scripts/project_stats.py - Compute project-level statistics
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.

