petropy
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChinesePetroPy - Petrophysical Analysis
PetroPy - 岩石物理分析
Quick Reference
快速参考
python
import petropy as pppython
import petropy as ppLoad and inspect
加载并检查数据
log = pp.Log('well.las')
print(log.keys()) # Available curves
depth, gr = log['DEPT'], log['GR']
log = pp.Log('well.las')
print(log.keys()) # 可用曲线
depth, gr = log['DEPT'], log['GR']
Calculate properties
计算物性参数
log.shale_volume(gr_curve='GR', gr_clean=20, gr_shale=120)
log.formation_porosity(rhob_curve='RHOB', rhob_matrix=2.65, rhob_fluid=1.0)
log.water_saturation(method='archie', rt_curve='RT', porosity_curve='PHIT', rw=0.05)
log.permeability(method='timur', porosity_curve='PHIT', sw_curve='SW')
undefinedlog.shale_volume(gr_curve='GR', gr_clean=20, gr_shale=120)
log.formation_porosity(rhob_curve='RHOB', rhob_matrix=2.65, rhob_fluid=1.0)
log.water_saturation(method='archie', rt_curve='RT', porosity_curve='PHIT', rw=0.05)
log.permeability(method='timur', porosity_curve='PHIT', sw_curve='SW')
undefinedKey Classes
核心类
| Class | Purpose |
|---|---|
| Main well log container, extends lasio.LASFile |
| Facies classification utilities |
| Zone/formation management |
| 类名 | 用途 |
|---|---|
| 主要测井数据容器,继承自lasio.LASFile |
| 相分类工具 |
| 层段/地层管理 |
Essential Operations
关键操作
Shale Volume (Vsh)
泥质含量(Vsh)
python
log.shale_volume(
gr_curve='GR',
gr_clean=20, # GR of clean sand (API)
gr_shale=120, # GR of shale (API)
method='linear' # or 'larionov_young', 'larionov_old', 'clavier'
)
vsh = log['VSH']python
log.shale_volume(
gr_curve='GR',
gr_clean=20, # 纯净砂岩的伽马射线值(API)
gr_shale=120, # 泥岩的伽马射线值(API)
method='linear' # 可选方法:'larionov_young', 'larionov_old', 'clavier'
)
vsh = log['VSH']Porosity
孔隙度
python
undefinedpython
undefinedDensity porosity with shale correction
带泥质校正的密度孔隙度
log.formation_porosity(
rhob_curve='RHOB',
rhob_matrix=2.65, # g/cc (sandstone)
rhob_fluid=1.0, # g/cc (water)
rhob_shale=2.45, # optional shale correction
vsh_curve='VSH' # requires VSH curve
)
phi = log['PHIT']
undefinedlog.formation_porosity(
rhob_curve='RHOB',
rhob_matrix=2.65, # 骨架密度(g/cc,砂岩)
rhob_fluid=1.0, # 流体密度(g/cc,水)
rhob_shale=2.45, # 可选泥质校正参数
vsh_curve='VSH' # 需要VSH曲线
)
phi = log['PHIT']
undefinedWater Saturation
含水饱和度
python
log.water_saturation(
method='archie', # or 'simandoux', 'indonesia'
rt_curve='RT',
porosity_curve='PHIT',
rw=0.05, # Formation water resistivity (ohm-m)
a=1.0, m=2.0, n=2.0 # Archie parameters
)
sw = log['SW']python
log.water_saturation(
method='archie', # 可选方法:'simandoux', 'indonesia'
rt_curve='RT',
porosity_curve='PHIT',
rw=0.05, # 地层水电阻率(ohm-m)
a=1.0, m=2.0, n=2.0 # Archie参数
)
sw = log['SW']Permeability
渗透率
python
log.permeability(
method='timur', # or 'coates'
porosity_curve='PHIT',
sw_curve='SW'
)
perm = log['PERM'] # Result in mDpython
log.permeability(
method='timur', # 可选方法:'coates'
porosity_curve='PHIT',
sw_curve='SW'
)
perm = log['PERM'] # 结果单位为mDPay Flag and Net Pay
产层标识与净产层厚度
python
import numpy as np
pay = (log['VSH'] < 0.4) & (log['PHIT'] > 0.08) & (log['SW'] < 0.6)
log['PAY'] = pay.astype(float)
net_pay = np.sum(pay) * log.steppython
import numpy as np
pay = (log['VSH'] < 0.4) & (log['PHIT'] > 0.08) & (log['SW'] < 0.6)
log['PAY'] = pay.astype(float)
net_pay = np.sum(pay) * log.stepExport Results
导出结果
python
log.to_las('well_interpreted.las')python
log.to_las('well_interpreted.las')Or to CSV
或导出为CSV
import pandas as pd
df = pd.DataFrame({'DEPT': log['DEPT'], 'VSH': log['VSH'], 'PHIT': log['PHIT'], 'SW': log['SW']})
df.to_csv('results.csv', index=False)
undefinedimport pandas as pd
df = pd.DataFrame({'DEPT': log['DEPT'], 'VSH': log['VSH'], 'PHIT': log['PHIT'], 'SW': log['SW']})
df.to_csv('results.csv', index=False)
undefinedArchie Parameters
Archie参数
| Parameter | Symbol | Range | Description |
|---|---|---|---|
| Tortuosity | a | 0.6-1.0 | Formation factor coefficient |
| Cementation | m | 1.8-2.2 | Pore geometry factor |
| Saturation exp | n | 1.8-2.2 | Wettability factor |
| 参数 | 符号 | 范围 | 描述 |
|---|---|---|---|
| 迂曲度 | a | 0.6-1.0 | 地层系数 |
| 胶结指数 | m | 1.8-2.2 | 孔隙几何因子 |
| 饱和度指数 | n | 1.8-2.2 | 润湿性因子 |
Matrix Properties
骨架物性参数
| Lithology | rhob (g/cc) | nphi (v/v) | DT (us/ft) |
|---|---|---|---|
| Sandstone | 2.65 | -0.02 | 55.5 |
| Limestone | 2.71 | 0.00 | 47.5 |
| Dolomite | 2.87 | 0.02 | 43.5 |
| Shale | 2.45 | 0.30-0.45 | 70-130 |
| 岩性 | rhob (g/cc) | nphi (v/v) | DT (us/ft) |
|---|---|---|---|
| 砂岩 | 2.65 | -0.02 | 55.5 |
| 石灰岩 | 2.71 | 0.00 | 47.5 |
| 白云岩 | 2.87 | 0.02 | 43.5 |
| 泥岩 | 2.45 | 0.30-0.45 | 70-130 |
When to Use vs Alternatives
工具选择对比
| Tool | Best For |
|---|---|
| petropy | Automated formation evaluation, standard petrophysical workflows |
| welly | Well data management, curve processing, multi-well projects |
| custom calculations | Non-standard equations, full control over methodology |
Use petropy when you need a streamlined formation evaluation pipeline:
Vsh, porosity, Sw, permeability, and pay flags with standard methods (Archie,
Simandoux, Timur). It extends lasio so file I/O is built in.
Use welly instead when your focus is data management, curve QC, and
multi-well projects rather than petrophysical calculations.
Use custom calculations instead when you need non-standard saturation
models, proprietary equations, or more control over the computation steps
than petropy's built-in methods provide.
| 工具 | 适用场景 |
|---|---|
| petropy | 自动化地层评价、标准化岩石物理工作流 |
| welly | 井数据管理、曲线处理、多井项目 |
| 自定义计算 | 非标准方程、完全控制计算方法 |
选择petropy的场景:当你需要一套精简的地层评价流程时,包括泥质含量、孔隙度、含水饱和度、渗透率及产层标识的标准化计算(Archie、Simandoux、Timur方法)。它继承自lasio,内置文件读写功能。
选择welly的场景:当你的工作重点是数据管理、曲线质量控制和多井项目,而非岩石物理计算时。
选择自定义计算的场景:当你需要非标准饱和度模型、专有方程,或需要比petropy内置方法更高的计算控制度时。
Common Workflows
常见工作流
Complete formation evaluation from raw logs
基于原始测井曲线的完整地层评价
- [ ] Load well with `pp.Log('well.las')`, verify required curves exist
- [ ] Pick clean sand and shale GR values from histogram or crossplot
- [ ] Compute shale volume: `log.shale_volume()`
- [ ] Compute porosity: `log.formation_porosity()` with matrix parameters
- [ ] Determine Rw from water zone or catalog; set Archie parameters
- [ ] Compute water saturation: `log.water_saturation()`
- [ ] Compute permeability: `log.permeability()`
- [ ] Apply pay flag cutoffs (Vsh, porosity, Sw) and calculate net pay
- [ ] Export interpreted log to LAS or CSV- [ ] 使用`pp.Log('well.las')`加载井数据,验证所需曲线是否存在
- [ ] 通过直方图或交会图选取纯净砂岩和泥岩的伽马射线值
- [ ] 计算泥质含量:`log.shale_volume()`
- [ ] 结合骨架参数计算孔隙度:`log.formation_porosity()`
- [ ] 通过水层或参数目录确定Rw,设置Archie参数
- [ ] 计算含水饱和度:`log.water_saturation()`
- [ ] 计算渗透率:`log.permeability()`
- [ ] 应用产层标识阈值(泥质含量、孔隙度、含水饱和度)并计算净产层厚度
- [ ] 将解释后的测井数据导出为LAS或CSV格式References
参考资料
- Calculations - Porosity, saturation, and permeability equations
- Fluid Properties - Fluid property models and correlations
- 计算方法 - 孔隙度、饱和度及渗透率计算公式
- 流体物性 - 流体物性模型与相关性
Scripts
脚本
- scripts/formation_evaluation.py - Complete formation evaluation workflow
- scripts/formation_evaluation.py - 完整地层评价工作流脚本