striplog
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinesestriplog - Lithological Logs
striplog - 岩性测井日志
Quick Reference
快速参考
python
from striplog import Striplog, Interval, Componentpython
from striplog import Striplog, Interval, ComponentCreate 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()
undefinedprint(strip)
strip.plot()
df = strip.to_dataframe()
undefinedKey Classes
核心类
| Class | Purpose |
|---|---|
| Main log container - holds intervals |
| Depth interval with top, base, and components |
| Rock type definition with properties |
| Rock type dictionary with synonyms |
| Visualization styles (colors, patterns) |
| 类 | 用途 |
|---|---|
| 主日志容器 - 存储测井区间 |
| 包含顶部、底部深度及岩性组件的深度区间 |
| 带属性的岩石类型定义 |
| 含同义词的岩石类型词典 |
| 可视化样式(颜色、图案) |
Essential Operations
关键操作
Create from CSV
从CSV创建
python
undefinedpython
undefinedCSV format: top,base,lithology
CSV格式:top,base,lithology
strip = Striplog.from_csv('lithology.csv')
strip.plot()
undefinedstrip = Striplog.from_csv('lithology.csv')
strip.plot()
undefinedCreate 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
undefinedpython
undefinedGet 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')
undefinedlithologies = strip.unique('lithology')
undefinedStatistics
统计分析
python
undefinedpython
undefinedNet-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()
undefinedmerged = strip.merge_neighbours()
undefinedWell 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
填充图案
| Pattern | Code | Typical Use |
|---|---|---|
| Dots | | Sandstone |
| Dashes | | Shale |
| Plus | | Limestone |
| X | | Dolomite |
| V | | Volcanic |
| 图案 | 代码 | 典型用途 |
|---|---|---|
| 圆点 | | 砂岩 |
| 短横线 | | 页岩 |
| 加号 | | 灰岩 |
| X形 | | 白云岩 |
| V形 | | 火山岩 |
When to Use vs Alternatives
工具选择对比
| Tool | Best For |
|---|---|
| striplog | Structured lithology logs, interval-based data, NTG, correlation |
| welly | Well log curves (continuous data), multi-well projects |
| custom matplotlib | Simple 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
常见问题
| Issue | Solution |
|---|---|
| Text not parsing | Define a Lexicon with synonyms |
| Wrong colors | Create custom Legend with Decor objects |
| Gaps in log | Check interval top/base values match |
| Plot looks wrong | Verify 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