SVM#

class PySeismoSoil.class_svm.SVM(target_Vs30: float, *, z1: float | None = None, Vs_cap: bool | float = True, eta: float = 0.9, show_fig: bool = False, iterate: bool = False, verbose: bool = False)[source]#

Bases: object

Class implementation for the Sediment Velocity Model (SVM).

Original paper:

Shi & Asimaki (2018) “A generic velocity profile for basin sediments in California conditioned on Vs30”. Seismological Research Letters, 89(4)

Parameters:
  • target_Vs30 (float) – The Vs30 value to be queried. Unit: m/s.

  • z1 (float | None) – The depth to bedrock (1,000 m/s rock). Unit: m. If None, it will be estimated from Vs30 using an empirical correlation (see documentation of helper_site_response.calc_z1_from_Vs30()).

  • Vs_cap (bool | float) – Whether to “cap” the Vs profile or not. If True, then the Vs profile is capped at 1000.0 m/s; if specified as another real number, Vs profile is capped at that value. If the resultant Vs profile does not reach Vs_cap at z1, it will be “glued” to Vs_cap, resulting in a velocity impedance at z1. If the Vs profile exceeds Vs_cap at a depth shallower than z1, then the smooth Vs profile is truncated at a depth where Vs = eta * Vs_cap, then filled down to z1 with linearly increasing Vs values.

  • eta (float) – If Vs will reach Vs_cap (usually 1000 m/s) before the depth of z1, the SVM Vs profile will stop at Vs = eta * Vs_cap, and then a linear Vs gradation will be filled from eta * Vs_cap to Vs_cap. Do not change this parameter, unless you know what you are doing.

  • show_fig (bool) – Whether to plot the generated Vs profile.

  • iterate (bool) – Whether to iteratively adjust the input Vs30 so that the actual Vs30 (calculated from the resultant Vs profile) falls within 10 m/s of the target_Vs30. (There is usually no need to do this.)

  • verbose (bool) – Whether to print iteration progress (trial Vs30 value and calculated Vs30 value) on the terminal. It has no effects if iterate is False.

Vs30#

The target Vs30 value, in m/s.

Type:

float

z1#

The basin depth, in meters.

Type:

float

base_profile#

The base Vs profile associated with the given Vs30 and z1.

Type:

PySeismoSoil.class_Vs_profile.Vs_Profile

bedrock_Vs#

Bedrock Vs, either user-specified (via Vs_cap), or automatically chosen as 1,000 m/s, or None (if Vs_cap is False).

Type:

float

has_bedrock_Vs#

Whether the Vs profile has a bedrock Vs value.

Type:

bool

Raises:

ValueError – When values of some input arguments are not correct/valid

Methods Summary

get_discretized_profile(*[, fixed_thk, ...])

Return the discretized Vs profile (with user-specified layer thickness, or Vs increment).

get_randomized_profile([seed, show_fig, ...])

Return a randomized a 1D profile.

plot([fig, ax, figsize, dpi])

Plot the base profile.

Methods Documentation

get_discretized_profile(*, fixed_thk: float = None, Vs_increment: float = None, at_midpoint: bool = True, show_fig: bool = False) Vs_Profile[source]#

Return the discretized Vs profile (with user-specified layer thickness, or Vs increment).

Parameters:
  • fixed_thk (float) – The layer thickness for each layer.

  • Vs_increment (float) – The Vs increment between adjacent layers.

  • at_midpoint (bool) – Whether to return Vs values queried at the top of each layer depth. It is strongly recommended that you use True. Using False will produce biased Vs profiles.

  • show_fig (bool) – Whether to show the figure of smooth and discretized profiles.

Returns:

discr_prof – Discretized Vs profile.

Return type:

Vs_Profile

Raises:

ValueError – When the values of some input arguments are incorrect/invalid

get_randomized_profile(seed: float | None = None, show_fig: bool = False, use_Toros_layering: bool = False, use_Toros_std: bool = False, vs30_z1_compliance: bool = False, verbose: bool = True) Vs_Profile[source]#

Return a randomized a 1D profile.

Parameters:
  • seed (float | None) – The seed value for setting the random state. It not set, this method automatically uses the current time to generate a seed.

  • show_fig (bool) – Whether to show the figure of smooth and randomized profiles.

  • use_Toros_layering (bool) – Whether to use the layering relation in Toro (1995) instead of Eq (7) of Shi & Asimaki (2018).

  • use_Toros_std (bool) – Whether to use the standard deviation (i.e., sigma(ln(Vs))) in Toro (1995) instead of Eq (9) of Shi & Asimaki (2018).

  • vs30_z1_compliance (bool) –

    Whether to ensure that the resultant Vs30 and z1 of the randomized profile are compliant with the user-specified Vs30 and z1 values. The criteria for “compliance” are:

    1. The absolute difference between the randomized and target Vs30 is < 25 m/s;

    2. The relative difference (between the randomized profile and the base profile) of the last soil layer’s Vs is < 5%;

    3. The relative difference of the randomized and target z1 is < 20%.

  • verbose (bool) – Whether to show the progress of iteratively searching for compliant randomized Vs profile. Only effective if vs30_z1_compliance is True.

Returns:

Vs_profile – The randomized Vs profile.

Return type:

Vs_Profile

Raises:

TypeError – If seed is not a number or not None

plot(fig: matplotlib.figure.Figure | None = None, ax: matplotlib.axes._axes.Axes | None = None, figsize: tuple[float, float] = (2.6, 3.2), dpi: float = 100, **kwargs: dict[Any, Any]) tuple[matplotlib.figure.Figure, matplotlib.axes._axes.Axes, matplotlib.lines.Line2D][source]#

Plot the base profile.

Parameters:
  • fig (Figure | None) – Figure object. If None, a new figure will be created.

  • ax (Axes | None) – Axes object. If None, a new axes will be created.

  • figsize (tuple[float, float]) – Figure size in inches, as a tuple of two numbers. The figure size of fig (if not None) will override this parameter.

  • dpi (float) – Figure resolution. The dpi of fig (if not None) will override this parameter.

  • **kwargs (dict[Any, Any]) – Other keyword arguments to be passed to helper_site_response.plot_Vs_profile().

Returns:

  • fig (Figure) – The figure object being created or being passed into this function.

  • ax (Axes) – The axes object being created or being passed into this function.

  • h_line (Line2D) – The line object.