bruges.reflection package#

Submodules#

bruges.reflection.reflection module#

bruges.reflection.reflection.acoustic_reflectivity(vp=None, rho=None, axis=0, mode='same')[source]#

The acoustic reflectivity, given Vp and RHOB logs. You can also pass either vp or rho and get velocity or density reflectivity; if you only have an impedance log or dataset, pass it as vp.

For offset reflectivity, use reflectivity().

Parameters
  • vp (ndarray) – The P-wave velocity. At least one of Vp and Rho is required.

  • rho (ndarray) – The bulk density. At least one of Vp and Rho is required. If you only have Impedance, pass it in as Vp and leave this as None. It will use a value of 1 to compute impedance and you’ll get velocity reflectivity.

  • axis (int) – The dimension along which to compute the reflectivity.

  • mode (str) – ‘same’ means the output will be the same shape. ‘valid’ means that only strictly valid reflectivities are computed so the result will be one sample shorted in the axis dimension.

Returns

The reflectivity coefficient series.

Return type

ndarray

bruges.reflection.reflection.akirichards(vp1, vs1, rho1, vp2, vs2, rho2, theta1=0, terms=False)[source]#

The Aki-Richards approximation to the reflectivity.

This is the formulation from Avseth et al., Quantitative seismic interpretation, Cambridge University Press, 2006. Adapted for a 4-term formula. See http://subsurfwiki.org/wiki/Aki-Richards_equation.

Returns the complex reflectivity.

Parameters
  • vp1 (ndarray) – The upper P-wave velocity; float or 1D array length m.

  • vs1 (ndarray) – The upper S-wave velocity; float or 1D array length m.

  • rho1 (ndarray) – The upper layer’s density; float or 1D array length m.

  • vp2 (ndarray) – The lower P-wave velocity; float or 1D array length m.

  • vs2 (ndarray) – The lower S-wave velocity; float or 1D array length m.

  • rho2 (ndarray) – The lower layer’s density; float or 1D array length m.

  • theta1 (ndarray) – The incidence angle; float or 1D array length n.

  • terms (bool) – Whether or not to return a tuple of the terms of the equation. The first term is the acoustic impedance.

Returns

ndarray. The Aki-Richards approximation for P-P reflectivity at the

interface. Will be a float (for float inputs and one angle), a 1 x n array (for float inputs and an array of angles), a 1 x m array (for float inputs and one angle), or an n x m array (for array inputs and an array of angles).

bruges.reflection.reflection.akirichards_alt(vp1, vs1, rho1, vp2, vs2, rho2, theta1=0, terms=False)[source]#

This is another formulation of the Aki-Richards solution. See http://subsurfwiki.org/wiki/Aki-Richards_equation

Returns the complex reflectivity.

Parameters
  • vp1 (ndarray) – The upper P-wave velocity; float or 1D array length m.

  • vs1 (ndarray) – The upper S-wave velocity; float or 1D array length m.

  • rho1 (ndarray) – The upper layer’s density; float or 1D array length m.

  • vp2 (ndarray) – The lower P-wave velocity; float or 1D array length m.

  • vs2 (ndarray) – The lower S-wave velocity; float or 1D array length m.

  • rho2 (ndarray) – The lower layer’s density; float or 1D array length m.

  • theta1 (ndarray) – The incidence angle; float or 1D array length n.

  • terms (bool) – Whether or not to return a tuple of the terms of the equation. The first term is the acoustic impedance.

Returns

ndarray. The Aki-Richards approximation for P-P reflectivity at the

interface. Will be a float (for float inputs and one angle), a 1 x n array (for float inputs and an array of angles), a 1 x m array (for float inputs and one angle), or an n x m array (for array inputs and an array of angles).

bruges.reflection.reflection.blangy(vp1, vs1, rho1, vp2, vs2, rho2, d1=0, e1=0, d2=0, e2=0, theta1=0)[source]#

Implements the Blangy equation with the same interface as the other reflectivity equations. Wraps bruges.anisotropy.blangy(), which you may prefer to use directly.

