Log

class petropy.Log(file_ref=None, drho_matrix=2.71, **kwargs)[source]

Subclass of LASFile to provide an extension for all petrophysical calculations.

Parameters:
  • file_ref (str) – str path to las file
  • drho_matrix (float (default 2.71)) – Matrix density for conversion from density porosity to density.
  • kwargs (kwargs) – Key Word arguements for use with lasio LASFile class.

Example

>>> import petropy as ptr
# define path to las file
>>> p = 'path/to/well.las'
# loads specified las file
>>> log = ptr.Log(p)
add_pay_flag(formations=[], flag=1, less_than_or_equal=[], greater_than_or_equal=[], name='', descr='Pay Flag')[source]

Add Pay Flag based on curve cutoffs

Parameters:
  • formations (list (default [])) – list of formations, which must be found in preloaded tops
  • flag (float) – Numeric value of pay flag. If interval meets pay requirments, then flag value. Else, 0.
  • less_than_or_equal (list (tuples (CURVE, value),default [])) – pay flag cutoff where interval is flaged if CURVE is less than or equal to value. Must be list of tuples
  • greater_than_or_equal (list (tuples (CURVE,value), default [])) – pay flag cutoff where interval is flaged if CURVE is greater than or equal to value. Must be list of tuples
  • name (str (default '')) – End name of pay flag. Defaults to numeric PAY_FLAG_1 and increasing values as more pays flags are added.

Example

>>> import petropy as ptr
# loads Wolfcamp and adds pay flag
# based on resistivity
#
# reads sample Wolfcamp Log from las file
>>> log = ptr.log_data('WFMP')
# specify play flag if RESDEEP_N is
# greather than or equal to 20
>>> gtoe = [('RESDEEP_N', 20)]
# define formations to calculate pay flag
>>> f = ['WFMPA', 'WFMPB', 'WFMPC']
# add pay flag over formations
>>> log.add_pay_flag(f, greater_than_or_equal=gtoe,name ='RES')
fluid_properties(top=0, bottom=100000, mast=67, temp_grad=0.015, press_grad=0.5, rws=0.1, rwt=70, rmfs=0.4, rmft=100, gas_grav=0.67, oil_api=38, p_sep=100, t_sep=100, yn2=0, yco2=0, yh2s=0, yh20=0, rs=0, lith_grad=1.03, biot=0.8, pr=0.25)[source]

Calculates fluid properties along wellbore.

The output add the following calculated curves at each depth:

PORE_PRESS : (psi)
Reservoir pore pressure
RES_TEMP : (°F)
Reservoir temperature
NES : (psi)
Reservoir net effective stress
RW : (ohm.m)
Resistivity of water
RMF : (ohm.m)
Resistivity of mud filtrate
RHO_HC : (g / cc)
Density of hydrocarbon
RHO_W : (g / cc)
Density of formation water
RHO_MF : (g / cc)
Density of mud filtrate
NPHI_HC
Neutron log response of hydrocarbon
NPHI_W
Neutron log response of water
NPHI_MF
Neutron log response of mud filtrate
MU_HC : (cP)
Viscosity of hydrocarbon
Z
Compressiblity factor for non-ideal gas. Only output if oil_api = 0
CG : (1 / psi)
Gas Compressiblity. Only output if oil_api = 0
BG
Gas formation volume factor. Only output if oil_api = 0
BP : (psi)
Bubble point. Only output if oil_api > 0
BO
Oil formation volume factor. Only output if oil_api > 0
Parameters:
  • top (float (default 0)) – The top depth to begin fluid properties calculation. If value is not specified, the calculations will start at the top of the log.
  • bottom (float (default 100,000)) – The bottom depth to end fluid properties, inclusive. If the value is not specified, the calcuations will go to the end of the log.
  • mast (float (default 67)) – The mean annual surface temperature at the location of the well in degrees Fahrenheit.
  • temp_grad (float (default 0.015)) – The temperature gradient of the reservoir in °F / ft.
  • press_grad (float (default 0.5)) – The pressure gradient of the reservoir in psi / ft.
  • rws (float (default 0.1)) – The resistivity of water at surface conditions in ohm.m.
  • rwt (float (default 70)) – The temperature of the rws measurement in °F.
  • rmfs (float (default 0.4)) – The resistivity of mud fultrate at surface conditions in ohm.m
  • rmft (float (default 100)) – The temperature of the rmfs measurement in °F
  • gas_grav (float (default 0.67)) – The specific gravity of the separator gas. Air = 1, CH4 = 0.577
  • oil_api (float (default 38)) – The api gravity of oil after the separator If fluid system is dry gas, use oil_api = 0.
  • p_sep (float (default 100)) – The pressure of the separator, assuming a 2 stage system Only used when oil_api is > 0 (not dry gas).
  • t_sep (float) – The temperature of the separator, assuming a 2 stage system Only used with oil_api > 0.
  • yn2 (float (default 0)) – Molar fraction of nitrogren in gas.
  • yco2 (float (default 0)) – Molar fration of carbon dioxide in gas.
  • yh2s (float (default 0)) – Molar fraction of hydrogen sulfide in gas.
  • yh20 (float (default 0)) – Molar fraction of water in gas.
  • rs (float (default 0)) – Solution gas oil ratio at reservoir conditions. If unknwon, use 0 and correlation will be used.
  • lith_grad (float (default 1.03)) – Lithostatic overburden pressure gradient in psi / ft.
  • biot (float (default 0.8)) – Biot constant.
  • pr (float (default 0.25)) – Poissons ratio

