# bruges.attribute package#

## bruges.attribute.complex module#

bruges.attribute.complex.envelope(traces)#

Compute instantaneous amplitude, also known as the envelope or reflection strength.

The attribute is computed over the last dimension. That is, time should be in the last dimension, so a 100 inline, 100 crossline seismic volume with 250 time slices would have shape (100, 100, 250).

Parameters

traces (ndarray) – The data array to use for calculating energy.

Returns

An array the same dimensions as the input array.

Return type

ndarray

bruges.attribute.complex.instantaneous_amplitude(traces)[source]#

Compute instantaneous amplitude, also known as the envelope or reflection strength.

The attribute is computed over the last dimension. That is, time should be in the last dimension, so a 100 inline, 100 crossline seismic volume with 250 time slices would have shape (100, 100, 250).

Parameters

traces (ndarray) – The data array to use for calculating energy.

Returns

An array the same dimensions as the input array.

Return type

ndarray

bruges.attribute.complex.instantaneous_frequency(traces, dt, kind='so', percentile_clip=99)[source]#

Compute instantaneous frequency with a discrete approximation.

The attribute is computed over the last dimension. That is, time should be in the last dimension, so a 100 inline, 100 crossline seismic volume with 250 time slices would have shape (100, 100, 250).

These attributes can be noisy so a percentile clips is applied.

Parameters
• traces (ndarray) – The data array to use for calculating energy.

• dt (float) – The sample interval in seconds, e.g. 0.004 for 4 ms sample interval (250 Hz sample frequency).

• kind (str) – “scipy”, “claerbout” or “so” to denote a naive method from the SciPy docs, Claerbout’s (1985) method or that of Scheuer & Oldenburg (1988). Claerbout’s approximation is not stable above about half the Nyquist frequency (i.e. one quarter of the sampling frequency). The SciPy implementation is not recommended for seismic data.

• percentile_clip (float) – Percentile at which to clip the data. Computed from the absolute values, clipped symmetrically at -p and +p, where p is the value at the 98th percentile.

Returns

An array the same dimensions as the input array.

Return type

ndarray

bruges.attribute.complex.instantaneous_phase(traces)[source]#

Compute the instantaneous phase of the data.

$\phi(t) = {\rm Im}[\ln h(t)]$
Parameters

traces (ndarray) – The data array to use for calculating energy.

Returns

An array the same dimensions as the input array.

Return type

ndarray

Parameters

traces (ndarray) – The data array to use for calculating energy.

Returns

An array the same dimensions as the input array.

Return type

ndarray

bruges.attribute.complex.reflection_strength(traces)#

Compute instantaneous amplitude, also known as the envelope or reflection strength.

The attribute is computed over the last dimension. That is, time should be in the last dimension, so a 100 inline, 100 crossline seismic volume with 250 time slices would have shape (100, 100, 250).

Parameters

traces (ndarray) – The data array to use for calculating energy.

Returns

An array the same dimensions as the input array.

Return type

ndarray

## bruges.attribute.dipsteer module#

bruges.attribute.dipsteer.dipsteer(data, window_length, stepout, maxlag, overlap=1, dt=1, return_correlation=False)[source]#

Calculates a dip field by finding the maximum correlation between adjacent traces.

Parameters
• (ndarray) (data) – A 2D seismic section (samples,traces) used to calculate dip.

• (float) (maxlag) – The length [in ms] of the window to use.

• (int) (stepout) – The number of traces on either side of each point to average when calculating the dip.

• (float) – The maximum amount time lag to use when correlating the traces.

Keyword Arguments
• (float) (dt) – The fractional overlap for each window. A value of 0 uses no redudant data, a value of 1 slides the dip correlator one sample at a time. Defaults to 1.

• (float) – The time sample interval in ms.

• (bool) (return_correlation) – Whether to return the correlation coefficients. If you choose True, you’ll get a tuple, not an ndarray.

Returns

a dip field [samples/trace] of the same shape as the input data (and optionally correlation coefficients, in which case you’ll get a tuple of ndarrays back).

## bruges.attribute.discontinuity module#

bruges.attribute.discontinuity.discontinuity(traces, duration, dt, step_out=1, kind='gst', sigma=1)[source]#

Compute discontinuity for a seismic section using one of various methods.

Expects time or depth to be in the last axis of a 2D or 3D input.

Parameters
• traces – A 2D or 3D NumPy array arranged as (cdp, twt) or (iline, xline, twt).

• duration – The length in seconds of the window trace kernel used to calculate the discontinuity.

Keyword Arguments
• (default=1) (sigma) – The sample interval of the traces in sec. (eg. 0.001, 0.002, …). Will default to one, allowing duration to be given in samples.

• (default=1) – The number of adjacent traces to the kernel to compute discontinuity over.

• (default='gst') (kind) – The method to use for the computation. Can be “marfurt”, “gersztenkorn” or “gst” (gradient structure tensor).

• (default=1) – The width of the Gaussian function used to compute gradients.