Parameters
  • vp1 (ndarray) – The upper P-wave velocity; float or 1D array length m.

  • vs1 (ndarray) – The upper S-wave velocity; float or 1D array length m.

  • rho1 (ndarray) – The upper layer’s density; float or 1D array length m.

  • vp2 (ndarray) – The lower P-wave velocity; float or 1D array length m.

  • vs2 (ndarray) – The lower S-wave velocity; float or 1D array length m.

  • rho2 (ndarray) – The lower layer’s density; float or 1D array length m.

  • d1 (ndarray) – The upper delta; float or 1D array length m.

  • e1 (ndarray) – The upper epsilon; float or 1D array length m.

  • d2 (ndarray) – The lower delta; float or 1D array length m.

  • e2 (ndarray) – The lower epsilon; float or 1D array length m.

  • theta1 (ndarray) – The incidence angle; float or 1D array length n.

Returns

ndarray. The Blangy approximation for P-P reflectivity at the

interface. Wraps anisotropy.blangy().

bruges.reflection.reflection.bortfeld(vp1, vs1, rho1, vp2, vs2, rho2, theta1=0, terms=False)[source]#

Compute Bortfeld approximation with three terms. http://sepwww.stanford.edu/public/docs/sep111/marie2/paper_html/node2.html Real numbers only.

Parameters
  • vp1 (ndarray) – The upper P-wave velocity; float or 1D array length m.

  • vs1 (ndarray) – The upper S-wave velocity; float or 1D array length m.

  • rho1 (ndarray) – The upper layer’s density; float or 1D array length m.

  • vp2 (ndarray) – The lower P-wave velocity; float or 1D array length m.

  • vs2 (ndarray) – The lower S-wave velocity; float or 1D array length m.

  • rho2 (ndarray) – The lower layer’s density; float or 1D array length m.

  • theta1 (ndarray) – The incidence angle; float or 1D array length n.

  • terms (bool) – Whether or not to return a tuple of the terms of the equation. The first term is the acoustic impedance.

Returns

ndarray. The 3-term Bortfeld approximation for P-P reflectivity at the

interface. Will be a float (for float inputs and one angle), a 1 x n array (for float inputs and an array of angles), a 1 x m array (for float inputs and one angle), or an n x m array (for array inputs and an array of angles).

bruges.reflection.reflection.bortfeld2(vp1, vs1, rho1, vp2, vs2, rho2, theta1=0, terms=False)[source]#

The 2-term Bortfeld approximation for ava analysis. Wraps shuey(). Deprecated, use bortfeld() instead.

Parameters
  • vp1 (ndarray) – The upper P-wave velocity; float or 1D array length m.

  • vs1 (ndarray) – The upper S-wave velocity; float or 1D array length m.

  • rho1 (ndarray) – The upper layer’s density; float or 1D array length m.

  • vp2 (ndarray) – The lower P-wave velocity; float or 1D array length m.

  • vs2 (ndarray) – The lower S-wave velocity; float or 1D array length m.

  • rho2 (ndarray) – The lower layer’s density; float or 1D array length m.

  • theta1 (ndarray) – The incidence angle; float or 1D array length n.

  • terms (bool) – Whether or not to return a tuple of the terms of the equation. The first term is the acoustic impedance.

Returns

ndarray. The 2-term Bortfeld approximation for P-P reflectivity at the

interface. Will be a float (for float inputs and one angle), a 1 x n array (for float inputs and an array of angles), a 1 x m array (for float inputs and one angle), or an n x m array (for array inputs and an array of angles).

bruges.reflection.reflection.bortfeld3(vp1, vs1, rho1, vp2, vs2, rho2, theta1=0, terms=False)[source]#
bruges.reflection.reflection.critical_angles(vp1, vp2, vs2=None)[source]#

Compute critical angle at an interface

Given the upper (vp1) and lower (vp2) velocities at an interface. If you want the PS-wave critical angle as well, pass vs2 as well.

Parameters
  • vp1 (ndarray) – Upper layer P-wave velocity.

  • vp2 (ndarray) – Lower layer P-wave velocity.

  • vs2 (ndarray) – Lower layer S-wave velocity (optional).

Returns

The first and second critical angles at the interface, in

