AgentSkillsCN

welly

为测井数据、项目与地层顶界提供加载、处理与分析工具箱。基于lasio构建,强化了曲线处理功能。当Claude需要执行以下操作时使用:(1) 从带有元数据的LAS文件中加载测井数据;(2) 处理多井项目;(3) 对曲线进行去尖峰、平滑、重采样、归一化等处理;(4) 管理地层顶界;(5) 将测井数据导出为DataFrame/LAS/CSV格式;(6) 开展井间分析与质量控制。

SKILL.md
--- frontmatter
name: welly
description: |
  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 Claude 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.

welly - Well Data Analysis

Quick Reference

python
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

ClassPurpose
WellSingle well with curves, location, tops
ProjectCollection of wells for multi-well workflows
CurveLog curve with depth basis, units, and processing methods

Essential Operations

Access Curve Data

python
gr = w.data['GR']
print(gr.mnemonic, gr.units)     # Metadata
print(gr.start, gr.stop, gr.step)  # Depth range

Process Curves

python
gr = w.data['GR']

# Clean and filter
gr_clean = gr.despike(window=5, z=2)
gr_smooth = gr.smooth(window=11)

# Transform
gr_norm = gr.normalize()         # 0-1 range
gr_resampled = gr.resample(step=0.5)
gr_clipped = gr.clip(top=1500, bottom=2000)

Work with Formation Tops

python
w.tops = {
    'TopFormationA': 1500.0,
    'TopFormationB': 1750.0,
}

for name, depth in w.tops.items():
    print(f"{name}: {depth} m")

Multi-Well Project

python
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

python
# To DataFrame
df = w.df()

# To LAS file
w.to_las('output.las')

# To CSV
df.to_csv('well_data.csv')

Common Curve Mnemonics

MnemonicDescriptionUnits
GRGamma RayGAPI
NPHINeutron Porosityv/v
RHOBBulk Densityg/cc
DTSonicus/ft
RT/ILDDeep Resistivityohm.m
CALICaliperin

Tips

  1. Use Project for multi-well workflows - easier than managing individual files
  2. Check units - welly tracks units, ensure consistency
  3. Despike before analysis - remove outliers with curve.despike()
  4. Resample to common basis - use curve.resample() for cross-well comparison
  5. welly extends lasio - all lasio functionality available

References

Scripts