salvus.material.attenuation
A module to handle attenuation parameters.
Functions
alpha2q()
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
alphasalvus.material.attenuation.T — The attenuation factor.soundspeedfloat — The medium’s velocity in meters / seconds.frequency_in_hertzfloat — The frequency at which to compute the attenuation factor.length_in_metersfloat — The length unit for which to compute the attenuation factor.
get_bandwidth()
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.
frequency_in_hertzfloat — Reference frequency, for instance, the maximum resolved frequency of a mesh.n_linear_solidsint — Number of linear solids.
lsqr_fit_q_factor_model()
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.
min_frequency_in_hertzfloat — Lower bound of the frequency band.max_frequency_in_hertzfloat — Upper bound of the frequency band.n_linear_solidsint — Number of standard linear solids (SLS).power_law_ref_frequency_in_hertzfloat — Reference frequency in the power law approximation.power_law_exponentfloat — Exponent in the power law approximation.linearizedbool — Enable/disable linearization in the SLS approximation, see eq. (21) in van Driel & Nissen-Meyer (2014).samplesint — Number of frequency samples used in the least-squares fit.weighted_least_squaresbool — Enable/disable frequency-dependent weights in the least-squares fit.
q2alpha()
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
qsalvus.material.attenuation.T — The quality factor.soundspeedfloat — The medium’s velocity in meters / seconds.frequency_in_hertzfloat — The frequency at which to compute the attenuation factor.length_in_metersfloat — The length unit for which to compute the attenuation factor.
q_factor_from_linear_solid()
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).
frequency_in_hertzsalvus.material.attenuation.T — Frequencies at which the Q factor is computed from the SLS.wnumpy.ndarray — SLS collocation frequencies, c.f. w_j in eqs. (6) - (8).ynumpy.ndarray — SLS collocation coefficients, c.f. y_j in eqs. (6) - (8).linearizedbool — Enable/disable linearization in the SLS approximation, see eq. (21).
q_factor_from_power_law()
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).
frequency_in_hertzsalvus.material.attenuation.T — Frequencies at which the Q factor is computed according to the power law.reference_q_factorfloat — Reference Q factor.reference_frequency_in_hertzfloat — Reference frequencyexponentfloat — The exponent of the power law. A value of zero corresponds to the case of a constant, i.e., frequency-independent Q factor.
qkappa2qp()
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.
qkappasalvus.material.attenuation.T — The Qkappa value.qmusalvus.material.attenuation.T — The Qmu value.vpsalvus.material.attenuation.T — The P-wave velocity in the medium in m/s.vssalvus.material.attenuation.T — The S-wave velocity in the medium in m/s.dimLiteral[2, 3] — The dimension.
qmu2qs()
qmu2qs()def qmu2qs(
qmu: salvus.material.attenuation.T,
) -> salvus.material.attenuation.T: ...Convert Qmu to Qs.
Formula (9.60) from Dahlen and Tromp, 1998.
qmusalvus.material.attenuation.T — The Qmu value to convert.
qp2qkappa()
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.
qpsalvus.material.attenuation.T — The Qp value.qssalvus.material.attenuation.T — The Qs value.vpsalvus.material.attenuation.T — The P-wave velocity in the medium in m/s.vssalvus.material.attenuation.T — The S-wave velocity in the medium in m/s.dimLiteral[2, 3] — The dimension.
qs2qmu()
qs2qmu()def qs2qmu(
qs: salvus.material.attenuation.T,
) -> salvus.material.attenuation.T: ...Convert Qs to Qmu.
Formula (9.60) from Dahlen and Tromp, 1998.
qssalvus.material.attenuation.T — The Qs value to convert.