degrees. If there isn’t a critical angle, it returns np.nan.

Return type

tuple

bruges.reflection.reflection.fatti(vp1, vs1, rho1, vp2, vs2, rho2, theta1=0, terms=False)[source]#

Compute reflectivities with Fatti’s formulation of the Aki-Richards equation, which does not account for the critical angle. See Fatti et al. (1994), Geophysics 59 (9). Real numbers only.

Parameters
  • vp1 (ndarray) – The upper P-wave velocity; float or 1D array length m.

  • vs1 (ndarray) – The upper S-wave velocity; float or 1D array length m.

  • rho1 (ndarray) – The upper layer’s density; float or 1D array length m.

  • vp2 (ndarray) – The lower P-wave velocity; float or 1D array length m.

  • vs2 (ndarray) – The lower S-wave velocity; float or 1D array length m.

  • rho2 (ndarray) – The lower layer’s density; float or 1D array length m.

  • theta1 (ndarray) – The incidence angle; float or 1D array length n.

  • terms (bool) – Whether or not to return a tuple of the terms of the equation. The first term is the acoustic impedance.

Returns

ndarray. The Fatti approximation for P-P reflectivity at the

interface. Will be a float (for float inputs and one angle), a 1 x n array (for float inputs and an array of angles), a 1 x m array (for float inputs and one angle), or an n x m array (for array inputs and an array of angles).

bruges.reflection.reflection.hilterman(vp1, vs1, rho1, vp2, vs2, rho2, theta1=0, terms=False)[source]#

Not recommended, only seems to match Zoeppritz to about 10 deg.

Hilterman (1989) approximation from Mavko et al. Rock Physics Handbook. According to Dvorkin: “arguably the simplest and a very convenient [approximation].” At least for small angles and small contrasts. Real numbers only.

Parameters
  • vp1 (ndarray) – The upper P-wave velocity; float or 1D array length m.

  • vs1 (ndarray) – The upper S-wave velocity; float or 1D array length m.

  • rho1 (ndarray) – The upper layer’s density; float or 1D array length m.

  • vp2 (ndarray) – The lower P-wave velocity; float or 1D array length m.

  • vs2 (ndarray) – The lower S-wave velocity; float or 1D array length m.

  • rho2 (ndarray) – The lower layer’s density; float or 1D array length m.

  • theta1 (ndarray) – The incidence angle; float or 1D array length n.

  • terms (bool) – Whether or not to return a tuple of the terms of the equation. The first term is the acoustic impedance.

Returns

ndarray. The Hilterman approximation for P-P reflectivity at the

interface. Will be a float (for float inputs and one angle), a 1 x n array (for float inputs and an array of angles), a 1 x m array (for float inputs and one angle), or an n x m array (for array inputs and an array of angles).

bruges.reflection.reflection.preprocess(func)[source]#

Decorator to preprocess arguments for the reflectivity equations.

Takes a reflectivity function requiring Vp, Vs, and RHOB for 2 rocks (upper and lower), plus incidence angle theta, plus kwargs. Returns that function with some arguments transformed.

bruges.reflection.reflection.reflection_phase(reflectivity)[source]#

Compute the phase of the reflectivity. Returns an array (or float) of the phase, in positive multiples of 180 deg or pi rad. So 1 is opposite phase. A value of 1.1 would be +1.1 imes pi rad.

Parameters

reflectivity (ndarray) – The reflectivity, eg from zoeppritz().

Returns

The phase, strictly positive

Return type

ndarray

bruges.reflection.reflection.reflectivity(vp, vs, rho, theta=0, method='zoeppritz_rpp', axis=0, mode='same')[source]#

Offset reflectivity, given Vp, Vs, rho, and offset.

For acoustic reflectivity, use acoustic_reflectivity().

Computes ‘upper’ and ‘lower’ intervals from the three provided arrays, then passes the result to the specified method to compute reflection coefficients.

For acoustic reflectivity, either use the acoustic_reflectivity() function, or call reflectivity() passing any log as Vs, e.g. just give the Vp log twice (it won’t be used anyway):

reflectivity(vp, vp, rho)