Note

Current single phase fluid properties assumes either:

1. Dry Gas at Reservoir Conditions Methane as hydrocarbon type with options to include N2, CO2, H2S, or H2O. To assume dry_gas, set oil_api = 0

2. Oil at Reservoir Conditions Assumes reservoir fluids are either a black or volatile oil. Separator conditions of gas are used to calculate bubble point and the reservoir fluid properties of the reconstituted oil.

References

Ahmed, Tarek H. Reservoir Engineering Handbook. Oxford: Gulf
Professional, 2006.
Lee, John, and Robert A. Wattenbarger. Gas Reservoir
Engineering. Richardson, TX: Henry L. Doherty Memorial Fund of AIME, Society of Petroleum Engineers, 2008.

Example

>>> import petropy as ptr
>>> from petropy import datasets
# reads sample Wolfcamp Log from las file
>>> log = ptr.log_data('WFMP')
# calculates fluid properties with default settings
>>> log.fluid_properties()

See also

petropy.Log.fluid_properties_parameters_from_csv()
loads properties from preconfigured csv file
petropy.Log.multimineral_model()
builds on fluid properties to calculate full petrophysical model
fluid_properties_parameters_from_csv(csv_path=None)[source]

Reads parameters from a csv for input into fluid properties.

This method reads the file located at the csv_path and turns the values into dictionaries to be used as inputs into the fluid_properties method.

This reference is a sample csv file with default data for fluid properties.

Parameters:csv_path (str (default None)) –

Note

Path to csv file to read. Must contain header row with the following properties

mast : float (default 67)
The mean annual surface temperature at the location of the well in degrees Fahrenheit.
temp_grad : float (default 0.015)
The temperature gradient of the reservoir in °F / ft.
press_grad : float (default 0.5)
The pressure gradient of the reservoir in psi / ft.
rws : float (default 0.1)
The resistivity of water at surface conditions in ohm.m
rwt : float (default 70)
The temperature of the rws measurement in °F.
rmfs : float (default 0.4)
The resistivity of mud fultrate at surface conditions in ohm.m
rmft : float (default 100)
The temperature of the rmfs measurement in °F.
gas_grav : float (default 0.67)
The specific gravity of the separator gas. Air = 1, CH4 = 0.577
oil_api : float (default 38)
The api gravity of oil after the separator. If fluid system is dry gas, use oil_api = 0.
p_sep : float (default 100)
The pressure of the separator, assuming a 2 stage system. Only used when oil_api is > 0 (not dry gas).
t_sep : float
The temperature of the separator , assuming a 2 stage system. Only used with oil_api > 0.
yn2 : float (default 0)
Molar fraction of nitrogren in gas.
yco2 : float (default 0)
Molar fration of carbon dioxide in gas.
yh2s : float (default 0)
Molar fraction of hydrogen sulfide in gas.
yh20 : float (default 0)
Molar fraction of water in gas.
rs : float (default 0)
Solution gas oil ratio at reservoir conditions. If unknwon, use 0 and correlation will be calculated.
lith_grad : float (default 1.03)
Lithostatic gradient in psi / ft.
biot : float (default 0.8)
Biot constant.
pr : float (default 0.25)
Poissons ratio

Examples

>>> import petropy as ptr
# reads sample Wolfcamp Log from las file
>>> log = ptr.log_data('WFMP')
# loads sample parameters provided
>>> log.fluid_properties_parameters_from_csv()
>>> import petropy as ptr
# reads sample Wolfcamp Log from las file
>>> log = ptr.log_data('WFMP')
# define path to csv file with parameters
>>> my_csv_paramters = 'path/to/csv/file.csv'
# loads specified parameters
>>> log.fluid_properties_parameters_from_csv(my_csv_paramters)

See also

petropy.Log.fluid_properties()
Calculates fluid properties using input settings loaded through this method
formation_fluid_properties(formations, parameter='default')[source]

Calculate fluid properties over formations with preloaded paramters

Parameters:
  • formations (list) – list of formations to calculate fluid properties over
  • parameter (str (default 'default')) – name of parameter to use for fluid properties parameter settings loaded in method fluid_properties_parameters_from_csv

Example

>>> import petropy as ptr
# reads sample Wolfcamp Log from las file
>>> log = ptr.log_data('WFMP')
# loads sample parameters provided
>>> log.fluid_properties_parameters_from_csv()
# define formations to run
>>> f = ['WFMPA', 'WFMPB', 'WFMPC']
# use WFMP parameters for formations from f
>>> log.formation_fluid_properties(f, parameter = 'WFMP')

See also

petropy.Log.fluid_properties()
calculates fluid properties of log
petropy.Log.fluid_properties_parameters_from_csv()
loads fluid properties parameters
petropy.Log.tops_from_csv()
loads tops of log from csv
formation_multimineral_model(formations, parameter='default')[source]

Calculate multimineral model over formations with loaded paramters

Parameters:
  • formations (list) – list of formations to calculate fluid properties over
  • parameter (str (default 'default')) – name of parameter to use for fluid properties parameter settings loaded in method fluid_properties_parameters_from_csv

Example

>>> import petropy as ptr
# reads sample Wolfcamp Log from las file
>>> log = ptr.log_data('WFMP')
>>> f = ['WFMPA', 'WFMPB', 'WFMPC']
# calculates fluid properties for formations
# WFMPA, WFMPB, and WFMPC with default settings
>>> log.formation_fluid_properties(f)
# calculates multimineral model for formations
# WFMPA, WFMPB, and WFMPC with default settings
>>> log.formation_multimineral_model(f)

