gemgis.visualization.create_meshes_hypocenters
gemgis.visualization.create_meshes_hypocenters#
- gemgis.visualization.create_meshes_hypocenters(gdf: geopandas.geodataframe.GeoDataFrame, magnitude: str = 'Magnitude', magnitude_factor: int = 200, year: str = 'Year') pyvista.core.composite.MultiBlock #
Plotting earthquake hypocenters with PyVista
- Parameters
gdf (gpd.geodataframe.GeoDataFrame) – GeoDataFrame containing the earthquake hypocenter data
magnitude (str) – Name for the column containing the magnitude value, e.g.
magnitude='Magnitude'
, default is'Magnitude'
magnitude_factor (int) – Scaling factor for the magnitude values defining the size of the spheres, e.g.
magnitude_factor=200
, default is200
year (str) – Name for the column containing the year of each earthquake event, e.g.
year='Year'
, default to'Year'
- Returns
spheres – PyVista MultiBlock object containing the hypocenters stored as spheres
- Return type
pv.core.composite.MultiBlock
New in version 1.0.x.
Example
>>> # Loading Libraries and File >>> import gemgis as gg >>> import geopandas as gpd >>> gdf = gpd.read_file(filename='file.shp') >>> gdf Y X Z RASTERVALU Tiefe [km] Magnitude Epizentrum Year geometry 0 5645741.63 32322660.15 -8249.25 150.75 8.40 1.50 STETTERNICH 2002 POINT (32322660.151 5645741.630) 1 5645947.18 32323159.51 89.63 89.63 0.00 0.80 SOPHIENHOEHE 2014 POINT (32323159.505 5645947.183)
>>> # Creating Spheres for hypocenters >>> spheres = gg.visualization.create_meshes_hypocenters(gdf=gdf) >>> spheres Information MultiBlock Values N Blocks 497 X Bounds 32287780.000, 32328260.000 Y Bounds 5620074.000, 5648385.000 Z Bounds -24317.020, 309.130 Blocks Index Name Type 0 Block-00 PolyData 1 Block-01 PolyData 2 Block-02 PolyData