Analyzing Meshes

Very often there will be specific regions of a set of results that are the most of interest, and in those cases it can be helpful to pull out a particular region's data for visualization in a clearer way. The LineCrossSection and SurfaceCrossSection classes allow taking cross-sections of a mesh (or some other rasterizable object) along poly-lines drawn using the PolyDraw tool, letting you make an x/z or x/z/t plot from data laid out in x/y/z or x/y/z/t (respectively). These classes rasterize the data at a fixed resolution, and then sample the data at that resolution given the underlying polylines. The resolution may be defined in the units of the underlying coordinate system.

In [1]:
import holoviews as hv
import geoviews as gv
import cartopy.crs as ccrs
from colorcet import cm_n

from holoviews import opts

from earthsim.analysis import LineCrossSection, SurfaceCrossSection
from earthsim.io import read_3dm_mesh, read_mesh2d

hv.extension('bokeh')

opts.defaults(
    opts.Curve(height=400, width=400, framewise=True),
    opts.Image(width=500, height=400, colorbar=True, framewise=True),
    opts.NdOverlay(legend_limit=0),
    opts.Path(line_width=3, color='black'),
    opts.RGB(width=500, height=400),
    opts.VLine(color='black')
)
hv.output(holomap='scrubber')