HvsrSpatial

HvsrSpatial class definition.

class HvsrSpatial(coordinates)

Bases: object

A container of HVSR results for spatial computations.

Variables:

coordinates (ndarray) – Relative x and y coordinates of the sensors, where each row of the ndarray in an x, y pair.

__init__(coordinates)

Create a container for spatial distributed HVSR.

Parameters:

coordinates (ndarray) – Relative x and y coordinates of the sensors, where each row of the ndarray in an x, y pair.

bounded_voronoi(boundary)

Vertices of bounded Voronoi region.

Parameters:

boundary (ndarray) – x, y coordinates defining the spatial boundary. Must be of shape (N, 2).

Returns:

tuple – Of the form (new_vertices, indices) where new_vertices` defines the vertices of each region and indices indicates how these vertices relate to the provided coordiantes.

spatial_weights(boundary, declustering_method='voronoi')

Calculate the weights for each Voronoi region.

Parameters:
  • boundary (ndarray) – x, y coordinates defining the spatial boundary. Must be of shape (N, 2).

  • declustering_method ({“voronoi”}, optional) – Declustering method, default is 'voronoi'.

Returns:

tuple – Of the form (weights, indices) where weights are the statistical weights and indicates the bounding box of each cell.

montecarlo_fn(generator_means, generator_stddevs, generator_weights, distribution_generators='lognormal', distribution_spatial='lognormal', n_realizations=1000, rng=None)

MonteCarlo simulation for spatial distribution of fn.

Parameters:
  • generator_means, generator_stddevs (ndarray) – Mean and standard deviations of each generating point. Meaning of these parameters is dictated by distribution_generators.

  • generator_weights (ndarray) – Weights for each generating point.

  • distribution_generators ({‘lognormal’, ‘normal’}, optional) – Assumed distribution of each generating point, default is lognormal.

    if dist is

    mean must be

    stddev must be

    normal

    \(\mu\)

    \(\sigma\)

    lognormal

    \(\lambda\)

    \(\zeta\)

  • distribution_spatial ({‘lognormal’, ‘normal’}, optional) – Assumed distribution of spatial statistics on fn, default is lognormal.

  • rng (None, optional) – User-defined random number generator (RNG), default is None indicating default_rng() will be used.

Returns:

tuple – Of the form (fn_mean, fn_stddev, fn_realizations).

class HvsrSpatial(coordinates)

A container of HVSR results for spatial computations.

Variables:

coordinates (ndarray) – Relative x and y coordinates of the sensors, where each row of the ndarray in an x, y pair.

__init__(coordinates)

Create a container for spatial distributed HVSR.

Parameters:

coordinates (ndarray) – Relative x and y coordinates of the sensors, where each row of the ndarray in an x, y pair.

bounded_voronoi(boundary)

Vertices of bounded Voronoi region.

Parameters:

boundary (ndarray) – x, y coordinates defining the spatial boundary. Must be of shape (N, 2).

Returns:

tuple – Of the form (new_vertices, indices) where new_vertices` defines the vertices of each region and indices indicates how these vertices relate to the provided coordiantes.

spatial_weights(boundary, declustering_method='voronoi')

Calculate the weights for each Voronoi region.

Parameters:
  • boundary (ndarray) – x, y coordinates defining the spatial boundary. Must be of shape (N, 2).

  • declustering_method ({“voronoi”}, optional) – Declustering method, default is 'voronoi'.

Returns:

tuple – Of the form (weights, indices) where weights are the statistical weights and indicates the bounding box of each cell.