Mondaic
This API reference is not for the latest stable Salvus version.

salvus.material.attenuation

A module to handle attenuation parameters.

Functions

alpha2q()

def alpha2q(
    alpha: salvus.material.attenuation.T,
    soundspeed: float,
    frequency_in_hertz: float,
    length_in_meters: float,
) -> salvus.material.attenuation.T: ...

Convert an attenuation factor alpha to a seismic quality factor.

The attenuation factor is usually given in dB per frequency and length unit which need to be specified here.

Q can either be Qp or Qs, depending on the passed velocity and the resulting attenuation factor will be for that wave type.

Follows appendix A in

Pratt, R. G., Medical ultrasound tomography: lessons learned from geophysics, MUST proceedings 2017

Parameters
  • alpha salvus.material.attenuation.T — The attenuation factor.
  • soundspeed float — The medium’s velocity in meters / seconds.
  • frequency_in_hertz float — The frequency at which to compute the attenuation factor.
  • length_in_meters float — The length unit for which to compute the attenuation factor.
Returns salvus.material.attenuation.T

get_bandwidth()

def get_bandwidth(
    frequency_in_hertz: float, n_linear_solids: int
) -> builtins.tuple: ...

Obtain the suggested bandwidth for a given frequency and number of linear solids.

Following van Driel & Nissen-Meyer (2014), the minimum frequency is computed at an error threshold of 1% for he Q factor.

Parameters
  • frequency_in_hertz float — Reference frequency, for instance, the maximum resolved frequency of a mesh.
  • n_linear_solids int — Number of linear solids.
Returns builtins.tuple

lsqr_fit_q_factor_model()

def lsqr_fit_q_factor_model(
    min_frequency_in_hertz: float,
    max_frequency_in_hertz: float,
    n_linear_solids: int = 5,
    power_law_ref_frequency_in_hertz: float = 1.0,
    power_law_exponent: float = 0.0,
    linearized: bool = True,
    samples: int = 100,
    weighted_least_squares: bool = True,
) -> builtins.tuple: ...

Invert for the parameters of a linear solid.

Parameters
  • min_frequency_in_hertz float — Lower bound of the frequency band.
  • max_frequency_in_hertz float — Upper bound of the frequency band.
  • n_linear_solids int — Number of standard linear solids (SLS).
  • power_law_ref_frequency_in_hertz float — Reference frequency in the power law approximation.
  • power_law_exponent float — Exponent in the power law approximation.
  • linearized bool — Enable/disable linearization in the SLS approximation, see eq. (21) in van Driel & Nissen-Meyer (2014).
  • samples int — Number of frequency samples used in the least-squares fit.
  • weighted_least_squares bool — Enable/disable frequency-dependent weights in the least-squares fit.
Returns builtins.tuple — A tuple of two arrays for the sample frequencies w_j and coefficients y_j of the linear solid approximation.

q2alpha()

def q2alpha(
    q: salvus.material.attenuation.T,
    soundspeed: float,
    frequency_in_hertz: float,
    length_in_meters: float,
) -> salvus.material.attenuation.T: ...

Convert a seismic quality factor to an attenuation factor alpha.

The attenuation factor is usually given in dB per frequency and length unit which need to be specified here.

Q can either be Qp or Qs, depending on the passed velocity and measured attenuation factor.

Follows appendix A in

Pratt, R. G., Medical ultrasound tomography: lessons learned from geophysics, MUST proceedings 2017

Parameters
  • q salvus.material.attenuation.T — The quality factor.
  • soundspeed float — The medium’s velocity in meters / seconds.
  • frequency_in_hertz float — The frequency at which to compute the attenuation factor.
  • length_in_meters float — The length unit for which to compute the attenuation factor.
Returns salvus.material.attenuation.T

q_factor_from_linear_solid()

def q_factor_from_linear_solid(
    frequency_in_hertz: salvus.material.attenuation.T,
    w: numpy.ndarray,
    y: numpy.ndarray,
    linearized: bool = True,
) -> numpy.ndarray: ...