See also

petropy.Log.multimineral_model()
calculates multimineral model from log data
petropy.Log.multimineral_parameters_from_csv()
loads multimineral model parameters
petropy.Log.tops_from_csv()
loads tops of log from csv
multimineral_model(top=None, bottom=None, gr_matrix=10, nphi_matrix=0, gr_clay=350, rho_clay=2.64, nphi_clay=0.65, pe_clay=4, rma=180, rt_clay=80, vclay_linear_weight=1, vclay_clavier_weight=0.5, vclay_larionov_weight=0.5, vclay_nphi_weight=1, vclay_nphi_rhob_weight=1, vclay_cutoff=0.1, rho_om=1.15, nphi_om=0.6, pe_om=0.2, ro=1.6, lang_press=670, passey_nphi_weight=1, passey_rhob_weight=1, passey_lom=10, passey_baseline_res=40, passey_baseline_rhob=2.65, passey_baseline_nphi=0, schmoker_weight=1, schmoker_slope=0.7257, schmoker_baseline_rhob=2.6, rho_pyr=5, nphi_pyr=0.13, pe_pyr=13, om_pyrite_slope=0.2, include_qtz='YES', rho_qtz=2.65, nphi_qtz=-0.04, pe_qtz=1.81, include_clc='YES', rho_clc=1.71, nphi_clc=0, pe_clc=5.08, include_dol='YES', rho_dol=2.85, nphi_dol=0.04, pe_dol=3.14, include_x='NO', name_x='Gypsum', name_log_x='GYP', rho_x=2.35, nphi_x=0.507, pe_x=4.04, pe_fl=0, m=2, n=2, a=1, archie_weight=0, indonesia_weight=1, simandoux_weight=0, modified_simandoux_weight=0, waxman_smits_weight=0, cec=-1, buckles_parameter=-1)[source]

Calculates a petrophysical lithology and porosity model for conventional and unconventional reservoirs. For each depth, the method iterates in a 4 step loop until convergence.

1. Calculate Clay Volume

Clay volume is calculated using a weighted method. Five different equations are available

  1. Linear
\[ \begin{align}\begin{aligned}gr\_index &= \frac{GR_LOG - gr\_matrix} {gr\_clay - gr_matrix}\\VCLAY &= gr\_index\end{aligned}\end{align} \]
  1. Clavier
\[VCLAY = 1.7 - \sqrt{3.38 - (gr\_index + 0.7)^2}\]
  1. Larionov Tertiary Rocks
\[VCLAY = 0.083 * (2^{3.7 * gr\_index} - 1)\]

IV. Neutron Calculate apparent nuetron log without organic matter, nphia.

\[nphia = NPHI\_LOG + (nphi\_matrix - nphi\_om) * vom\]

Calculate vclay using neutron

\[VCLAY = \frac{nphia - nphi\_matrix} {nphi\_clay - nphi\_matrix}\]
  1. Neutron Density

Calculate apprent density log without organic mater, rhoba.

\[rhoba = RHOB\_LOG + (rhom - rho\_om) * vom\]

Calculate vclay using neutron density

\[\begin{split}m1 &= \frac{nphi\_fl - nphi\_matrix}{rho\_fl - rhom} \\ x1 &= nphi + m1 * (rhom - rhoba) \\ x2 &= nphi\_clay + m1 * (rhom - rhoba) \\ VCLAY &= \frac{x1 - nphi\_matrix}{x2 - nphi\_matrix} \\\end{split}\]

First, the clay volume of the resepective euqations are calculated. They are then weighted with the vclay_weight. For example, if vclay_weight for every method is 1, then the final vclay is the average of the four equations. To use a single method, set vclay_method_weight = 1 and all other vclay_weight = 0.

2. Calculate Total Organic Carbon And Pyrite

TOC is calculated use a weighted method like vclay with three available equations:

  1. Schomker’s Density Correlation
\[TOC = schmoker\_slope*(schmoker\_baseline\_rhob-RHOB\_LOG)\]
  1. Passey’s Nuetron Delta Log R
\[ \begin{align}\begin{aligned}dlr &= 10^{\frac{RESDEEP\_LOG}{passey\_baseline\_res}} + 4 * (NPHI\_LOG - passey\_baseline\_nphi)\\TOC&=\frac{dlr\_nphi * 10^{2.297 - 0.1688 * passey\_lom}} {100}\end{aligned}\end{align} \]
  1. Passey’s Density Delta Log R
\[ \begin{align}\begin{aligned}dlr &= 10^{\frac{RESDEEP\_LOG}{passey\_baseline\_res}} - 2.5 * (RHOB\_LOG - passey\_baseline\_rhob)\\TOC&=\frac{dlr\_nphi * 10^{2.297 - 0.1688 * passey\_lom}} {100}\end{aligned}\end{align} \]

For conventional reservoirs without organics, set vclay_cutoff = 1.

3. Calculate Minerals And Porosity

Non-negative least squares is used to find the remaining minerals according to the method described in Chapter 4 of Doveton’s Principles of Mathematical Petrophysics.

\[V = C^{-1} L\]

Pure mineral log responses are required. For example, quartz would have the input:

include_qtz = 'YES'
rho_qtz = 2.65
nphi_qtz = -0.04
pe_qtz = 1.81

