wavefieldtransforms

Wavefield transform class definitions.

class AbstractWavefieldTransform(frequencies, velocities, power)

Bases: ABC

Wavefield transformation of an Array1D.

__init__(frequencies, velocities, power)

Define AbstractWavefieldTransform.

find_peak_power(by='frequency-maximum', **kwargs)

Find maximum WavefieldTransform power.

Parameters:
  • by ({“frequency-maximum”, “find_peaks”}, optional) – Determines how the maximum surface wave dispersion power is selected, default is ‘frequency-maximum’. frequency-maximum as the name indicates simply returns the single maximum power point’s velocity at each frequency. find_peaks uses the function by the same name from the scipy package, keyword arguments can be entered as kwargs.

  • kwargs (kwargs, optional) – Keyword arguments, different for each search method.

Returns:

ndarray – Containing the peak velocity at each frequency.

classmethod from_array(array, settings)
normalize(by='frequency-maximum')

Normalize WavefieldTransform power.

Parameters:

by ({“none”, “absolute-maximum”, “frequency-maximum”}, optional) – Determines how the surface wave dispersion power is normalized, default is ‘frequency-maximum’.

Returns:

None – Update the internal state of power.

plot(fig=None, ax=None, cax=None, normalization='frequency-maximum', peaks='frequency-maximum', nearfield=None, cmap='jet', peak_kwargs=None, colorbar_kwargs=None, rasterize=False)

Plot the WavefieldTransform’s dispersion image.

Parameters:
  • ax (Axes, optional) – Axes object on which to plot the dispersion image, default is None so an Axes will be created on-the-fly.

  • cax (Axes, optional) – Axes object on which to plot the colorbar for the disperison image, default is None so an Axes will be created from ax.

  • normalization ({“none”, “absolute-maximum”, “frequency-maximum”}, optional) – Determines how the surface wave dispersion power is normalized, default is ‘frequency-maximum’.

  • peaks ({“none”, “frequency-maximum”}, optional) – Determines if the spectral peaks are shown and if so how they will be determined, default is ‘frequency-maximum’.

  • nearfield (int, optional) – Number of array center distances per wavelength following Yoon and Rix (2009), default is None so nearfield criteria will not be plotted. A value of 1 corresponds to ~15% error and 2 ~5% error.

  • peak_kwargs (dict, optional) – Keyword arguments to control the appearance of the spectral peaks, default is None so the default settings will be used.

Returns:

tuple or Nonetuple of the form (fig, ax) if ax=None, None otherwise.

plot_snr(ax=None, plot_kwargs=None)
abstract classmethod transform(array, velocities, settings)

Abstract transform method.

class EmptyWavefieldTransform(frequencies, velocities, power)

Bases: AbstractWavefieldTransform

classmethod from_array(array, settings)
stack(other)
classmethod transform(array, velocities, settings)

Empty transform method.

class FDBF(frequencies, velocities, power)

Bases: AbstractWavefieldTransform

classmethod transform(array, velocities, settings)

Perform Frequency-Domain Beamforming.

Parameters:
  • array (Array1D) – Instance of Array1D.

  • velocities (ndarray) – Vector of trial velocities.

  • settings (dict) – dict with processing settings.

Returns:

tuple – Of the form (frequencies, power).

class FK(frequencies, velocities, power)

Bases: FDBF

classmethod from_array(array, settings)
class PhaseShift(frequencies, velocities, power)

Bases: AbstractWavefieldTransform

classmethod transform(array, velocities, settings)

Perform the Phase-Shift Transform.

Parameters:
  • array (Array1D) – Instance of Array1D.

  • velocities (ndarray) – Vector of trial velocities.

  • settings (dict) – dict with processing settings.

Returns:

tuple – Of the form (frequencies, power).

class SlantStack(frequencies, velocities, power)

Bases: AbstractWavefieldTransform

classmethod slant_stack(array, velocities)

Perform a slant-stack on the given wavefield data.

Parameters:
  • array (Array1d) – One-dimensional array object.

  • velocities (ndarray) – One-dimensional array of trial velocities.

Returns:

tuple – Of the form (tau, slant_stack) where tau is an ndarray of the attempted intercept times and slant_stack are the slant-stacked waveforms.

classmethod transform(array, velocities, settings)

Perform the Slant-Stack transform.

Parameters:
  • array (Array1D) – Instance of Array1D.

  • velocities (ndarray) – Vector of trial velocities.

  • settings (dict) – dict with processing settings.

Returns:

tuple – Of the form (frequencies, power).