注釈
サンプルコードを全てダウンロードするには 末尾に移動 。
WW3 Triangular Mesh (Projected)#
This example demonstrates how to render a projected unstructured triangular mesh.
📋 まとめ#
Creates a mesh from 1D latitude and longitude unstructured points and connectivity. o The resulting mesh contains triangular cells. The connectivity is required to construct the cells by indexing into the unstructured points.
WAVEWATCH III (WW3) の海面波の有義波高データは、メッシュの節点/点に配置され、メッシュ面/セルに渡って補間されます。
A Natural Earth base layer is rendered along with Natural Earth coastlines, and the mesh is also transformed to the Hammer & Eckert-Greifendorff azimuthal projection.

from __future__ import annotations
import geovista as gv
from geovista.pantry.data import ww3_global_tri
def main() -> None:
"""Plot a projected WW3 unstructured triangular mesh.
Notes
-----
.. versionadded:: 0.1.0
"""
# Load the sample data.
sample = ww3_global_tri()
# Create the mesh from the sample data.
mesh = gv.Transform.from_unstructured(
sample.lons,
sample.lats,
connectivity=sample.connectivity,
data=sample.data,
name=f"{sample.name} / {sample.units}",
)
# Plot the unstructured mesh.
crs = "+proj=hammer"
p = gv.GeoPlotter(crs=crs)
p.add_mesh(mesh)
p.add_base_layer(texture=gv.natural_earth_hypsometric())
p.add_coastlines()
p.add_text(
f"WW3 Triangular Mesh ({crs})",
position="upper_left",
font_size=10,
)
# Define a specific camera position.
p.view_xy()
p.camera.zoom(1.5)
p.add_axes()
p.show()
if __name__ == "__main__":
main()