Mondaic

salvus.material.attenuation.visualization

salvus.material.attenuation.visualization salvus material attenuation visualization

Visualization utilities for attenuation models.

Functions

plot_q_model()

def plot_q_model(
    number_of_linear_solids: int,
    optimization_frequencies: tuple[float, float],
    reference_frequency_in_hz: float,
    reference_q_factor: float,
    use_log_scale: bool = False,
    power_law_exponent: float = 0.0,
    frequency_range: typing.Literal["auto"] | tuple[float, float] = "auto",
    fig: matplotlib.figure.Figure | None = None,
) -> tuple[
    matplotlib.figure.Figure, tuple[matplotlib.axes.Axes, matplotlib.axes.Axes]
]: ...

Plot the linear-solid Q-model and phase-velocity shift.

The function draws a single figure with two stacked axes. The top axis shows Q−1(f)Q^{-1}(f) with individual SLS contributions, the summed response, and the target power-law model. The bottom axis shows the corresponding phase-velocity shift for a range of Q values.

Parameters
  • number_of_linear_solids int — Number of standard linear solids (SLS).
  • optimization_frequencies tuple[float, float] — Lower and upper frequencies defining the band used for the least-squares fit.
  • reference_frequency_in_hz float — Reference frequency for the power-law model. Phase velocity shifts will also be plotted relative to this frequency.
  • reference_q_factor float — Reference Q-factor at the reference frequency.
  • use_log_scale bool — Use a log-scaled x-axis.
  • power_law_exponent float — Exponent for the power-law Q model.
  • frequency_range typing.Literal['auto'] | tuple[float, float] — Frequency range for plotting. “auto” extends the optimization band by 25% on both sides.
  • fig matplotlib.figure.Figure | None — Optional existing figure. If provided, the plot is drawn into this figure.
Returns tuple[matplotlib.figure.Figure, tuple[matplotlib.axes.Axes, matplotlib.axes.Axes]] — A tuple of the figure and a tuple of the two axes.