WW3 三角メッシュ

On this page

WW3 三角メッシュ#

この例では、非構造化三角形メッシュをレンダリングする方法を示します。

📋 まとめ#

Creates a mesh from 1D latitude and longitude unstructured points and connectivity.

連結性は、構造化されていない点にインデックスを付けてセルを構成するために必要です。

WAVEWATCH III (WW3) の海面波の有義波高データは、メッシュの節点/点に配置され、メッシュ面/セルに渡って補間されます。

最後に、Natural Earthの海岸線とともに、Natural Earthのベースレイヤーがレンダリングされます。

🏷 Tags: component: coastlines component: texture domain: oceanography load: unstructured version: 0.1.0


tri
from __future__ import annotations

import geovista as gv
from geovista.pantry.data import ww3_global_tri


def main() -> None:
    """Plot a 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.
    p = gv.GeoPlotter()
    p.add_mesh(mesh)
    p.add_base_layer(texture=gv.natural_earth_hypsometric())
    p.add_coastlines()
    p.add_text(
        "WW3 Triangular Mesh (10m Coastlines)",
        position="upper_left",
        font_size=10,
    )

    # Define a specific camera position.
    p.view_xy(negative=True)
    p.camera.zoom(1.3)

    p.add_axes()
    p.show()


if __name__ == "__main__":
    main()

Sphinx-Galleryによって生成されたギャラリー