bruges.attribute.discontinuity.gersztenkorn(traces)[source]#

Gersztenkorn, A., and K. J. Marfurt, 1999, Eigenstructure‐based coherence computations as an aid to 3-D structural and stratigraphic mapping: GEOPHYSICS, 64, 1468-1479. doi:10.1190/1.1444651

bruges.attribute.discontinuity.gst_calc(region)[source]#
bruges.attribute.discontinuity.gst_discontinuity(seismic, window, sigma=1)[source]#

Randen, T., E. Monsen, C. Singe, A. Abrahamsen, J. Hansen, T. Saeter, and J. Schlaf, 2000, Three-dimensional texture attributes for seismic data analysis, 70th Annual International Meeting, SEG, Expanded Abstracts, 668-671.

bruges.attribute.discontinuity.marfurt(traces)[source]#

Marfurt, K., V. Sudhaker, A. Gersztenkorn, K. D. Crawford, and S. E. Nissen, 1999, Coherency calculations in the presence of structural dip: GEOPHYSICS, 64, 104-111. doi:10.1190/1.1444508

bruges.attribute.discontinuity.moving_window(traces, func, window)[source]#

Helper function for multi-trace attribute generation. This function applies a 3D function func to process a region of shape window over a dataset data.

Applies the given function func over a moving window, reducing the input grad array from 4D to 3D.

bruges.attribute.discontinuity.similarity(traces, duration, dt, step_out=1, kind='gst', sigma=1)#

Compute discontinuity for a seismic section using one of various methods.

Expects time or depth to be in the last axis of a 2D or 3D input.

Parameters
• traces – A 2D or 3D NumPy array arranged as (cdp, twt) or (iline, xline, twt).

• duration – The length in seconds of the window trace kernel used to calculate the discontinuity.

Keyword Arguments
• (default=1) (sigma) – The sample interval of the traces in sec. (eg. 0.001, 0.002, …). Will default to one, allowing duration to be given in samples.

• (default=1) – The number of adjacent traces to the kernel to compute discontinuity over.

• (default='gst') (kind) – The method to use for the computation. Can be “marfurt”, “gersztenkorn” or “gst” (gradient structure tensor).

• (default=1) – The width of the Gaussian function used to compute gradients.

## bruges.attribute.energy module#

bruges.attribute.energy.energy(traces, duration, dt=1)[source]#

Compute an mean-squared energy measurement on seismic data.

The attribute is computed over the last dimension. That is, time should be in the last dimension, so a 100 inline, 100 crossline seismic volume with 250 time slices would have shape (100, 100, 250).

Parameters
• traces (ndarray) – The data array to use for calculating energy.

• duration (float) – the time duration of the window (in seconds), or samples if dt=1.

• dt (float) – the sample interval of the data (in seconds). Defaults to 1 so duration can be in samples.

Returns

An array the same dimensions as the input array.

Return type

ndarray

## bruges.attribute.horizon module#

bruges.attribute.horizon.dip(arr)[source]#

## bruges.attribute.spectraldecomp module#

bruges.attribute.spectraldecomp.spectraldecomp(data, f=(0.1, 0.25, 0.4), window_length=32, dt=1, window_type='hann', overlap=1, normalize=False)[source]#

Uses the STFT to decompose traces into normalized spectra. Only frequencies defined by the user will be output. Using 3 frequencies will work for RGB color plots.

Parameters

data – A 1/2D array (samples, traces) of data that will be decomposed.

Keyword Arguments
• f – A list of frequencies to select from the spectra.

• window_length – The length of fft window to use for the STFTs. Defaults to 32. Can be provided in seconds if dt is specified.

• dt – The time sample interval of the traces.

• window_type – The type of window to use for the STFT. The same input as scipy.signal.get_window.

• overlap – The fraction of overlap between adjacent STFT windows

• normalize – Normalize the energy in each STFT window

Returns

an array of shape (samples, traces, f)

## bruges.attribute.spectrogram module#

bruges.attribute.spectrogram.spectrogram(data, window_length, dt=1.0, window_type='boxcar', overlap=0.5, normalize=False, zero_padding=0)[source]#

Calculates a spectrogram using windowed STFTs.

Parameters
• data (array) – 1D numpy array to process into spectra.

• window_length (float) – The length of the window in seconds if dt is set, otherwise in samples. Will zero pad to the closest power of two.

• window_type – A string specifying the type of window to use for the STFT. The same input as scipy.signal.get_window

• dt (float or int) – The time sample interval of the trace. Defaults to 1, which allows window_length to be in seconds.

• overlap (float) – The fractional overlap for each window. A value of 0 uses no redudant data, a value of 1 slides the STFT window one sample at a time. Defaults to 0.5

• normalize (bool) – Normalizes the each spectral slice to have unity energy.

• zero_padding (float or int) – The amount of zero padding to when creating the spectra.

Returns

out

Return type

A spectrogram of the data ([time, freq]). (2D array for 1D input)

spectraldecomp