SeisPolPy package

Submodules

SeisPolPy.Flinn module

Flinn Method.

copyright

Eduardo Rodrigues de Almeida Hamzeh Mohammadigheymasi Paul Andrew Crocker

license

The MIT License (MIT) Copyright (c) 2021 MrEdwards

SeisPolPy.Flinn.flinn(data, window_size)

Obtaining rectilinearity and direction of particle motion in a three component signal by implementing the method designed by E. A. Flinn. Signal in Z, R, T orientation.

Parameters
  • data (int) – Three component signal data.

  • window_size – Size for the window.

Returns

array with rectilinearity values, array with polarization direction of the z component, array with polarization direction of the r component, array with polarization direction of the t component and a base64 encoded string of bytes containing the previous arrays plots.

SeisPolPy.Vidale module

Vidale Method.

copyright

Eduardo Rodrigues de Almeida Hamzeh Mohammadigheymasi Paul Andrew Crocker

license

The MIT License (MIT) Copyright (c) 2021 MrEdwards

SeisPolPy.Vidale.vidale(data, window_size)

Obtaining the elliptical component of polarization, strike, inclination (dip), polarization strength of the signal and the degree of planar polarization by implementing the method designed by John E. Vidale. Signal in Z, R, T orientation.

Parameters
  • data (int) – Three component signal data.

  • window_size – Size for the window.

Returns

numpy array with elliptical component of polarization, numpy array with strike, numpy array with dip, numpy array with polarization strenght of the signal and a numpy array with degree of planar polarization.

SeisPolPy.Rstfr module

RSTFR Method.

copyright

Eduardo Rodrigues de Almeida Hamzeh Mohammadigheymasi Paul Andrew Crocker

license

The MIT License (MIT) Copyright (c) 2021 MrEdwards

SeisPolPy.Rstfr.amplitude(zeta, eta, eig_values, L)

Creates the amplitude filter.

Parameters
  • zeta (float) – default value is 0.26. Amplitude filter adjusting parameter.

  • eta (float) – default value is 0.23. Amplitude filter adjusting parameter.

  • eig_values (array) – array containing all the eigenvalues for the given signal.

Returns

the obtained amplitude value.

SeisPolPy.Rstfr.cross(x1, x2)

Cross function performs cross correlation.

Parameters
  • x1 (array) – signal component array

  • x2 (array) – signal component array

Returns

numpy array

SeisPolPy.Rstfr.directivity_love(gamma, lamb_da, eig_vec3)

Creates the directivity filter for love waves.

Parameters
  • gamma – default value is 0.25. Directivity filter adjusting parameter.

  • beta (float) – default value is 0.3. Directivity filter adjusting parameter.

  • eig_vec3 (array) – array containing all the biggest eigenvectors for the given signal.

Returns

the obtained directivity value for the love wave.

SeisPolPy.Rstfr.directivity_rayleigh(gamma, lamb_da, eig_vec3)

Creates the directivity filter for raileigh waves.

Parameters
  • gamma – default value is 0.25. Directivity filter adjusting parameter.

  • beta (float) – default value is 0.3. Directivity filter adjusting parameter.

  • eig_vec3 (array) – array containing all the biggest eigenvectors for the given signal.

Returns

array containing the obtained directivity values for the rayleigh wave.

SeisPolPy.Rstfr.forward(N, s)
Parameters
  • N (int) – length of component array

  • s (int) – with default value of S equal to 100.

Returns

scipy sparse dia matrix.

SeisPolPy.Rstfr.rectilinearity(alpha, beta, eig_values)

Creates the rectilinearity filter.

Parameters
  • alpha (float) – default value is 0.1. Rectilinearity filter adjusting parameter.

  • beta (float) – default value is 0.12. Rectilinearity filter adjusting parameter.

  • eig_values (array) – array containing all the eigenvalues for the given signal.

Returns

the obtained rectilinearity value.

SeisPolPy.Rstfr.rstfr(data, alg='stft', filt='love', s=100, n_it=400, alpha=0.1, beta=0.12, gamma=0.25, lamb_da=0.3, zeta=0.26, eta=0.23)