An option to include exotic minerals is by specifiying the density, neutron, and pe response of mineral ‘X’. For example, to add gypsum, use these parameters:

include_x = 'YES'
name_x = 'Gypsum'
name_log_x = 'GYP'
rho_x = 2.35
nphi_x = 0.507
pe_x = 4.04

To exclude minerals because they are not present or essentially not present in the reservoir, set the include parameter to ‘NO’. For example, to exclude dolomite:

include_dol = 'NO'
  1. Calculate Saturations

Saturation is calculated using a weighted method like vclay and toc. To use a single equation set equation_weight = 1 and all other equation_weight = 0. For example, to use only the Indonesia equation set parameters to:

archie_weight = 0
simandoux_weight = 0
modified_simandoux_weight = 0
indonesia_weight = 1
waxman_smits_weight = 0

Five saturation equations are available

  1. Archie
\[SW=\left(\frac{a \times RW\_LOG} {RESDEEP\_LOG \times phie^m} \right)^{\frac{1}{n}}\]
  1. Simandoux
\[ \begin{align}\begin{aligned}c &= \frac{(1 - vclay) \times a \times RESDEEP\_LOG} {phie^m}\\d &= \frac{c \times vclay}{2 \times rt\_clay}\\e &= \frac{c}{RESDEEP\_LOG}\\SW &= ((d^2 + e)^2 - d)^{\frac{2}{n}}\end{aligned}\end{align} \]
  1. Modified Simandoux
  2. Indonesia (Poupon-Leveaux)
\[\begin{split}f &= \sqrt{\frac{phie^m}{RESDEEP\_LOG}} \\ g &= \sqrt{\frac{vclay^{2 - vclay}}{rt\_clay}} \\ SW &= ((f + g)^2 * RESDEEP\_LOG)^{\frac{-1}{n}}\end{split}\]
  1. Waxman And Smits
CEC

if cec <= 0

\[cec = 10^{1.9832 \times vclay - 2.4473}\]
else
use input cec

SW

\[ \begin{align}\begin{aligned}rw77&=RESDEEP\_LOG * \frac{reservoir\_temperature + 6.8} {83.8}\\b &= 4.6 * (1 - 0.6 \times e^{\frac{-0.77}{rw77}})\\f &= \frac{a}{phie^m}\\qv &= \frac{cec (1 - phie) rhom}{phie}\\SW &= 0.5 * \left((-b \times qv \times rw77) + \sqrt{(b \times qv \times rw77)^2 + \frac{4 * f * rw}{RESDEEP\_LOG}} \right)^{\frac{2}{n}}\end{aligned}\end{align} \]

4. Update Fluid Properties

