dlisio
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinesedlisio - DLIS/LIS File Reader
dlisio - DLIS/LIS 文件读取器
Quick Reference
快速参考
python
import dlisiopython
import dlisioOpen DLIS file (returns generator of logical files)
打开DLIS文件(返回逻辑文件生成器)
with dlisio.dlis.load('well.dlis') as (f, *rest):
frame = f.frames[0]
curves = frame.curves()
# Access by channel name
depth = curves['DEPTH']
gr = curves['GR']
# File metadata
for origin in f.origins:
print(origin.well_name, origin.field_name)undefinedwith dlisio.dlis.load('well.dlis') as (f, *rest):
frame = f.frames[0]
curves = frame.curves()
# 通过通道名称访问
depth = curves['DEPTH']
gr = curves['GR']
# 文件元数据
for origin in f.origins:
print(origin.well_name, origin.field_name)undefinedKey Classes
核心类
| Class | Purpose |
|---|---|
| Container returned by |
| Independent dataset within physical file |
| Group of channels with common sampling |
| Individual log curve with metadata |
| Well and file metadata |
| 类 | 用途 |
|---|---|
| |
| 物理文件中的独立数据集 |
| 具有共同采样规则的通道组 |
| 带元数据的单个测井曲线 |
| 油井和文件元数据 |
Essential Operations
核心操作
Read Curves to DataFrame
将曲线读取为DataFrame
python
import pandas as pd
with dlisio.dlis.load('well.dlis') as (f, *_):
frame = f.frames[0]
curves = frame.curves()
df = pd.DataFrame(curves)
df.set_index('DEPTH', inplace=True)python
import pandas as pd
with dlisio.dlis.load('well.dlis') as (f, *_):
frame = f.frames[0]
curves = frame.curves()
df = pd.DataFrame(curves)
df.set_index('DEPTH', inplace=True)Access Channel and Origin Metadata
访问通道和来源元数据
python
with dlisio.dlis.load('well.dlis') as (f, *_):
# Origin metadata
for origin in f.origins:
print(f"Well: {origin.well_name}, Field: {origin.field_name}")
# Channel properties
for ch in f.frames[0].channels:
print(f"{ch.name}: {ch.units}, dim={ch.dimension}")python
with dlisio.dlis.load('well.dlis') as (f, *_):
# 来源元数据
for origin in f.origins:
print(f"油井: {origin.well_name}, 油田: {origin.field_name}")
# 通道属性
for ch in f.frames[0].channels:
print(f"{ch.name}: {ch.units}, 维度={ch.dimension}")Find Channels Across Frames
在多帧中查找通道
python
with dlisio.dlis.load('well.dlis') as (f, *_):
# By exact name or regex
channels = f.find('CHANNEL', '.*GR.*', regex=True)
# Find frame containing specific channel
for frame in f.frames:
if 'GR' in [ch.name for ch in frame.channels]:
curves = frame.curves()
breakpython
with dlisio.dlis.load('well.dlis') as (f, *_):
# 通过精确名称或正则表达式
channels = f.find('CHANNEL', '.*GR.*', regex=True)
# 查找包含特定通道的帧
for frame in f.frames:
if 'GR' in [ch.name for ch in frame.channels]:
curves = frame.curves()
breakHandle Array Channels
处理数组通道
python
with dlisio.dlis.load('well.dlis') as (f, *_):
curves = f.frames[0].curves()
for name, data in curves.items():
if data.ndim > 1:
print(f"{name}: shape = {data.shape}") # Image/waveformpython
with dlisio.dlis.load('well.dlis') as (f, *_):
curves = f.frames[0].curves()
for name, data in curves.items():
if data.ndim > 1:
print(f"{name}: 形状 = {data.shape}") # 图像/波形Common Object Types
常见对象类型
| Object Type | Description |
|---|---|
| ORIGIN | File/well metadata |
| FRAME | Channel grouping with index |
| CHANNEL | Log curve definition |
| TOOL | Logging tool info |
| PARAMETER | Constants and settings |
| 对象类型 | 描述 |
|---|---|
| ORIGIN | 文件/油井元数据 |
| FRAME | 带索引的通道组 |
| CHANNEL | 测井曲线定义 |
| TOOL | 测井工具信息 |
| PARAMETER | 常量与设置 |
Common Curve Names
常见曲线名称
| Curve | Description |
|---|---|
| DEPT, DEPTH, TDEP | Depth curves |
| GR | Gamma ray |
| NPHI | Neutron porosity |
| RHOB | Bulk density |
| DT, DTC | Compressional slowness |
| RT, ILD | Resistivity |
| 曲线 | 描述 |
|---|---|
| DEPT, DEPTH, TDEP | 深度曲线 |
| GR | 伽马射线 |
| NPHI | 中子孔隙度 |
| RHOB | 体积密度 |
| DT, DTC | 纵波时差 |
| RT, ILD | 电阻率 |
Error Handling
错误处理
python
dlisio.dlis.set_encodings(['utf-8', 'latin-1'])
try:
with dlisio.dlis.load('file.dlis') as files:
for f in files:
curves = f.frames[0].curves()
except Exception as e:
print(f"Error: {e}")python
dlisio.dlis.set_encodings(['utf-8', 'latin-1'])
try:
with dlisio.dlis.load('file.dlis') as files:
for f in files:
curves = f.frames[0].curves()
except Exception as e:
print(f"错误: {e}")DLIS vs LAS Comparison
DLIS 与 LAS 对比
| Feature | DLIS | LAS |
|---|---|---|
| Format | Binary | ASCII |
| Multi-frame | Yes | No |
| Array data | Yes | Limited |
| Metadata | Rich | Basic |
| 特性 | DLIS | LAS |
|---|---|---|
| 格式 | 二进制 | 纯文本 |
| 多帧支持 | 是 | 否 |
| 数组数据 | 是 | 有限支持 |
| 元数据 | 丰富 | 基础 |
When to Use vs Alternatives
适用场景与替代工具对比
| Tool | Best For |
|---|---|
| dlisio | Reading DLIS/RP66 binary files, multi-frame data, image logs |
| lasio | LAS (ASCII) well log files, simpler format, widely supported |
| welly | Higher-level well data management, curve processing, projects |
Use dlisio when your data is in DLIS (RP66) format. DLIS files are common
from modern logging tools and contain multi-frame, array, and image data that
LAS cannot represent.
Use lasio instead when your data is in LAS format. LAS is ASCII-based,
simpler, and more widely supported. Convert DLIS to LAS when downstream
tools require it.
Use welly instead when you need well-level data management with curve
processing, formation tops, and multi-well projects after initial file loading.
| 工具 | 最佳适用场景 |
|---|---|
| dlisio | 读取DLIS/RP66二进制文件、多帧数据、图像测井 |
| lasio | LAS(纯文本)测井文件、更简单的格式、广泛支持 |
| welly | 更高层级的油井数据管理、曲线处理、项目级操作 |
当数据为DLIS(RP66)格式时使用dlisio。DLIS文件常见于现代测井工具,包含LAS无法表示的多帧、数组和图像数据。
当数据为LAS格式时使用lasio。LAS基于纯文本,更简单且支持更广泛。当下游工具需要LAS格式时,可将DLIS转换为LAS。
当初始文件加载后需要油井级数据管理、曲线处理、层位顶界和多油井项目操作时使用welly。
Common Workflows
常见工作流
Read and convert DLIS to DataFrame
读取并将DLIS转换为DataFrame
- [ ] Load file with `dlisio.dlis.load()`, handle encoding if needed
- [ ] List logical files and frames to understand file structure
- [ ] Inspect channels: names, units, dimensions per frame
- [ ] Extract curves from target frame with `frame.curves()`
- [ ] Handle array/image channels separately (ndim > 1)
- [ ] Convert scalar curves to DataFrame with `pd.DataFrame(curves)`
- [ ] Export to CSV or convert to LAS format- [ ] 使用`dlisio.dlis.load()`加载文件,必要时处理编码
- [ ] 列出逻辑文件和帧以了解文件结构
- [ ] 检查通道:各帧的通道名称、单位、维度
- [ ] 使用`frame.curves()`从目标帧提取曲线
- [ ] 单独处理数组/图像通道(ndim > 1)
- [ ] 使用`pd.DataFrame(curves)`将标量曲线转换为DataFrame
- [ ] 导出为CSV或转换为LAS格式References
参考资料
- DLIS File Structure - RP66 format specification
- Frames and Channels - Working with frames and channels
- DLIS文件结构 - RP66格式规范
- 帧与通道 - 帧与通道的使用指南
Scripts
脚本
- scripts/dlis_to_las.py - Convert DLIS to LAS format
- scripts/dlis_to_las.py - 将DLIS转换为LAS格式