Visualizing MPAS Grid Topology

Visualizing MPAS Grid Topology#

Author: Philip Chmielowiec

This notebook showcases an interactive plot of the topology of an MPAS Atmopshere Grid. Both the Primal and Dual meshes are shown together, which together form a Voronoi Mesh.

import uxarray as ux
base_path = "../../../test/meshfiles/mpas/QU/"
grid_path = base_path + "mesh.QU.1920km.151026.nc"
primal_grid = ux.open_grid(grid_path, use_dual=False)
dual_grid = ux.open_grid(grid_path, use_dual=True)
(
    primal_grid.plot.edges(color="Blue", line_width=2)
    * primal_grid.plot.nodes(color="Blue", size=10)
    * dual_grid.plot.edges(color="Red", line_width=2)
    * dual_grid.plot.nodes(color="Red", size=10)
).opts(
    title="MPAS Primal & Dual Mesh",
    xlim=(-50, 50),
    ylim=(-25, 25),
    width=700,
    height=350,
)