bruges.petrophysics.petrophysics module

petrophysics.py

copyright:2018 Agile Geoscience
license:Apache 2.0
bruges.petrophysics.petrophysics.density_to_porosity(rho, rho_matrix, rho_fluid)[source]

Get density from a porosity log. Typical values:

rho_matrix (sandstone) : 2650 kg/m^3 rho_matrix (limestome): 2710 kg/m^3 rho_matrix (dolomite): 2876 kg/m^3 rho_matrix (anyhydrite): 2977 kg/m^3 rho_matrix (salt): 20320 kg/m^3

rho_fluid (fresh water): 1000 kg/m^3 rho_fluid (salt water): 1100 kg/m^3

See wiki.aapg.org/Density-neutron_log_porosity.

Parameters:
  • rho (ndarray) – The bulk density log or RHOB.
  • rho_matrix (float) –
  • rho_fluid (float) –
Returns:

Estimate of porosity as a volume fraction.

bruges.petrophysics.petrophysics.density_to_velocity(rho, alpha=310, beta=0.25, fps=False)

Computes Gardner’s density prediction from P-wave velocity.

Parameters:
  • rho (ndarray) – Density in kg/m^3.
  • alpha (float) – The factor, 310 for m/s and 230 for fps.
  • beta (float) – The exponent, usually 0.25.
  • fps (bool) – Set to true for FPS and the equation will use the typical value for alpha. Overrides value for alpha, so if you want to use your own alpha, regardless of units, set this to False.
Returns:

Vp estimate in m/s.

Return type:

ndarray

bruges.petrophysics.petrophysics.error_flag(pred, actual, dev=1.0, method=1)[source]

Calculate the difference between a predicted and an actual curve and return a log flagging large differences based on a user-defined distance (in standard deviation units) from the mean difference

Matteo Niccoli, October 2018

Parameters:
  • predicted (ndarray) –
  • actual (ndarray) –
  • dev (float) –
  • calcluation method (error) – 1: difference between curves larger than mean difference plus dev 2: curve slopes have opposite sign 3: curve slopes of opposite sign OR difference larger than mean plus dev

Returns: flag (ndarray) = error flag curve

bruges.petrophysics.petrophysics.gardner(vp, alpha=310, beta=0.25, fps=False)[source]

Computes Gardner’s density prediction from P-wave velocity.

Parameters:
  • vp (ndarray) – P-wave velocity in m/s.
  • alpha (float) – The factor, 310 for m/s and 230 for ft/s.
  • beta (float) – The exponent, usually 0.25.
  • fps (bool) – Set to true for FPS and the equation will use the typical value for alpha. Overrides value for alpha, so if you want to use you own alpha, regardless of units, set this to False.
Returns:

RHOB estimate in kg/m^3.

Return type:

ndarray

bruges.petrophysics.petrophysics.gardner_param(vp, rhob)[source]

Finds optimal alpha and beta parameters for the gardner

Volodymyr Vragov, October 2018

Parameters:
  • rho (ndarray) – Density.
  • vp (ndarray) – P-wave velocity.
Returns:

The factor. beta (float): The exponent, usually 0.25.

Return type:

alpha (float)

bruges.petrophysics.petrophysics.inverse_gardner(rho, alpha=310, beta=0.25, fps=False)[source]

Computes Gardner’s density prediction from P-wave velocity.

Parameters:
  • rho (ndarray) – Density in kg/m^3.
  • alpha (float) – The factor, 310 for m/s and 230 for fps.
  • beta (float) – The exponent, usually 0.25.
  • fps (bool) – Set to true for FPS and the equation will use the typical value for alpha. Overrides value for alpha, so if you want to use your own alpha, regardless of units, set this to False.
Returns:

Vp estimate in m/s.

Return type:

ndarray

bruges.petrophysics.petrophysics.optimize_inverse_gardner(rho, alpha, beta)[source]

Wrapper function to pass inverse_gardner to scipy.curve_fit to get optimal alpha and beta parameters

Matteo Niccoli and Volodymyr Vragov, October 2018

Parameters:
  • rho (ndarray) – Density.
  • alpha (float) – The factor.
  • beta (float) – The exponent.
Returns:

this is passed to scipy.curve_fit as, for example: popt_synt, pcov = scipy.curve_fit(optimize_inverse_gardner, rho, vp) For a ull example, please read: mycarta.wordpress.com/2018/10/28/geophysics-python-sprint-2018-day-2-and-beyond-part-i

Return type:

inverse_gardner

bruges.petrophysics.petrophysics.porosity_to_density(phi, rho_matrix, rho_fluid)[source]

Get density from a porosity log. Typical values:

rho_matrix (sandstone) : 2650 kg/m^3 rho_matrix (limestome): 2710 kg/m^3 rho_matrix (dolomite): 2876 kg/m^3 rho_matrix (anyhydrite): 2977 kg/m^3 rho_matrix (salt): 20320 kg/m^3

rho_fluid (fresh water): 1000 kg/m^3 rho_fluid (salt water): 1100 kg/m^3

See wiki.aapg.org/Density-neutron_log_porosity.

Parameters:
  • phi (ndarray) – The porosity log.
  • rho_matrix (float) –
  • rho_fluid (float) –
Returns:

Estimate of bulk density, rho.

bruges.petrophysics.petrophysics.slowness_to_velocity(slowness)[source]

Convert a slowness log in µs per unit depth, to velocity in unit depth per second.

Parameters:slowness (ndarray) – A value or sequence of values.
Returns:The velocity.
Return type:ndarray
bruges.petrophysics.petrophysics.velocity_to_density(vp, alpha=310, beta=0.25, fps=False)

Computes Gardner’s density prediction from P-wave velocity.

Parameters:
  • vp (ndarray) – P-wave velocity in m/s.
  • alpha (float) – The factor, 310 for m/s and 230 for ft/s.
  • beta (float) – The exponent, usually 0.25.
  • fps (bool) – Set to true for FPS and the equation will use the typical value for alpha. Overrides value for alpha, so if you want to use you own alpha, regardless of units, set this to False.
Returns:

RHOB estimate in kg/m^3.

Return type:

ndarray

bruges.petrophysics.petrophysics.velocity_to_slowness(slowness)

Convert a slowness log in µs per unit depth, to velocity in unit depth per second.

Parameters:slowness (ndarray) – A value or sequence of values.
Returns:The velocity.
Return type:ndarray