\[ \begin{align}\begin{aligned}rho\_fl &= RHO\_W \times Sw + RHO\_HC \times (1 - Sw)\\nphi\_fl &= NPHI\_W \times Sw + NPHI\_HC \times (1 - Sw)\end{aligned}\end{align} \]
Parameters:
  • gr_matrix (float (default 10)) – Gamma Ray response of clean (non-clay) matrix
  • nphi_matrix (float (default 0)) – Neutron response of clean (non-clay) matrix
  • gr_clay (float (default 450)) – Gamma Ray response of pure clay matrix
  • rho_clay (float (default 2.64)) – Density of pure clay matrix
  • nphi_clay (float (default 0.65)) – Neutron reponse of pure clay matrix
  • pe_clay (float (default 4)) – Photoelectric response of pure clay matrix
  • rma (float (default 180)) – Resistivity of clean tight matrix
  • rt_clay (float (default 80)) – Resistivity for inorganic shale matrix
  • vclay_linear_weight (float (default 1)) – Weight of liner clay volume
  • vclay_clavier_weight (float (defaul 0.5)) – Weight of Clavier clay volume
  • vclay_larionov_weight (float (defaul 0.5)) – Weight of Larionov clay volume
  • vclay_nphi_weight (float (default 1)) – Weight of Neutron clay volume
  • vclay_nphi_rhob_weight (float (default 1)) – Weight of Neutron Density clay volume
  • vclay_cutoff (float (default 0.05)) – Cutoff for oranics calculation. If vclay < vclay_cutoff then toc = 0
  • rho_om (float (default 1.15)) – Density of organic matter
  • nphi_om (float (default 0.6)) – Neutron response of pure organic matter
  • pe_om (float (default 0.2)) – Photoelectric response of pure organic matter
  • ro (float (default 1.6)) – Vitronite reflectance of organic matter
  • lang_press (float (default 670)) – Langmiur pressure gas adsorption on organic matter in psi
  • passey_nphi_weight (float (default 1)) – Weight for Passey nphi toc
  • passey_rhob_weight (float (default 1)) – Weight for Passey rhob toc
  • passey_lom (float (default 10)) – Passey level of organic maturity
  • passey_baseline_res (float (default 40)) – Passey inorganic baseline resistivity
  • passey_baseline_rhob (float (default 2.65)) – Passey inorganic baseline density
  • passey_baseline_nphi (float (default 0)) – Passey inorganic baseline neutron
  • schmoker_weight (float (default 1)) – Weight for Schmoker toc
  • schmoker_slope (float (default 0.7257)) – Slope for schmoker density to toc correlation
  • schmoker_baseline_rhob (float (default 2.6)) – Density cutoff for schmoker toc correlation
  • rho_pyr (float (default 5)) – Density of pyrite
  • nphi_pyr (float (default 0.13)) – Neutron response of pure pyrite
  • pe_pyr (float (default 13)) – Photoelectric response of pure pyrite
  • om_pyrite_slope (float (default 0.2)) – Slope correlating pyrite volume to organic matter
  • include_qtz (str {'YES', 'NO'} (default 'YES')) – Toggle to include or exclude qtz. ‘YES’ to include. ‘NO’ to exclude.
  • rho_qtz (float (default 2.65)) – Density of quartz
  • nphi_qtz (float (default -0.04)) – Neutron response for pure quartz
  • pe_qtz (float (default 1.81)) – Photoelectric response for pure quartz
  • include_clc (str {'YES', 'NO'} (default 'YES')) – Toggle to include or exclude clc. ‘YES’ to include. ‘NO’ to exclude.
  • rho_clc (float (default 2.71)) – Density of calcite
  • nphi_clc (float (default 0)) – Neutron response for pure calcite
  • pe_clc (float (default 5.08)) – Photoelectric response for pure calcite
  • include_dol (str {'YES', 'NO'} (default 'YES')) – Toggle to include or exclude dol. ‘YES’ to include. ‘NO’ to exclude.
  • rho_dol (float (default 2.85)) – Density of dolomite
  • nphi_dol (float (default 0.04)) – Neutron response to dolomite
  • pe_dol (float (default 3.14)) – Photoelectric response to dolomite
  • include_x (str {'YES', 'NO'} (default 'NO')) – Toggle to include or exclude exotic mineral, x. ‘YES’ to include. ‘NO’ to exclude.
  • name_x (str (default 'Gypsum')) – Name of exotic mineral, x.
  • name_log_x (str (default 'GYP')) – Log name of exotic mineral, x
  • rho_x (float (default 2.35)) – Density of exotic mineral, x
  • nphi_x (float (default 0.507)) – Neutron response of exotic mineral, x
  • pe_x (float (default 4.04)) – Photoelectric respone of exotic mineral, x
  • pe_fl (float (default 0)) – Photoelectric response of reservoir fluid.
  • m (float (default 2)) – Cementation exponent
  • n (float (default 2)) – Saturation exponent
  • a (float (default 1)) – Cementation constant
  • cec (float (default -1)) – Cation Exchange Capaticy for use in Waxman Smits equation. If cec = -1, correlation equation is used to calculate cec.
  • archie_weight (float (default 0)) – Weight for archie Sw
  • indonesia_weight (float (default 1)) – Weight for Indonesia Sw
  • simandoux_weight (float (default 0)) – Weight for Simandoux Sw
  • modified_simandoux_weight (float (default 0)) – Weight for Modified Simandoux Sw
  • waxman_smits_weight (float (default 0)) – Weight for Waxman Smits Sw
  • buckles_parameter (float (default -1)) – Buckles parameter for calculating irreducible water saturation. If less than 0, it is calculated using a correlation.
Raises:
  • ValueError – If fluid properties curve values are not present in log, then ValueError is raised with incorrect curve requirements
  • ValueError – If raw curves GR_N, NPHI_N, RHOB_N, and RESDEEP_N are not present, then ValueError is raised with incorrect curve requirements as raw curve is either not present or precondtioning has not been properly run.
  • ValueError – If no formation value factor is found, then ValueError is raised to satisfy the calculation requirements.

References

VCLAY

Clavier, C., W. Hoyle, and D. Meunier, 1971a, Quantitative
interpretation of thermal neutron decay time logs: Part I. Fundamentals and techniques: Journal of Petroleum Technology, 23, 743–755
Clavier, C., W. Hoyle, and D. Meunier, 1971b, Quantitative
interpretation of thermal neutron decay time logs: Part II. Interpretation example, interpretation accuracy, and timelapse technique: Journal of Petroleum Technology, 23, 756–763.

Larionov VV (1969).Borehole Radiometry: Moscow, U.S.S.R. Nedra.

Nuetron, and Neutron Density taken from presentations. Need publish papers for citation.

TOC

Passey, Q. R., Creaney, S., Kulla, J. B., Moretti, F. J.,
Stroud, J. D., 1990, Practical Model for Organic Richness from Porosity and Resistivity Logs, AAPG Bulletin, 74, 1777-1794
Schmoker, J.W., 1979, Determination of organic content of
Appalachian Devonian shales from formation-density logs: American Association of Petroleum Geologists Bulletin, v.63, no.9, p.1504-1509

MATRIX

Doveton, John H. Principles of Mathematical Petrophysics.
Oxford: Oxford University Press, 2014.

SATURATIONS

Archie, G.E. 1942. The Electrical Resistivity Log as an Aid in
Determining Some Reservoir Characteristics. Trans. of AIME 146 (1): 54-62.
Bardon, C., and Pied, B.,1969, Formation water saturation in
shaly sands: Society of Professional Well Log Analysts 10th Annual Logging Symposium Transactions: Paper Z,19 pp.
Poupon, A. and Leveaux, J. 1971. Evaluation of Water
Saturations in Shaly Formations. The Log Analyst 12 (4)
Simandoux, P., 1963, Dielectricmeasurements on porous media
application to the measurement of water saturations: study of the behaviour of argillaceous formations: Revue de l’Institut Francais du Petrole 18, Supplementary Issue, p. 193-215.
Waxman, M.H., and L.J.M. Smits, Electrical Conductivity in Oil
Bearing Shaly Sands, Society of Petroleum Engineers Journal, June, p.107-122, 1968.