Obtains semi major, semi minor by implementing an adaptation of pinnegar method which takes advantage of sparsity this method allows for the choice between the normal STFT (Pinnegar Method) and the use of STFT with Sparsity Matrices. Signal in Z, R, T orientation.

Parameters
  • data (array) – Three component signal data.

  • alg – default value is “stft”, corresponds to choosing the method STFT. The other option is to give as input “s_stft”, which indicates that the chosen method is the sparse STFT.

  • filt (string) – default values is “love”, corresponds to choosing the type of waves to be filtered, Love or Rayleigh waves, with the available options of “love” and “rayleigh”.

  • s (int) – default value is 100.

  • n_it (int) – default value is 400, corresponds to the number of iterations for the softthreshholding. This variable is not used if the chosen method is the normal STFT.

  • alpha (int) – default value is 0.1. Rectilinearity filter adjusting parameter.

  • beta (int) – default value is 0.12. Rectilinearity filter adjusting parameter.

  • gamma (int) – default value is 0.25. Directivity filter adjusting parameter.

  • lamb_da (int) – default value is 0.3. Directivity filter adjusting parameter.

  • zeta (int) – default value is 0.26. Amplitude filter adjusting parameter.

  • eta (int) – default value is 0.23. Amplitude filter adjusting parameter.

  • n_it – default value is 400, corresponds to the number of iterations for the softthreshholding. This variable is not used if the chosen method is the normal STFT.

Returns

numpy array with semi major, numpy array with semi minor, numpy array with the filtered data and two base64 encoded strings of bytes containing the previous arrays plots.

SeisPolPy.Rstfr.semimm(t, r, z)

Semi major/minor function which calls the cross coorelation function and performs eigen decomposition.

Parameters
  • t (array) – numpy array regarding the t signal component.

  • r (array) – numpy array regarding the r signal component.

  • z (array) – numpy array regarding the z signal component.

Returns

numpy array semi, major, minor, major_norm, minor_norm

SeisPolPy.Rstfr.soft_threshholding(z, T)

Soft_threshholding function computes the threshholding to the data.

Parameters
  • z (array) – array obtained in the calling function

  • T (array) – array obtained in the calling function

Returns

array with absolute values

SeisPolPy.Rstfr.stft(x, s)

STFT function which calls the forward function and the Cshared library for the adjoint function.

Parameters
  • x (array) – numpy array regarding one the signal components.

  • s (int) – with default value of S equal to 100.

Returns

component data array after applying the STFT.

SeisPolPy.Rstfr.stft_s_istx(x, s, n_it, mu)

Sparse STFT function which calls the forward function, the Cshared library for the adjoint function and forward operator function, and soft threshholding function.

Parameters
  • x (array) – numpy array regarding the r signal component.

  • s (int) – with default value of S equal to 100.

  • n_it (int) – default value is 400, corresponds to the number of iterations for the softthreshholding. This variable is not used if the chosen method is the normal STFT.

  • mu (int) – variable with the mu value of 1e-3.

Returns

data array corresponding to r component of the signal, after applying the sparse STFT.

SeisPolPy.Rstfr.stft_s_isty(y, s, n_it, mu)

Sparse STFT function which calls the forward function, the Cshared library for the adjoint function and forward operator function, and soft threshholding function.

Parameters
  • y (array) – numpy array regarding the t signal component.

  • s (int) – with default value of S equal to 100.

  • n_it (int) – default value is 400, corresponds to the number of iterations for the softthreshholding. This variable is not used if the chosen method is the normal STFT.

  • mu (int) – variable with the mu value of 1e-3.

Returns

data array corresponding to t component of the signal, after applying the sparse STFT.

SeisPolPy.Rstfr.stft_s_istz(z, s, n_it, mu)

Sparse STFT function which calls the forward function, the Cshared library for the adjoint function and forward operator function, and soft threshholding function.

Parameters
  • z (array) – numpy array regarding the z signal component.

  • s (int) – with default value of S equal to 100.

  • n_it (int) – default value is 400, corresponds to the number of iterations for the softthreshholding. This variable is not used if the chosen method is the normal STFT.

  • mu (int) – variable with the mu value of 1e-3.

Returns

data array corresponding to the z component of the signal, after applying the sparse STFT.