Compute a frequency-dependent Q using standard linear solids (SLS).

The approximation is based on van Driel & Nissen-Meyer (2014).

Parameters
  • frequency_in_hertz salvus.material.attenuation.T — Frequencies at which the Q factor is computed from the SLS.
  • w numpy.ndarray — SLS collocation frequencies, c.f. w_j in eqs. (6) - (8).
  • y numpy.ndarray — SLS collocation coefficients, c.f. y_j in eqs. (6) - (8).
  • linearized bool — Enable/disable linearization in the SLS approximation, see eq. (21).
Returns numpy.ndarray

q_factor_from_power_law()

def q_factor_from_power_law(
    frequency_in_hertz: salvus.material.attenuation.T,
    reference_q_factor: float,
    reference_frequency_in_hertz: float,
    exponent: float,
) -> salvus.material.attenuation.T: ...

Compute a frequency-dependent Q using a power-law approximation.

The frequency-dependence of the Q factor within a certain frequency band is commonly approximated by a power law, cf. eq. (11) in Fichtner & van Driel (2014).

Parameters
  • frequency_in_hertz salvus.material.attenuation.T — Frequencies at which the Q factor is computed according to the power law.
  • reference_q_factor float — Reference Q factor.
  • reference_frequency_in_hertz float — Reference frequency
  • exponent float — The exponent of the power law. A value of zero corresponds to the case of a constant, i.e., frequency-independent Q factor.
Returns salvus.material.attenuation.T

qkappa2qp()

def qkappa2qp(
    qkappa: salvus.material.attenuation.T,
    qmu: salvus.material.attenuation.T,
    vp: salvus.material.attenuation.T,
    vs: salvus.material.attenuation.T,
    dim: Literal[2, 3],
) -> salvus.material.attenuation.T: ...

Convert Qkappa to Qp.

Formula (9.59) from Dahlen and Tromp, 1998.

Parameters
  • qkappa salvus.material.attenuation.T — The Qkappa value.
  • qmu salvus.material.attenuation.T — The Qmu value.
  • vp salvus.material.attenuation.T — The P-wave velocity in the medium in m/s.
  • vs salvus.material.attenuation.T — The S-wave velocity in the medium in m/s.
  • dim Literal[2, 3] — The dimension.
Returns salvus.material.attenuation.T

qmu2qs()

def qmu2qs(
    qmu: salvus.material.attenuation.T,
) -> salvus.material.attenuation.T: ...

Convert Qmu to Qs.

Formula (9.60) from Dahlen and Tromp, 1998.

Parameters
  • qmu salvus.material.attenuation.T — The Qmu value to convert.
Returns salvus.material.attenuation.T

qp2qkappa()

def qp2qkappa(
    qp: salvus.material.attenuation.T,
    qs: salvus.material.attenuation.T,
    vp: salvus.material.attenuation.T,
    vs: salvus.material.attenuation.T,
    dim: Literal[2, 3],
) -> salvus.material.attenuation.T: ...

Convert Qp to Qkappa.

Formula (9.59) from Dahlen and Tromp, 1998.

Parameters
  • qp salvus.material.attenuation.T — The Qp value.
  • qs salvus.material.attenuation.T — The Qs value.
  • vp salvus.material.attenuation.T — The P-wave velocity in the medium in m/s.
  • vs salvus.material.attenuation.T — The S-wave velocity in the medium in m/s.
  • dim Literal[2, 3] — The dimension.
Returns salvus.material.attenuation.T

qs2qmu()

def qs2qmu(
    qs: salvus.material.attenuation.T,
) -> salvus.material.attenuation.T: ...

Convert Qs to Qmu.

Formula (9.60) from Dahlen and Tromp, 1998.

Parameters
  • qs salvus.material.attenuation.T — The Qs value to convert.
Returns salvus.material.attenuation.T