Note

  1. Clay bound water
    Clay bound water is included as part of the clay volume based on the default nphi_clay = 0.65. To calculate clay bound water seperately, set nphi_clay to clay matrix absent clay bound water, and include appropriate buckles_parameter for bound water saturations.
  2. Organics
    No differieniation is made between kerogen and other organic matter.

Example

>>> import petropy as ptr
>>> from petropy import datasets
# reads sample Wolfcamp Log from las file
>>> log = ptr.log_data('WFMP')
# calculates fluid properties with default settings
>>> log.fluid_properties()
# calculates multimeral model with default settings
>>> log.multimineral_model()

See also

petropy.Log.formation_multimineral_model()
uses multimineral_model accross formations
multimineral_parameters_from_csv(csv_path=None)[source]

Reads parameters from a csv for input into the multimineral model.

This method reads the file located at the csv_path and turns the values into dictionaries to be used as inputs into the multimineral method.

This link contains a sample csv file with default multimineral properties data.

Parameters:csv_path (str (default None)) – Path to csv file to read.

Note

CSV file must contain header row with the following properties for the multimineral_model

gr_matrix : float (default 10)
Gamma Ray response of clean (non-clay) matrix
nphi_matrix : float (default 0)
Neutron response of clean (non-clay) matrix
gr_clay : float (default 450)
Gamma Ray response of pure clay matrix
rho_clay : float (default 2.64)
Density of pure clay matrix
nphi_clay : float (default 0.65)
Neutron reponse of pure clay matrix
pe_clay : float (default 4)
Photoelectric response of pure clay matrix
rma : float (default 180)
Resistivity of clean tight matrix
rt_clay : float (default 80)
Resistivity for inorganic shale matrix
vclay_linear_weight : float (default 1)
Weight of liner clay volume
vclay_clavier_weight : float (defaul 0.5)
Weight of Clavier clay volume
vclay_larionov_weight : float (defaul 0.5)
Weight of Larionov clay volume
vclay_nphi_weight : float (default 1)
Weight of Neutron clay volume
vclay_nphi_rhob_weight : float (default 1)
Weight of Neutron Density clay volume
vclay_cutoff : float (default 0.05)
Cutoff for oranics calculation. If vclay < vclay_cutoff then toc = 0
rho_om : float (default 1.15)
Density of organic matter
nphi_om : float (default 0.6)
Neutron response of pure organic matter
pe_om : float (default 0.2)
Photoelectric response of pure organic matter
ro : float (default 1.6)
Vitronite reflectance of organic matter
lang_press : float (default 670)
Langmiur pressure for gas adsorption on organics in psi
passey_nphi_weight : float (default 1)
Weight for Passey nphi toc
passey_rhob_weight : float (default 1)
Weight for Passey rhob toc
passey_lom : float (default 10)
Passey level of organic maturity
passey_baseline_res : float (default 40)
Passey inorganic baseline resistivity
passey_baseline_rhob : float (default 2.65)
Passey inorganic baseline density
passey_baseline_nphi : float (default 0)
Passey inorganic baseline neutron
schmoker_weight : float (default 1)
Weight for Schmoker toc
schmoker_slope : float (default 0.7257)
Slope for schmoker density to toc correlation
schmoker_baseline_rhob : float (default 2.6)
Density cutoff for schmoker toc correlation
rho_pyr : float (default 5)
Density of pyrite
nphi_pyr : float (default 0.13)
Neutron response of pure pyrite
pe_pyr : float (default 13)
Photoelectric response of pure pyrite
om_pyrite_slope : float (default 0.2)
Slope correlating pyrite volume to organic matter
include_qtz : str {‘YES’, ‘NO’} (default ‘YES’)
Toggle to include or exclude qtz. ‘YES’ to include. ‘NO’ to exclude.
rho_qtz : float (default 2.65)
Density of quartz
nphi_qtz : float (default -0.04)
Neutron response for pure quartz
pe_qtz : float (default 1.81)
Photoelectric response for pure quartz
include_clc : str {‘YES’, ‘NO’} (default ‘YES’)
Toggle to include or exclude clc. ‘YES’ to include. ‘NO’ to exclude.
rho_clc : float (default 2.71)
Density of calcite
nphi_clc : float (default 0)
Neutron response for pure calcite
pe_clc : float (default 5.08)
Photoelectric response for pure calcite
include_dol : str {‘YES’, ‘NO’} (default ‘YES’)
Toggle to include or exclude dol. ‘YES’ to include. ‘NO’ to exclude.
rho_dol : float (default 2.85)
Density of dolomite
nphi_dol : float (default 0.04)
Neutron response to dolomite
pe_dol : float (default 3.14)
Photoelectric response to dolomite
include_x : str {‘YES’, ‘NO’} (default ‘NO’)
Toggle to include or exclude exotic mineral, x. ‘YES’ to include. ‘NO’ to exclude.
name_x : str (default ‘Gypsum’)
Name of exotic mineral, x.
name_log_x : str (default ‘GYP’)
Log name of exotic mineral, x
rho_x : float (default 2.35)
Density of exotic mineral, x
nphi_x : float (default 0.507)
Neutron response of exotic mineral, x
pe_x : float (default 4.04)
Photoelectric respone of exotic mineral, x
pe_fl : float (default 0)
Photoelectric response of reservoir fluid.
m : float (default 2)
Cementation exponent
n : float (default 2)
Saturation exponent
a : float (default 1)
Cementation constant
cec : float (default -1)
Cation Exchange Capaticy for use in Waxman Smits Sw equation. If cec = -1, correlation equation is used to calculate cec.
archie_weight : float (default 0)
Weight for archie Sw
indonesia_weight : float (default 1)
Weight for Indonesia Sw
simandoux_weight : float (default 0)
Weight for Simandoux Sw
modified_simandoux_weight : float (default 0)
Weight for Modified Simandoux Sw
waxman_smits_weight : float (default 0)
Weight for Waxman Smits Sw
buckles_parameter : float (default -1)
Buckles parameter for calculating irreducible water saturation. If less than 0, it is calculated using a correlation.

