query_Vs_given_thk#

PySeismoSoil.helper_site_response.query_Vs_given_thk(vs_profile: ndarray, thk: float | numpy.ndarray, n_layers: int | None = None, at_midpoint: bool = True) tuple[numpy.ndarray, numpy.ndarray][source]#

Query Vs values from a thickness array “thk”. The starting point of querying is the ground surface.

Parameters:
  • vs_profile (np.ndarray) –

    Shear-wave velocity profile, containing at least two columns:
    1. thickness of layers

    2. shear wave velocity of layers

  • thk (float | np.ndarray) – Thickness array, or a single value that means a constant thickness.

  • n_layers (int | None) – Number of layers to query. This parameter has no effect if thk is a numpy array (because the number of layers can be inferred from thk).

  • at_midpoint (bool) – If True, the Vs values are queried at the mid-point depths of each layer. If False, at the top of each layer.

Returns:

  • vs_array (np.ndarray) – Vs values corresponding to the given depths. Its type depends on as_profile.

  • thk_array (np.ndarray) – The constructed thickness array (if thk is a scalar), or thk itself, if thk is already an array.

Raises:
  • TypeError – When the types of input parameters are incorrect

  • ValueError – When n_layers is not positive