striplog

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

striplog - Lithological Logs

striplog - 岩性测井日志

Quick Reference

快速参考

python
from striplog import Striplog, Interval, Component
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)
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
strip = Striplog.from_csv('lithology.csv') # 列:top, base, lithology

Access and display

访问与展示

print(strip) strip.plot() df = strip.to_dataframe()
undefined
print(strip) strip.plot() df = strip.to_dataframe()
undefined

Key Classes

核心类

ClassPurpose
Striplog
Main log container - holds intervals
Interval
Depth interval with top, base, and components
Component
Rock type definition with properties
Lexicon
Rock type dictionary with synonyms
Legend
Visualization styles (colors, patterns)
用途
Striplog
主日志容器 - 存储测井区间
Interval
包含顶部、底部深度及岩性组件的深度区间
Component
带属性的岩石类型定义
Lexicon
含同义词的岩石类型词典
Legend
可视化样式(颜色、图案)

Essential Operations

关键操作

Create from CSV

从CSV创建

python
undefined
python
undefined

CSV format: top,base,lithology

CSV格式:top,base,lithology

strip = Striplog.from_csv('lithology.csv') strip.plot()
undefined
strip = Striplog.from_csv('lithology.csv') strip.plot()
undefined

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)
python
from striplog import Striplog, Lexicon

description = """
0.0 - 5.5 m: 细至中粒砂岩
5.5 - 12.0 m: 灰色页岩,含粉砂纹层
12.0 - 18.5 m: 块状灰岩,含化石
"""
strip = Striplog.from_description(description, lexicon=lexicon)

Query and Extract

查询与提取

python
undefined
python
undefined

Get interval at depth

获取指定深度的区间

interval = strip.read_at(z=15) print(interval.primary.lithology)
interval = strip.read_at(z=15) print(interval.primary.lithology)

Crop to depth range

裁剪至指定深度范围

subset = strip.crop((10, 30))
subset = strip.crop((10, 30))

Unique lithologies

获取独特岩性类型

lithologies = strip.unique('lithology')
undefined
lithologies = strip.unique('lithology')
undefined

Statistics

统计分析

python
undefined
python
undefined

Net-to-gross for specific lithology

特定岩性的净毛比

ntg = strip.net_to_gross(pattern={'lithology': 'sandstone'}) print(f"Sandstone: {ntg * 100:.1f}%")
ntg = strip.net_to_gross(pattern={'lithology': 'sandstone'}) print(f"砂岩净毛比: {ntg * 100:.1f}%")

Merge adjacent same-lithology intervals

合并相邻相同岩性的区间

merged = strip.merge_neighbours()
undefined
merged = strip.merge_neighbours()
undefined

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')
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()
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
X
xxx
Dolomite
V
vvv
Volcanic
图案代码典型用途
圆点
...
砂岩
短横线
---
页岩
加号
+++
灰岩
X形
xxx
白云岩
V形
vvv
火山岩

When to Use vs Alternatives

工具选择对比

ToolBest For
striplogStructured lithology logs, interval-based data, NTG, correlation
wellyWell log curves (continuous data), multi-well projects
custom matplotlibSimple one-off stratigraphic columns without interval logic
Use striplog when you need to represent geological intervals (lithology, facies) as structured objects with querying, statistics, and correlation.
Use welly instead when working with continuous well log curves (GR, RHOB). Welly and striplog complement each other -- welly for curves, striplog for lithology intervals.
Use custom matplotlib instead for simple, one-off stratigraphic columns where you don't need interval querying or net-to-gross calculations.
工具适用场景
striplog结构化岩性日志、区间数据、净毛比计算、井间对比
welly测井曲线(连续数据)、多井项目
自定义matplotlib无需区间逻辑的简单一次性地层柱状图
当你需要将地质区间(岩性、相)表示为可查询、可统计、可对比的结构化对象时,使用striplog。
当处理连续测井曲线(如GR、RHOB)时,使用welly。 welly与striplog可互补使用——welly处理曲线数据,striplog处理岩性区间数据。
当你仅需制作简单的一次性地层柱状图,且不需要区间查询或净毛比计算时,使用自定义matplotlib。

Common Workflows

常见工作流

Create lithological log from CSV data

从CSV数据创建岩性测井日志

- [ ] Prepare CSV with columns: top, base, lithology (optionally color)
- [ ] Load with `Striplog.from_csv('lithology.csv')`
- [ ] Define Legend with colors and hatch patterns for each lithology
- [ ] Verify intervals: check for gaps or overlaps
- [ ] Merge adjacent same-lithology intervals with `merge_neighbours()`
- [ ] Compute statistics: `net_to_gross()`, `unique()`
- [ ] Plot with legend and export to desired format
- [ ] 准备CSV文件,包含列:top, base, lithology(可选color)
- [ ] 使用`Striplog.from_csv('lithology.csv')`加载数据
- [ ] 定义Legend,为每种岩性设置颜色和填充图案
- [ ] 验证区间:检查是否存在间隙或重叠
- [ ] 使用`merge_neighbours()`合并相邻相同岩性的区间
- [ ] 计算统计数据:`net_to_gross()`、`unique()`
- [ ] 结合图例绘制图表并导出为所需格式

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)
问题解决方案
文本解析失败定义包含同义词的Lexicon
颜色显示错误使用Decor对象创建自定义Legend
日志存在间隙检查区间顶部/底部数值是否匹配
图表显示异常验证深度方向(是否向下递增)

References

参考资料

  • Lexicon Configuration - Rock type dictionaries and synonyms
  • Component Definitions - Properties and multi-attribute intervals
  • Lexicon配置 - 岩石类型词典与同义词
  • Component定义 - 属性与多属性区间

Scripts

脚本

  • scripts/create_striplog.py - Create striplog from CSV or text data
  • scripts/create_striplog.py - 从CSV或文本数据创建striplog