Examples

>>> import petropy as ptr
# reads sample Wolfcamp Log from las file
>>> log = ptr.log_data('WFMP')
# loads base parameters
>>> log.multimineral_parameters_from_csv()
>>> import petropy as ptr
# reads sample Wolfcamp Log from las file
>>> log = ptr.log_data('WFMP')
# define path to csv file
>>> my_csv_paramters = 'path/to/csv/file.csv'
# loads specified parameters
>>> log.multimineral_parameters_from_csv(my_csv_paramters)

See also

petropy.Log.fluid_properties()
Calculates fluid properties using input settings loaded through this method
next_formation_depth(formation)[source]

Return top of formation below specified formation.

Parameters:formation (str) – name of formation which should be found in preloaded tops
Returns:bottom – top of formation below input formation, acting as bottom of input formation
Return type:float

Example

>>> import petropy as ptr
# reads sample Wolfcamp Log from las file
>>> log = ptr.log_data('WFMP')
# get top of formation WFMPA
>>> wfmpa_top = log.tops['WFMPA']
>>> print(wfmpa_top)
6993.5
# got bottom of formation WFMPA
>>> wfmpa_bottom = log.next_formation_depth('WFMPB')
>>> print(wfmpa_bottom)
7294.0
# Compare depths for bottom of WFMPA
# to top of WFMPB
>>> wfmpb_top = log.tops['WFMPB']
>>> print(wfmpb_top)
7294.0
>>> print(wfmpa_bottom == wfmpb_top)
True
precondition(drho_matrix=2.71)[source]

Preconditions log curve by aliasing names.

Precondition is used after initializing data and standardizes names for future calculations.

Parameters:drho_matrix (float, optional) – drho_matrix is for converting density porosity to bulk densty, and is only used when bulk density is missing. Default value for limestone matrix. If log was run on sandstone matrix, use 2.65. If log was run on dolomite matrix, use 2.85.

Note

  1. Curve Alias is provided by the curve_alias.xml file
statistics(formations, curves=['PHIE'])[source]

Curve statistcs for given formations and curves

Parameters:
  • formations (list (default [])) – list of formations to calculate statistics over. Must be included in preloaded tops
  • curves (list (default ['PHIE'])) – list of curve to calculate statistics for. Must be included in Log object.
Returns:

df – Returns Mean, Sum, and Standard Deviation for each curve over every formation

Return type:

DataFrame

Example

