HvsrSpatial¶
HvsrVault class definition.
- class HvsrVault(coordinates, means, stddevs=None)¶
Bases:
object
A container for Hvsr objects.
- Variables
coordinates (ndarray) – Relative x and y coordinates of the sensors, where each row of the ndarray in an x, y pair.
means (ndarray) – Mean f0 value for each location, meaning is determined by distribution keyword argument.
stddevs (ndarray, optional) – Standard deviation for each location, meaning is determined by distribution keyword argument, default is None indicating no uncertainty is defined.
- __init__(coordinates, means, stddevs=None)¶
Create a container for Hvsr statistics.
- Parameters
coordinates (ndarray) – Relative x and y coordinates of the sensors, where each row of the ndarray in an x, y pair.
means (ndarray) – Mean f0 value for each location, meaning is determined by distribution keyword argument.
stddevs (ndarray, optional) – Standard deviation for each location, meaning is determined by distribution keyword argument, default is None indicating no uncertainty is defined.
distribution ({‘normal’, ‘lognormal’}, optional) – Distribution to which the mean and stddev for each point corresponds, default is ‘lognormal’.
- 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 master statistics.
- spatial_weights(boundary, dc_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).
dc_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_f0(mean, stddev, weights, dist_generators='lognormal', dist_spatial='lognormal', nrealizations=1000, generator='PCG64')¶
MonteCarlo simulation for spatial distribution of f0.
- Parameters
mean, stddev (ndarray) – Mean and standard deviation of each generating point. Meaning of these parameters is dictated by dist_generators.
weights (ndarray) – Weights for each generating point.
dist_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\)
dist_spatial ({‘lognormal’, ‘normal’}, optional) – Assumed distribution of spatial statistics on f0, default is lognormal.
generator ({‘PCG64’, ‘MT19937’}, optional) – Bit generator, default is PCG64.
- Returns
tuple – Of the form (f0_mean, f0_stddev, f0_realizations).