petropy

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

PetroPy - Petrophysical Analysis

PetroPy - 岩石物理分析

Quick Reference

快速参考

python
import petropy as pp
python
import petropy as pp

Load 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')
undefined
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')
undefined

Key Classes

核心类

ClassPurpose
Log
Main well log container, extends lasio.LASFile
electrofacies
Facies classification utilities
Formations
Zone/formation management
类名用途
Log
主要测井数据容器,继承自lasio.LASFile
electrofacies
相分类工具
Formations
层段/地层管理

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
undefined
python
undefined

Density 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']
undefined
log.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']
undefined

Water 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 mD
python
log.permeability(
    method='timur',        # 可选方法:'coates'
    porosity_curve='PHIT',
    sw_curve='SW'
)
perm = log['PERM']         # 结果单位为mD

Pay 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.step
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.step

Export 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)
undefined
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)
undefined

Archie Parameters

Archie参数

ParameterSymbolRangeDescription
Tortuositya0.6-1.0Formation factor coefficient
Cementationm1.8-2.2Pore geometry factor
Saturation expn1.8-2.2Wettability factor
参数符号范围描述
迂曲度a0.6-1.0地层系数
胶结指数m1.8-2.2孔隙几何因子
饱和度指数n1.8-2.2润湿性因子

Matrix Properties

骨架物性参数

Lithologyrhob (g/cc)nphi (v/v)DT (us/ft)
Sandstone2.65-0.0255.5
Limestone2.710.0047.5
Dolomite2.870.0243.5
Shale2.450.30-0.4570-130
岩性rhob (g/cc)nphi (v/v)DT (us/ft)
砂岩2.65-0.0255.5
石灰岩2.710.0047.5
白云岩2.870.0243.5
泥岩2.450.30-0.4570-130

When to Use vs Alternatives

工具选择对比

ToolBest For
petropyAutomated formation evaluation, standard petrophysical workflows
wellyWell data management, curve processing, multi-well projects
custom calculationsNon-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 - 完整地层评价工作流脚本