>>> import petropy as ptr
# reads sample Wolfcamp Log from las file
>>> log = ptr.log_data('WFMP')
# define formations to calculate statistics
>>> f = ['WFMPA', 'WFMPB', 'WFMPC']
# define curves to calculate statistics
>>> c = ['GR_N', 'RHOB_N', NPHI_N']
# calculate statistics
>>> stats_df = log.statistics(formations = f, curves = c)
>>> print(stats_df)
..FORMATION                   DATETIME GROSS_H  GR_N_MEAN
0     WFMPA 2017-09-26 16:04:47.543687   300.5  92.597982
1     WFMPB 2017-09-26 16:04:47.543687   396.5  89.953657
2     WFMPC 2017-09-26 16:04:47.543687   337.5  75.326230
........GR_N_SUM   RHOB_N_MEAN   RHOB_N_STD   RHOB_N_SUM
1    27825.6935      2.503339     0.048434     752.2535
2    35666.6250      2.526271     0.051070    1001.6665
3    25422.6025      2.539730     0.069945     857.1590
...NPHI_N_MEAN  NPHI_N_STD  NPHI_N_SUM              UWI
1     0.208496    0.055684      62.653   42303347740000
2     0.219536    0.044894      87.046   42303347740000
3     0.198791    0.066487      67.092   42303347740000

See also

petropy.Log.statistics_to_csv()
saves statistics to csv file with option to append or overwrite formation values
petropy.Log.summations()
calculate summation curves over a given formation
statistics_to_csv(file_path, replace=False, formations=[], curves=['PHIE'])[source]

Saves curve statistcs for given formations and curves to a csv

Parameters:
  • file_path (str) – path to csv file
  • replace (boolean (default False)) – option to replace uwi, formation statistics if already in csv file
  • formations (list (default [])) – list of formations to calculate statistics over. Must be included in preloaded tops
  • curves (list (default ['PHIE'])) – list of curve to calculate statistics.

Example

>>> import petropy as ptr
# reads sample Wolfcamp Log from las file
>>> log = ptr.log_data('WFMP')
# define formations to calculate
# define formations to calculate statistics
>>> f = ['WFMPA', 'WFMPB', 'WFMPC']
# define curves to calculate statistics
>>> c = ['GR_N', 'RHOB_N', NPHI_N']
# define path to csv
>>> p = 'path/to/my/file.csv'
# calculate and save statistcs to csv
>>> log.statistics_to_csv(p, formations = f, curves = c)

See also

petropy.Log.statistics()
calculates statistics and returns a dataframe
petropy.Log.summations()
calculate summation curves over a given formation
summations(formations, curves=['PHIE'])[source]

Cumulative summations over formations for given curves.

Parameters:
  • formations (list) – list of formations, which must be found in preloaded tops
  • curves (list (default ['PHIE'])) – list of curves to calculated cumulative summations. Values in list must curves be present in log.

Example

>>> import petropy as ptr
# Sum Oil in Place for Wolfcamp A
#
# reads sample Wolfcamp Log from las file
>>> log = ptr.log_data('WFMP')
# define formations
>>> f = ['WFMPA', 'WFMPB', 'WFMPC']
# calculate fluid properties for formations
>>> log.formation_fluid_properties(formations = f)
# calculate minerals and saturations for formations
>>> log.formation_multimineral_model(formation = f)
# run summations for Oil in Place over formations
>>> log.summations(formations = f, curves = ['OIP'])

See also

petropy.Log.statistics()
Calculates statistics over given formations and curves
to_csv(*args, **kwargs)[source]

Write the log DataFrame to a comma-separated values (csv) file.

Calls pandas.DataFrame.to_csv which includes these parameters.

Parameters:
  • path_or_buf (str or file handle (default None)) – File path or object, if None is provided the result is returned as a string.
  • sep (str (default ‘,)) – Field delimiter for the output file.
  • na_rep (str (default ‘’)) – Missing data representation
  • float_format (str (default None)) – Format string for floating point numbers
  • columns (sequence, optional) – Columns to write
  • header (boolean or list of string (default True)) – Write out column names. If a list of string is given it is assumed to be aliases for the column names
  • index (boolean (default True)) – Write row names (index)
  • index_label (str or sequence, or False (default None)) – Column label for index column(s) if desired. If None is given, and header and index are True, then the index names are used. A sequence should be given if the DataFrame uses MultiIndex. If False do not print fields for index names. Use index_label = False for easier importing in R
  • mode (str) – Python write mode, default ‘w’
  • encoding (str, optional) – A string representing the encoding to use in the output file, defaults to ‘ascii’ on Python 2 and ‘utf-8’ on Python 3.
  • compression (str, optional) – a string representing the compression to use in the output file, allowed values are ‘gzip’, ‘bz2’, ‘xz’, only used when the first argument is a filename
  • line_terminator (str) – The newline character or character sequence to use in the output file
  • quoting (constant from csv module, optional) – defaults to csv.QUOTE_MINIMAL. If you have set a float_format then floats are converted to strings and thus csv.QUOTE_NONNUMERIC will treat them as non-numeric
  • quotechar (str with length 1 (default ‘”’)) – character used to quote fields
  • doublequote (boolean (default True)) – Control quoting of quotechar inside a field
  • escapechar (str with length 1 (default None)) – character used to escape sep and quotechar when appropriate
  • chunksize (int (default None)) – rows to write at a time
  • tupleize_cols (boolean (default False)) – write multi_index columns as a list of tuples (if True) or new (expanded format) if False)
  • date_format (str (default None)) – Format string for datetime objects
  • decimal (str (default ‘.’)) – Character recognized as decimal separator. E.g. use ‘,’ for European data

Example

>>> import petropy as ptr
# Read las file, then write to csv for use in excel
#
# reads sample Wolfcamp Log from las file
>>> log = ptr.log_data('WFMP')
# define path to save csv
>>> file_name = 'path/to/save/name_of_file.csv'
# save log to csv
>>> log.to_csv(path_or_buf = file_name, index = False)
tops_from_csv(csv_path=None)[source]

Reads tops from a csv file and saves as dictionary.

Here is a sample csv file with default tops data.

Parameters:csv_path (str (default None)) –

Path to csv file to read. Must contain header row the the following properties:

uwi : str
    Unique Well Identifier
form : str
    Name of formation top
depth : float
    depth of corresponding formation top

Note

Format for csv:

uwi,form,depth
11111111111,WFMPA,7000.50
11111111111,WFMPB,7250.50
11111111111,WFMPC,7500.00
11111111111,WFMPD,7700.25
11111111111,DEAN,8000.00

Example

>>> import petropy as ptr
# define path to las file
p = 'path/to/well.las'
# loads specified las file
>>> log = ptr.Log(p)
# define path to csv tops file
>>> t = 'path/to/tops.csv'
# loads specified tops csv
>>> log.tops_from_csv(t)
write(file_path, version=2.0, wrap=False, STRT=None, STOP=None, STEP=None, fmt='%10.5g')[source]

Writes to las file, and overwrites if file exisits. Uses parent class LASFile.write method with specified defaults.

Parameters:
  • file_path (str) – path to new las file.
  • version ({1.2 or 2} (default 2)) – Version for las file
  • wrap ({True, Flase, None} (default False)) – Specify to wrap data. If None, uses setting from when file was read.
  • STRT (float (default None)) – Optional override to automatic calculation using the first index curve value.
  • STOP (float (default None)) – Optional override to automatic calculation using the last index curve value.
  • STEP (float (default None)) – Optional override to automatic calculation using the first step size in the index curve.
  • fmt (str (default '%10.5g')) – Format string for numerical data being written to data section.

Example

>>> import petropy as ptr
# reads sample Wolfcamp Log from las file
>>> log = ptr.log_data('WFMP')
# define file path to save log
>>> p = 'path/to/new_file.las'
>>> log.write(p)