For anisotropic reflectivity, use either anisotropy.blangy() or anisotropy.ruger().

Parameters
  • vp (ndarray) – The P-wave velocity; float or 1D array length m.

  • vs (ndarray) – The S-wave velocity; float or 1D array length m.

  • rho (ndarray) – The density; float or 1D array length m.

  • theta (ndarray) – The incidence angle; float or 1D array length n.

  • axis (int) – The dimension along which to compute the reflectivity.

  • mode (str) – ‘same’ means the output will be the same shape. ‘valid’ means that only strictly valid reflectivities are computed so the result will be one sample shorted in the axis dimension.

  • method (str) –

    The reflectivity equation to use; one of:

    • ’scattering_matrix’: scattering_matrix

    • ’zoeppritz_element’: zoeppritz_element

    • ’zoeppritz’: zoeppritz

    • ’zoeppritz_rpp’: zoeppritz_rpp

    • ’akirichards’: akirichards

    • ’akirichards_alt’: akirichards_alt

    • ’fatti’: fatti

    • ’shuey’: shuey

    • ’bortfeld’: bortfeld

    • ’hilterman’: hilterman

  • Notes

    • scattering_matrix gives the full solution

    • zoeppritz_element gives a single element which you specify

    • zoeppritz returns RPP element only; use zoeppritz_rpp instead

    • zoeppritz_rpp is faster than zoeppritz or zoeppritz_element

    • You can also pass a function with the same API as these built-in

      functions.

Returns

ndarray. The result of running the specified method on the inputs.

Will be a float (for float inputs and one angle), a 1 x n array (for float inputs and an array of angles), a 1 x m-1 array (for float inputs and one angle), or an m-1 x n array (for array inputs and an array of angles).

bruges.reflection.reflection.scattering_matrix(vp1, vs1, rho1, vp2, vs2, rho2, theta1=0)[source]#

Full Zoeppritz solution, considered the definitive solution. Calculates the angle dependent p-wave reflectivity of an interface between two mediums.

Originally written by: Wes Hamlyn, vectorized by Agile.

Returns the complex reflectivity.

Parameters
  • vp1 (float) – The upper P-wave velocity.

  • vs1 (float) – The upper S-wave velocity.

  • rho1 (float) – The upper layer’s density.

  • vp2 (float) – The lower P-wave velocity.

  • vs2 (float) – The lower S-wave velocity.

  • rho2 (float) – The lower layer’s density.

  • theta1 (ndarray) – The incidence angle; float or 1D array length n.

Returns

ndarray. The exact Zoeppritz solution for all modes at the interface.

A 4x4 array representing the scattering matrix at the incident angle theta1.

bruges.reflection.reflection.shuey(vp1, vs1, rho1, vp2, vs2, rho2, theta1=0, terms=False, return_gradient=False)[source]#

Compute Shuey approximation with 3 terms. http://subsurfwiki.org/wiki/Shuey_equation

Parameters
  • vp1 (ndarray) – The upper P-wave velocity; float or 1D array length m.

  • vs1 (ndarray) – The upper S-wave velocity; float or 1D array length m.

  • rho1 (ndarray) – The upper layer’s density; float or 1D array length m.

  • vp2 (ndarray) – The lower P-wave velocity; float or 1D array length m.

  • vs2 (ndarray) – The lower S-wave velocity; float or 1D array length m.

  • rho2 (ndarray) – The lower layer’s density; float or 1D array length m.

  • theta1 (ndarray) – The incidence angle; float or 1D array length n.

  • terms (bool) – Whether or not to return a tuple of the terms of the equation. The first term is the acoustic impedance.

  • return_gradient (bool) – Whether to return a tuple of the intercept and gradient (i.e. the second term divided by sin^2(theta)).

Returns

ndarray. The Aki-Richards approximation for P-P reflectivity at the

interface. Will be a float (for float inputs and one angle), a 1 x n array (for float inputs and an array of angles), a 1 x m array (for float inputs and one angle), or an n x m array (for array inputs and an array of angles).

bruges.reflection.reflection.shuey2(vp1, vs1, rho1, vp2, vs2, rho2, theta1=0)[source]#

