AgentSkillsCN

striplog

为测井数据创建、可视化并分析岩性与地层记录。当Claude需要执行以下操作时使用:(1) 根据深度区间创建岩性柱;(2) 将地质描述解析为结构化的日志;(3) 以图案与色彩可视化地层柱;(4) 开展井间对比分析;(5) 提取净厚比等统计指标;(6) 定义岩石类型词典与图例;(7) 将岩性数据导出为CSV/LAS/JSON格式。

SKILL.md
--- frontmatter
name: striplog
description: |
  Create, visualize, and analyze lithological and stratigraphic logs for well
  data. Use when Claude needs to: (1) Create lithology columns from depth intervals,
  (2) Parse geological descriptions into structured logs, (3) Visualize stratigraphic
  columns with patterns and colors, (4) Perform well-to-well correlations, (5) Extract
  statistics like net-to-gross ratios, (6) Define rock type lexicons and legends,
  (7) Export lithology data to CSV/LAS/JSON.

striplog - Lithological Logs

Quick Reference

python
from striplog import Striplog, Interval, Component

# Create from intervals
intervals = [
    Interval(top=0, base=10, components=[Component({'lithology': 'sandstone'})]),
    Interval(top=10, base=25, components=[Component({'lithology': 'shale'})]),
    Interval(top=25, base=40, components=[Component({'lithology': 'limestone'})]),
]
strip = Striplog(intervals)

# Load from file
strip = Striplog.from_csv('lithology.csv')  # Columns: top, base, lithology

# Access and display
print(strip)
strip.plot()
df = strip.to_dataframe()

Key Classes

ClassPurpose
StriplogMain log container - holds intervals
IntervalDepth interval with top, base, and components
ComponentRock type definition with properties
LexiconRock type dictionary with synonyms
LegendVisualization styles (colors, patterns)

Essential Operations

Create from CSV

python
# CSV format: top,base,lithology
strip = Striplog.from_csv('lithology.csv')
strip.plot()

Create from Description Text

python
from striplog import Striplog, Lexicon

description = """
0.0 - 5.5 m: Fine to medium sandstone
5.5 - 12.0 m: Grey shale with silt laminations
12.0 - 18.5 m: Massive limestone, fossiliferous
"""
strip = Striplog.from_description(description, lexicon=lexicon)

Query and Extract

python
# Get interval at depth
interval = strip.read_at(z=15)
print(interval.primary.lithology)

# Crop to depth range
subset = strip.crop((10, 30))

# Unique lithologies
lithologies = strip.unique('lithology')

Statistics

python
# Net-to-gross for specific lithology
ntg = strip.net_to_gross(pattern={'lithology': 'sandstone'})
print(f"Sandstone: {ntg * 100:.1f}%")

# Merge adjacent same-lithology intervals
merged = strip.merge_neighbours()

Well Correlation

python
import matplotlib.pyplot as plt

wells = [Striplog.from_csv(f'well{i}.csv') for i in range(1, 4)]
fig, axes = plt.subplots(1, 3, figsize=(10, 8), sharey=True)

for ax, well, name in zip(axes, wells, ['Well 1', 'Well 2', 'Well 3']):
    well.plot(ax=ax, legend=legend)
    ax.set_title(name)

plt.tight_layout()
plt.savefig('correlation.png')

Export

python
strip.to_csv('output.csv')
strip.to_las('output.las')
strip.to_json('output.json')
df = strip.to_dataframe()

Hatch Patterns

PatternCodeTypical Use
Dots...Sandstone
Dashes---Shale
Plus+++Limestone
XxxxDolomite
VvvvVolcanic

Common Issues

IssueSolution
Text not parsingDefine a Lexicon with synonyms
Wrong colorsCreate custom Legend with Decor objects
Gaps in logCheck interval top/base values match
Plot looks wrongVerify depth direction (increasing down)

References

Scripts