Compute Shuey approximation with 2 terms. Wraps shuey(). Deprecated, use shuey() instead.

bruges.reflection.reflection.shuey3(vp1, vs1, rho1, vp2, vs2, rho2, theta1=0, terms=False)[source]#

Compute Shuey approximation with 3 terms. Wraps shuey(). Deprecated, use shuey() instead.

bruges.reflection.reflection.vectorize(func)[source]#

Decorator to make sure the inputs are arrays. We also add a dimension to theta to make the functions work in an ‘outer product’ way.

Takes a reflectivity function requiring Vp, Vs, and RHOB for 2 rocks (upper and lower), plus incidence angle theta, plus kwargs. Returns that function with the arguments transformed to ndarrays.

bruges.reflection.reflection.zoeppritz(vp1, vs1, rho1, vp2, vs2, rho2, theta1=0)[source]#

Returns the PP reflection coefficients from the Zoeppritz scattering matrix. Wraps zoeppritz_element().

Returns the complex reflectivity.

Parameters
  • vp1 (float) – The upper P-wave velocity.

  • vs1 (float) – The upper S-wave velocity.

  • rho1 (float) – The upper layer’s density.

  • vp2 (float) – The lower P-wave velocity.

  • vs2 (float) – The lower S-wave velocity.

  • rho2 (float) – The lower layer’s density.

  • theta1 (ndarray) – The incidence angle; float or 1D array length n.

Returns

ndarray. Array length n of the exact Zoeppritz solution for the

specified modes at the interface, at the incident angle theta1.

bruges.reflection.reflection.zoeppritz_element(vp1, vs1, rho1, vp2, vs2, rho2, theta1=0, element='PdPu')[source]#

Returns any mode reflection coefficients from the Zoeppritz scattering matrix. Pass in the mode as element, e.g. ‘PdSu’ for PS.

Wraps scattering_matrix().

Returns the complex reflectivity.

Parameters
  • vp1 (float) – The upper P-wave velocity.

  • vs1 (float) – The upper S-wave velocity.

  • rho1 (float) – The upper layer’s density.

  • vp2 (float) – The lower P-wave velocity.

  • vs2 (float) – The lower S-wave velocity.

  • rho2 (float) – The lower layer’s density.

  • theta1 (ndarray) – The incidence angle; float or 1D array length n.

  • element (str) – The name of the element to return, must be one of: ‘PdPu’, ‘SdPu’, ‘PuPu’, ‘SuPu’, ‘PdSu’, ‘SdSu’, ‘PuSu’, ‘SuSu’, ‘PdPd’, ‘SdPd’, ‘PuPd’, ‘SuPd’, ‘PdSd’, ‘SdSd’, ‘PuSd’, ‘SuSd’.

Returns

ndarray. Array length n of the exact Zoeppritz solution for the

specified modes at the interface, at the incident angle theta1.

bruges.reflection.reflection.zoeppritz_rpp(vp1, vs1, rho1, vp2, vs2, rho2, theta1=0)[source]#

Exact Zoeppritz from expression.

This is useful because we can pass arrays to it, which we can’t do to scattering_matrix().

Dvorkin et al. (2014). Seismic Reflections of Rock Properties. Cambridge.

Returns the complex reflectivity.

Parameters
  • vp1 (ndarray) – The upper P-wave velocity; float or 1D array length m.

  • vs1 (ndarray) – The upper S-wave velocity; float or 1D array length m.

  • rho1 (ndarray) – The upper layer’s density; float or 1D array length m.

  • vp2 (ndarray) – The lower P-wave velocity; float or 1D array length m.

  • vs2 (ndarray) – The lower S-wave velocity; float or 1D array length m.

  • rho2 (ndarray) – The lower layer’s density; float or 1D array length m.

  • theta1 (ndarray) – The incidence angle; float or 1D array length n.

Returns

ndarray. The exact Zoeppritz solution for P-P reflectivity at the

interface. Will be a float (for float inputs and one angle), a 1 x n array (for float inputs and an array of angles), a 1 x m array (for float inputs and one angle), or an n x m array (for array inputs and an array of angles).

Module contents#