easyclimate.plot.mpas

Convenience imports for the mpas_plot package.

Submodules

Functions

plot_cell_voronoi(ds, da, *[, ax, transform, lon_min, ...])

Plot MPAS cell-centered scalar field on native polygon cells.

plot_voronoi_grid(data[, verticesOnEdge, lonVertex, ...])

Plot MPAS Voronoi mesh edges.

extract_cell_latlon(ds, *[, da, lon_min, lon_max, ...])

Extract and wrap MPAS cell and vertex lon/lat.

plot_cell_contour(ds, da, *[, ax, lon_min, lon_max, ...])

Draw contour lines for MPAS cell-centered scalar field.

plot_cell_contourf(ds, da, *[, ax, lon_min, lon_max, ...])

Draw filled contour for MPAS cell-centered scalar field.

plot_vertex_voronoi(ds, da, *[, ax, transform, ...])

Plot MPAS vertex-centered scalar data on dual polygons.

plot_vertex_contour(ds, da, *[, ax, lon_min, lon_max, ...])

Draw contour lines for MPAS vertex-centered scalar field.

plot_vertex_contourf(ds, da, *[, ax, lon_min, ...])

Draw filled contour for MPAS vertex-centered scalar field.

plot_cell_quiver(ds, u_da, v_da, *[, ax, lon_min, ...])

Plot cell-centered vector wind on MPAS mesh.

plot_cell_curved_quiver(...)

Plot MPAS cell-centered vector wind as curved quiver trajectories.

plot_cell_barbs(ds, u_da, v_da, *[, ax, lon_min, ...])

Plot cell-centered vector wind as wind barbs on an MPAS mesh.

plot_cell_streamplot(ds, u_da, v_da, *[, ax, lon_min, ...])

Plot cell-centered vector wind as streamlines on an MPAS mesh.

Package Contents

easyclimate.plot.mpas.plot_cell_voronoi(ds, da, *, ax=None, transform=None, lon_min=None, lon_max=None, lat_min=None, lat_max=None, auto_extent=True, extent_margin=0.05, cell_margin=0.05, global_plot=False, input_radians=True, center_lon=None, skip_large_lon_jump=True, max_polygon_lon_span=180.0, cmap=None, vmin=None, vmax=None, symmetric=False, percentile=98, edgecolor='none', linewidth=0.0, add_colorbar=True, cbar_kwargs=None, title=None, xlabel='Longitude', ylabel='Latitude', aspect='auto', lon_name_cell='lonCell', lat_name_cell='latCell', lon_name_vertex='lonVertex', lat_name_vertex='latVertex', vertices_on_cell_name='verticesOnCell', n_edges_on_cell_name='nEdgesOnCell', use_geometry_cache=True)

Plot MPAS cell-centered scalar field on native polygon cells.

The scalar field is rendered on each native MPAS cell polygon. The function works with both plain Matplotlib axes and Cartopy GeoAxes.

Parameters

dsxarray.Dataset

Dataset containing MPAS mesh geometry.

daxarray.DataArray or numpy.ndarray

Cell-centered scalar field. Must be 1D on nCells after selection.

axmatplotlib.axes.Axes, optional

Axes on which to draw. By default, use the current axes.

projectioncartopy.crs.CRS, optional

Reserved for compatibility with older call sites.

transformcartopy.crs.CRS, optional

Coordinate reference system of the input coordinates for Cartopy axes.

lon_min, lon_max, lat_min, lat_maxfloat, optional

Plot extent. Cross-dateline windows are supported, for example: lon_min=-190, lon_max=-60 describes the continuous longitude window from 170E to 60W.

auto_extentbool, default: True

If True and no explicit extent is supplied, infer the extent from valid cell centers.

extent_marginfloat, default: 0.05

Fractional margin added to the automatically inferred extent.

cell_marginfloat, default: 0.05

Extra fraction of the plot extent used to select cells outside the visible window. This helps avoid missing partial cells along boundaries.

global_plotbool, default: False

If True, draw a global extent centered on center_lon.

input_radiansbool, default: True

If True, MPAS longitude and latitude variables are interpreted as radians and converted to degrees.

center_lonfloat, optional

Longitude wrapping center. If None, inferred from lon_min/lon_max or valid cell centers.

skip_large_lon_jumpbool, default: True

If True, skip polygons with very large wrapped longitude spans.

max_polygon_lon_spanfloat, default: 180.0

Maximum accepted wrapped polygon longitude span in degrees.

cmapstr or matplotlib.colors.Colormap, optional

Colormap used for cell values.

vmin, vmaxfloat, optional

Color limits. If omitted, infer them from selected values.

symmetricbool, default: False

If True, infer symmetric color limits around zero.

percentilefloat, default: 98

Percentile used for automatic color-limit inference.

edgecolor, linewidth

Polygon edge style passed to matplotlib.collections.PolyCollection.

add_colorbarbool, default: True

If True, add a colorbar for the polygon collection.

cbar_kwargsdict, optional

Keyword arguments passed to Figure.colorbar.

titlestr, optional

Axes title. If None, use the data long name.

figsize(float, float), default: (8, 6)

Reserved for compatibility with older call sites.

xlabel, ylabelstr

Axis labels used for plain Matplotlib axes.

aspectstr or float, default: “auto”

Aspect setting used for plain Matplotlib axes.

lon_name_cell, lat_name_cell, lon_name_vertex, lat_name_vertexstr

MPAS coordinate variable names.

vertices_on_cell_name, n_edges_on_cell_namestr

MPAS connectivity variable names.

use_geometry_cachebool, default: True

If True, cache native cell polygon geometry for repeated calls.

Returns

axmatplotlib.axes.Axes

Axes containing the plot.

pcmatplotlib.collections.PolyCollection

Polygon collection added to the axes.

MPAS Cell-centered Voronoi plots

MPAS Cell-centered Voronoi plots
easyclimate.plot.mpas.plot_voronoi_grid(data, verticesOnEdge='verticesOnEdge', lonVertex='lonVertex', latVertex='latVertex', lon_min=None, lon_max=None, lat_min=None, lat_max=None, ax=None, **linekwags)

Plot MPAS Voronoi mesh edges.

Parameters

dataxarray.Dataset

MPAS dataset containing verticesOnEdge, lonVertex, and latVertex. Used as the fallback source when these variables are not provided explicitly.

verticesOnEdgestr, optional

Name of the edge-to-vertex connectivity variable using MPAS 1-based vertex indices.

lonVertex, latVertexstr, optional

Names of the vertex longitude and latitude variables in radians.

lon_min, lon_max, lat_min, lat_maxfloat, optional

Optional subset window in degrees. Cross-dateline longitude windows are supported.

axmatplotlib.axes.Axes, optional

Axes on which to draw. By default, use the current axes.

**linekwags

Additional keyword arguments passed to matplotlib.collections.LineCollection.

Returns

matplotlib.collections.LineCollection

Line collection containing selected Voronoi mesh edges.

MPAS/Voronoi grid

MPAS/Voronoi grid
easyclimate.plot.mpas.extract_cell_latlon(ds, *, da=None, lon_min=None, lon_max=None, lat_min=None, lat_max=None, auto_extent=True, extent_margin=0.05, global_plot=False, center_lon=None, input_radians=True, lon_name_cell='lonCell', lat_name_cell='latCell', lon_name_vertex='lonVertex', lat_name_vertex='latVertex')

Extract and wrap MPAS cell and vertex lon/lat.

Parameters

dsxarray.Dataset

MPAS dataset containing cell and vertex coordinate variables.

daxarray.DataArray or numpy.ndarray, optional

Cell-centered data. If provided, finite values are used for extent inference and center_lon inference.

lon_min, lon_max, lat_min, lat_maxfloat, optional

User-defined plotting window. Supports cross-dateline windows, e.g. lon_min=90, lon_max=-60 means 90E to 300E.

auto_extentbool, default: True

If True and no explicit extent is supplied, infer the extent from valid cell centers.

extent_marginfloat, default: 0.05

Fractional margin added to the automatically inferred extent.

global_plotbool, default: False

If True, return a global extent centered on center_lon.

center_lonfloat, optional

Longitude wrapping center. If None, inferred automatically.

input_radiansbool, default: True

If True, MPAS longitude and latitude variables are interpreted as radians and converted to degrees.

lon_name_cell, lat_name_cell, lon_name_vertex, lat_name_vertexstr

MPAS coordinate variable names.

Returns

dict

Dictionary with wrapped cell and vertex coordinates, the inferred longitude center, and plotting extent values.

easyclimate.plot.mpas.plot_cell_contour(ds, da, *, ax=None, lon_min=None, lon_max=None, lat_min=None, lat_max=None, auto_extent=True, extent_margin=0.05, contour_margin=0.05, global_plot=False, center_lon=None, levels=10, colors=None, linewidths=0.8, linestyles=None, cmap=None, vmin=None, vmax=None, symmetric=False, percentile=98, extend=None, max_triangle_edge=None, input_radians=True, transform=None, title=None, lon_name_cell='lonCell', lat_name_cell='latCell', lon_name_vertex='lonVertex', lat_name_vertex='latVertex', use_triangulation_cache=True)

Draw contour lines for MPAS cell-centered scalar field.

Labels are not added automatically. Add them outside this function with ax.clabel(cs, inline=True, fontsize=8, fmt="%g").

Parameters

dsxarray.Dataset

MPAS dataset containing cell and vertex coordinate variables.

daxarray.DataArray or numpy.ndarray

Cell-centered scalar values. The data must be one-dimensional on nCells after any time or vertical-level selection.

axmatplotlib.axes.Axes, optional

Axes on which to draw. By default, use the current axes.

lon_min, lon_max, lat_min, lat_maxfloat, optional

Plot extent in degrees. Cross-dateline longitude windows are supported.

auto_extentbool, default: True

If True and no explicit extent is supplied, infer the extent from valid cell centers.

extent_marginfloat, default: 0.05

Fractional margin added to the automatically inferred extent.

contour_marginfloat, default: 0.05

Fractional padding used when selecting source cells for contouring.

global_plotbool, default: False

If True, draw a global extent centered on center_lon.

center_lonfloat, optional

Longitude center used for wrapping. If None, infer it from the extent or valid cell centers.

levelsint or array-like, default: 10

Number of contour levels, or explicit level values.

colorscolor or collections.abc.Sequence of colors, optional

Fixed line colors passed to Axes.tricontour. If omitted, use cmap.

linewidths, linestyles

Contour line style options passed to Axes.tricontour.

cmapstr or matplotlib.colors.Colormap, optional

Colormap used when colors is not supplied.

vmin, vmaxfloat, optional

Data limits used by contour levels and color mapping.

symmetricbool, default: False

If True, infer symmetric limits around zero when vmin or vmax is omitted.

percentilefloat, default: 98

Percentile used for automatic data-limit inference.

extend{“neither”, “both”, “min”, “max”}, optional

Contour extension mode. If None, infer it from data and levels.

max_triangle_edgefloat, optional

Maximum accepted edge length for triangles. Longer triangles are masked.

input_radiansbool, default: True

If True, MPAS longitude and latitude variables are interpreted as radians and converted to degrees.

transformcartopy.crs.CRS, optional

Coordinate reference system of the input coordinates for Cartopy axes.

titlestr, optional

Axes title. If None, use the data long name.

lon_name_cell, lat_name_cell, lon_name_vertex, lat_name_vertexstr

MPAS coordinate variable names.

use_triangulation_cachebool, default: True

If True, cache the triangulation for repeated calls on the same mesh and extent.

Returns

matplotlib.contour.QuadContourSet

Contour set returned by Axes.tricontour.

MPAS Cell-centered contour plots

MPAS Cell-centered contour plots
easyclimate.plot.mpas.plot_cell_contourf(ds, da, *, ax=None, lon_min=None, lon_max=None, lat_min=None, lat_max=None, auto_extent=True, extent_margin=0.05, contour_margin=0.05, global_plot=False, center_lon=None, levels=10, cmap=None, vmin=None, vmax=None, symmetric=False, percentile=98, extend=None, max_triangle_edge=None, input_radians=True, transform=None, add_colorbar=True, cbar_kwargs=None, title=None, lon_name_cell='lonCell', lat_name_cell='latCell', lon_name_vertex='lonVertex', lat_name_vertex='latVertex', use_triangulation_cache=True)

Draw filled contour for MPAS cell-centered scalar field.

The scalar values are drawn from MPAS cell centers using matplotlib.tri.Triangulation.

Parameters

dsxarray.Dataset

MPAS dataset containing cell and vertex coordinate variables.

daxarray.DataArray or numpy.ndarray

Cell-centered scalar values. The data must be one-dimensional on nCells after any time or vertical-level selection.

axmatplotlib.axes.Axes, optional

Axes on which to draw. By default, use the current axes.

lon_min, lon_max, lat_min, lat_maxfloat, optional

Plot extent in degrees. Cross-dateline longitude windows are supported.

auto_extentbool, default: True

If True and no explicit extent is supplied, infer the extent from valid cell centers.

extent_marginfloat, default: 0.05

Fractional margin added to the automatically inferred extent.

contour_marginfloat, default: 0.05

Fractional padding used when selecting source cells for contouring.

global_plotbool, default: False

If True, draw a global extent centered on center_lon.

center_lonfloat, optional

Longitude center used for wrapping. If None, infer it from the extent or valid cell centers.

levelsint or array-like, default: 10

Number of contour levels, or explicit level values.

cmapstr or matplotlib.colors.Colormap, optional

Colormap used for filled contours.

vmin, vmaxfloat, optional

Color/data limits used by contour levels and color mapping. If one side is omitted, infer it from selected finite values.

symmetricbool, default: False

If True, infer symmetric limits around zero when vmin or vmax is omitted.

percentilefloat, default: 98

Percentile used for automatic color-limit inference.

extend{“neither”, “both”, “min”, “max”}, optional

Colorbar extension mode. If None, infer it from data and levels.

max_triangle_edgefloat, optional

Maximum accepted edge length for triangles. Longer triangles are masked.

input_radiansbool, default: True

If True, MPAS longitude and latitude variables are interpreted as radians and converted to degrees.

transformcartopy.crs.CRS, optional

Coordinate reference system of the input coordinates for Cartopy axes.

add_colorbarbool, default: True

If True, add a colorbar for the filled contour set.

cbar_kwargsdict, optional

Keyword arguments passed to Figure.colorbar.

titlestr, optional

Axes title. If None, use the data long name.

lon_name_cell, lat_name_cell, lon_name_vertex, lat_name_vertexstr

MPAS coordinate variable names.

use_triangulation_cachebool, default: True

If True, cache the triangulation for repeated calls on the same mesh and extent.

Returns

matplotlib.contour.QuadContourSet

Filled contour set returned by Axes.tricontourf.

MPAS Cell-centered contour plots

MPAS Cell-centered contour plots
easyclimate.plot.mpas.plot_vertex_voronoi(ds, da, *, ax=None, transform=None, lon_min=None, lon_max=None, lat_min=None, lat_max=None, auto_extent=True, extent_margin=0.05, vertex_margin=0.05, global_plot=False, center_lon=None, input_radians=True, skip_large_lon_jump=True, max_polygon_lon_span=180.0, cmap=None, vmin=None, vmax=None, symmetric=None, percentile=98, edgecolor='none', linewidth=0.0, add_colorbar=True, cbar_kwargs=None, title=None, xlabel='Longitude', ylabel='Latitude', aspect='auto', cells_on_vertex_name='cellsOnVertex', lon_name_cell='lonCell', lat_name_cell='latCell', lon_name_vertex='lonVertex', lat_name_vertex='latVertex', use_geometry_cache=True)

Plot MPAS vertex-centered scalar data on dual polygons.

Each vertex value is drawn on the dual polygon formed by the surrounding cell centers. If da is cell-centered with length nCells, values are first averaged to vertices using cellsOnVertex.

Parameters

dsxarray.Dataset

MPAS dataset containing vertex, cell, and connectivity variables.

daxarray.DataArray or numpy.ndarray

Vertex-centered values on nVertices or cell-centered values on nCells. Cell-centered values are averaged to vertices before plotting.

axmatplotlib.axes.Axes, optional

Axes on which to draw. By default, use the current axes.

transformcartopy.crs.CRS, optional

Coordinate reference system of the input coordinates for Cartopy axes.

lon_min, lon_max, lat_min, lat_maxfloat, optional

Plot extent in degrees. Cross-dateline longitude windows are supported.

auto_extentbool, default: True

If True and no explicit extent is supplied, infer the extent from valid vertices.

extent_marginfloat, default: 0.05

Fractional margin added to the automatically inferred extent.

vertex_marginfloat, default: 0.05

Fractional padding used when selecting dual polygons near the visible extent.

global_plotbool, default: False

If True, draw a global extent centered on center_lon.

center_lonfloat, optional

Longitude center used for wrapping. If None, infer it from the extent or valid vertices.

input_radiansbool, default: True

If True, MPAS longitude and latitude variables are interpreted as radians and converted to degrees.

skip_large_lon_jumpbool, default: True

If True, skip polygons with very large wrapped longitude spans.

max_polygon_lon_spanfloat, default: 180.0

Maximum accepted wrapped polygon longitude span in degrees.

cmapstr or matplotlib.colors.Colormap, optional

Colormap used for polygon values.

vmin, vmaxfloat, optional

Color limits. If omitted, infer them from selected values.

symmetricbool, optional

If True, infer symmetric color limits around zero. If None, default to True for vertex-dual plots.

percentilefloat, default: 98

Percentile used for automatic color-limit inference.

edgecolor, linewidth

Polygon edge style passed to matplotlib.collections.PolyCollection.

add_colorbarbool, default: True

If True, add a colorbar for the polygon collection.

cbar_kwargsdict, optional

Keyword arguments passed to Figure.colorbar.

titlestr, optional

Axes title. If None, use the data long name.

xlabel, ylabelstr

Axis labels used for plain Matplotlib axes.

aspectstr or float, default: “auto”

Aspect setting used for plain Matplotlib axes.

cells_on_vertex_namestr

MPAS variable giving neighboring cells for each vertex.

lon_name_cell, lat_name_cell, lon_name_vertex, lat_name_vertexstr

MPAS coordinate variable names.

use_geometry_cachebool, default: True

If True, cache vertex-dual polygon geometry for repeated calls.

Returns

matplotlib.collections.PolyCollection

Polygon collection added to the axes.

MPAS Vertex-centered Voronoi plots

MPAS Vertex-centered Voronoi plots
easyclimate.plot.mpas.plot_vertex_contour(ds, da, *, ax=None, lon_min=None, lon_max=None, lat_min=None, lat_max=None, auto_extent=True, extent_margin=0.05, contour_margin=0.05, global_plot=False, center_lon=None, levels=10, colors=None, linewidths=0.8, linestyles=None, cmap=None, vmin=None, vmax=None, symmetric=False, percentile=98, extend=None, max_triangle_edge=None, use_triangulation_cache=True, input_radians=True, transform=None, title=None, xlabel='Longitude', ylabel='Latitude', aspect='auto', lon_name_vertex='lonVertex', lat_name_vertex='latVertex')

Draw contour lines for MPAS vertex-centered scalar field.

Parameters

dsxarray.Dataset

MPAS dataset containing vertex coordinate variables.

daxarray.DataArray or numpy.ndarray

Vertex-centered scalar values. The data must be one-dimensional on nVertices after any time or vertical-level selection.

axmatplotlib.axes.Axes, optional

Axes on which to draw. By default, use the current axes.

lon_min, lon_max, lat_min, lat_maxfloat, optional

Plot extent in degrees. Cross-dateline longitude windows are supported.

auto_extentbool, default: True

If True and no explicit extent is supplied, infer the extent from valid vertices.

extent_marginfloat, default: 0.05

Fractional margin added to the automatically inferred extent.

contour_marginfloat, default: 0.05

Fractional padding used when selecting source vertices for contouring.

global_plotbool, default: False

If True, draw a global extent centered on center_lon.

center_lonfloat, optional

Longitude center used for wrapping. If None, infer it from the extent or valid vertices.

levelsint or array-like, default: 10

Number of contour levels, or explicit level values.

colorscolor or collections.abc.Sequence of colors, optional

Fixed line colors passed to Axes.tricontour. If omitted, use cmap.

linewidths, linestyles

Contour line style options passed to Axes.tricontour.

cmapstr or matplotlib.colors.Colormap, optional

Colormap used when colors is not supplied.

vmin, vmaxfloat, optional

Data limits used by contour levels and color mapping.

symmetricbool, default: False

If True, infer symmetric limits around zero when vmin or vmax is omitted.

percentilefloat, default: 98

Percentile used for automatic data-limit inference.

extend{“neither”, “both”, “min”, “max”}, optional

Contour extension mode. If None, infer it from data and levels.

max_triangle_edgefloat, optional

Maximum accepted edge length for triangles. Longer triangles are masked.

use_triangulation_cachebool, default: True

If True, cache the triangulation for repeated calls on the same mesh and extent.

input_radiansbool, default: True

If True, MPAS longitude and latitude variables are interpreted as radians and converted to degrees.

transformcartopy.crs.CRS, optional

Coordinate reference system of the input coordinates for Cartopy axes.

titlestr, optional

Axes title. If None, use the data long name.

xlabel, ylabelstr

Axis labels used for plain Matplotlib axes.

aspectstr or float, default: “auto”

Aspect setting used for plain Matplotlib axes.

lon_name_vertex, lat_name_vertexstr

MPAS vertex coordinate variable names.

Returns

matplotlib.contour.QuadContourSet

Contour set returned by Axes.tricontour.

MPAS Vertex-centered contour plots

MPAS Vertex-centered contour plots
easyclimate.plot.mpas.plot_vertex_contourf(ds, da, *, ax=None, lon_min=None, lon_max=None, lat_min=None, lat_max=None, auto_extent=True, extent_margin=0.05, contour_margin=0.05, global_plot=False, center_lon=None, levels=10, cmap=None, vmin=None, vmax=None, symmetric=False, percentile=98, extend=None, max_triangle_edge=None, use_triangulation_cache=True, input_radians=True, transform=None, add_colorbar=True, cbar_kwargs=None, title=None, xlabel='Longitude', ylabel='Latitude', aspect='auto', lon_name_vertex='lonVertex', lat_name_vertex='latVertex')

Draw filled contour for MPAS vertex-centered scalar field.

Parameters

dsxarray.Dataset

MPAS dataset containing vertex coordinate variables.

daxarray.DataArray or numpy.ndarray

Vertex-centered scalar values. The data must be one-dimensional on nVertices after any time or vertical-level selection.

axmatplotlib.axes.Axes, optional

Axes on which to draw. By default, use the current axes.

lon_min, lon_max, lat_min, lat_maxfloat, optional

Plot extent in degrees. Cross-dateline longitude windows are supported.

auto_extentbool, default: True

If True and no explicit extent is supplied, infer the extent from valid vertices.

extent_marginfloat, default: 0.05

Fractional margin added to the automatically inferred extent.

contour_marginfloat, default: 0.05

Fractional padding used when selecting source vertices for contouring.

global_plotbool, default: False

If True, draw a global extent centered on center_lon.

center_lonfloat, optional

Longitude center used for wrapping. If None, infer it from the extent or valid vertices.

levelsint or array-like, default: 10

Number of contour levels, or explicit level values.

cmapstr or matplotlib.colors.Colormap, optional

Colormap used for filled contours.

vmin, vmaxfloat, optional

Data limits used by contour levels and color mapping.

symmetricbool, default: False

If True, infer symmetric limits around zero when vmin or vmax is omitted.

percentilefloat, default: 98

Percentile used for automatic data-limit inference.

extend{“neither”, “both”, “min”, “max”}, optional

Colorbar extension mode. If None, infer it from data and levels.

max_triangle_edgefloat, optional

Maximum accepted edge length for triangles. Longer triangles are masked.

use_triangulation_cachebool, default: True

If True, cache the triangulation for repeated calls on the same mesh and extent.

input_radiansbool, default: True

If True, MPAS longitude and latitude variables are interpreted as radians and converted to degrees.

transformcartopy.crs.CRS, optional

Coordinate reference system of the input coordinates for Cartopy axes.

add_colorbarbool, default: True

If True, add a colorbar for the filled contour set.

cbar_kwargsdict, optional

Keyword arguments passed to Figure.colorbar.

titlestr, optional

Axes title. If None, use the data long name.

xlabel, ylabelstr

Axis labels used for plain Matplotlib axes.

aspectstr or float, default: “auto”

Aspect setting used for plain Matplotlib axes.

lon_name_vertex, lat_name_vertexstr

MPAS vertex coordinate variable names.

Returns

matplotlib.contour.QuadContourSet

Filled contour set returned by Axes.tricontourf.

MPAS Vertex-centered contour plots

MPAS Vertex-centered contour plots
easyclimate.plot.mpas.plot_cell_quiver(ds, u_da, v_da, *, ax=None, lon_min=None, lon_max=None, lat_min=None, lat_max=None, center_lon=None, input_radians=True, lon_name_cell='lonCell', lat_name_cell='latCell', nx_bins=35, ny_bins=20, thin_method='nearest_center', use_thinning_cache=True, add_quiverkey=True, quiverkey_value=None, quiverkey_label=None, quiverkey_x=0.88, quiverkey_y=1.04, transform=None, regrid_shape=None, regrid_global_epsilon=1e-06, title=None, **quiver_kwargs)

Plot cell-centered vector wind on MPAS mesh.

Parameters

dsxarray.Dataset

MPAS dataset containing cell coordinate variables.

u_da, v_daxarray.DataArray or numpy.ndarray

Cell-centered zonal/eastward and meridional/northward vector components. Each input must be one-dimensional on nCells after selection.

axmatplotlib.axes.Axes, optional

Axes on which to draw. By default, use the current axes.

lon_min, lon_max, lat_min, lat_maxfloat

Plot extent in degrees. These bounds are required so vector thinning is robust on variable-resolution meshes.

center_lonfloat, optional

Longitude center used for wrapping. If None, infer it from the extent or valid cell centers.

input_radiansbool, default: True

If True, MPAS longitude and latitude variables are interpreted as radians and converted to degrees.

lon_name_cell, lat_name_cellstr

MPAS cell coordinate variable names.

nx_bins, ny_binsint, default: 35, 20

Number of longitude and latitude bins used to thin vectors.

thin_method{“nearest_center”, “max_speed”, “mean”}, default: “nearest_center”

Rule used to choose or aggregate one vector per bin.

use_thinning_cachebool, default: True

If True, cache coordinate-only bin metadata for repeated calls.

add_quiverkeybool, default: True

If True, add a reference quiver key.

quiverkey_valuefloat, optional

Reference vector magnitude for the quiver key. If None, use the 75th percentile of thinned vector speeds.

quiverkey_labelstr, optional

Label for the quiver key. If None, build a metres-per-second label from quiverkey_value.

quiverkey_x, quiverkey_yfloat, default: 0.88, 1.04

Quiver-key position in axes coordinates.

transformcartopy.crs.CRS, optional

Coordinate reference system of the input coordinates for Cartopy axes.

regrid_shapeint or (int, int) or None, optional

Regrid vectors onto a regular grid in the target map projection before plotting. This is only supported for Cartopy GeoAxes.

regrid_global_epsilonfloat, default: 1.0e-6

Small longitude shrink applied to full-width global regridding windows.

titlestr, optional

Axes title. If None, use a default wind title.

**quiver_kwargs

Additional keyword arguments passed to Axes.quiver.

Returns

matplotlib.quiver.Quiver

Quiver object returned by Axes.quiver.

MPAS Cell-centered quiver plots

MPAS Cell-centered quiver plots
easyclimate.plot.mpas.plot_cell_curved_quiver(ds, u_da, v_da, *, ax=None, lon_min=None, lon_max=None, lat_min=None, lat_max=None, center_lon=None, input_radians=True, lon_name_cell='lonCell', lat_name_cell='latCell', nx=160, ny=100, interpolation_padding=None, interpolation_padding_cells=2.0, min_valid_fraction=0.02, use_triangulation_cache=True, use_interp_weight_cache=True, transform=None, project_to_map=True, regrid_shape=None, regrid_global_epsilon=1e-06, density=1, linewidth=None, color=None, cmap=None, norm=None, arrowsize=1, arrowstyle='-|>', zorder=None, start_points=None, integration_direction='both', grains=15, broken_streamlines=True, ref_magnitude: float | None = None, ref_length: float | None = None, min_frac_length: float = 0.0, length_norm: Literal['reference', 'max', 'percentile'] = 'reference', mask_density: int | tuple[int, int] = 10, line_start_stride: int = 1, arrow_stride: int = 1, min_distance: float = 0.0, arrow_head_ratio: float = 1.0, arrow_position: float = 1.0, title=None) easyclimate.plot.modplot.CurvedQuiverplotSet

Plot MPAS cell-centered vector wind as curved quiver trajectories.

The MPAS cell-centered irregular vectors are first interpolated onto a regular grid, then drawn with the same curved-quiver engine used by easyclimate.plot.curved_quiver_plot.curved_quiver().

Parameters

dsxarray.Dataset

MPAS dataset containing cell coordinate variables.

u_da, v_daxarray.DataArray or numpy.ndarray

Cell-centered zonal/eastward and meridional/northward vectors, 1D on nCells after selection.

axmatplotlib.axes.Axes, optional

Axes on which to draw. By default, use the current axes.

lon_min, lon_max, lat_min, lat_maxfloat

Plot extent in degrees. These bounds are required to define the regular interpolation grid.

center_lonfloat, optional

Longitude center used for wrapping. If None, infer it from the extent or valid cell centers.

input_radiansbool, default: True

If True, MPAS longitude and latitude variables are interpreted as radians and converted to degrees.

lon_name_cell, lat_name_cellstr

MPAS cell coordinate variable names.

nx, nyint, default: 160, 100

Number of longitude and latitude points in the regular interpolation grid.

interpolation_paddingfloat or (float, float) or None, optional

Extra longitude/latitude degrees used only when selecting source cells for triangular interpolation. If None, padding is inferred from interpolation_padding_cells and the regular grid spacing.

interpolation_padding_cellsfloat, default: 2.0

Number of regular-grid cells used as automatic interpolation padding.

min_valid_fractionfloat, default: 0.02

Minimum fraction of valid interpolated grid points required before plotting.

use_triangulation_cache, use_interp_weight_cachebool, default: True

If True, cache triangulation and interpolation weights for repeated calls on the same mesh and grid.

transformcartopy.crs.CRS, optional

Coordinate reference system of the input coordinates for Cartopy axes.

project_to_mapbool, default: True

For Cartopy GeoAxes, transform the regular lon-lat grid and vector components to the target projection before drawing when the transformed grid remains rectilinear.

regrid_shapeint or (int, int) or None, optional

Regrid vectors directly onto a regular grid in target projection coordinates. This is only supported for Cartopy GeoAxes and takes precedence over project_to_map.

regrid_global_epsilonfloat, default: 1.0e-6

Small longitude shrink applied to full-width global regridding windows.

density, linewidth, color, cmap, norm, arrowsize, arrowstyle

Curved-quiver style options passed to velovect.

zorder, start_points, integration_direction, grains, broken_streamlines

Curved-quiver trajectory options passed to velovect.

ref_magnitude, ref_length, min_frac_length, length_norm

Options controlling how vector magnitude maps to curved-vector length.

mask_density, line_start_stride, arrow_stride, min_distance

Options controlling seed-point density and collision masking.

arrow_head_ratio, arrow_position

Arrow-head size and placement controls.

titlestr, optional

Axes title. If None, use a default curved-quiver title.

Returns

easyclimate.plot.modplot.CurvedQuiverplotSet

Container with line and arrow artists returned by velovect.

MPAS Cell-centered curved quiver plots

MPAS Cell-centered curved quiver plots
easyclimate.plot.mpas.plot_cell_barbs(ds, u_da, v_da, *, ax=None, lon_min=None, lon_max=None, lat_min=None, lat_max=None, center_lon=None, input_radians=True, lon_name_cell='lonCell', lat_name_cell='latCell', nx_bins=35, ny_bins=20, thin_method='nearest_center', use_thinning_cache=True, transform=None, regrid_shape=None, regrid_global_epsilon=1e-06, title=None, **barbs_kwargs)

Plot cell-centered vector wind as wind barbs on an MPAS mesh.

Parameters

dsxarray.Dataset

MPAS dataset containing cell coordinate variables.

u_da, v_daxarray.DataArray or numpy.ndarray

Cell-centered zonal/eastward and meridional/northward vectors, 1D on nCells after selection.

axmatplotlib.axes.Axes, optional

Axes on which to draw. By default, use the current axes.

lon_min, lon_max, lat_min, lat_maxfloat

Plot extent in degrees. These bounds are required so vector thinning is robust on variable-resolution meshes.

center_lonfloat, optional

Longitude center used for wrapping. If None, infer it from the extent or valid cell centers.

input_radiansbool, default: True

If True, MPAS longitude and latitude variables are interpreted as radians and converted to degrees.

lon_name_cell, lat_name_cellstr

MPAS cell coordinate variable names.

nx_bins, ny_binsint, default: 35, 20

Number of longitude and latitude bins used to thin vectors.

thin_method{“nearest_center”, “max_speed”, “mean”}, default: “nearest_center”

Rule used to choose or aggregate one vector per bin.

use_thinning_cachebool, default: True

If True, cache coordinate-only bin metadata for repeated calls.

transformcartopy.crs.CRS, optional

Coordinate reference system of the input coordinates for Cartopy axes.

regrid_shapeint or (int, int) or None, optional

Regrid vectors onto a regular grid in the target map projection before plotting. This is only supported for Cartopy GeoAxes.

regrid_global_epsilonfloat, default: 1.0e-6

Small longitude shrink applied to full-width global regridding windows.

titlestr, optional

Axes title. If None, use a default wind-barb title.

**barbs_kwargs

Additional keyword arguments passed to Axes.barbs.

Returns

matplotlib.quiver.Barbs

Barb container returned by Axes.barbs.

MPAS Cell-centered wind barbs

MPAS Cell-centered wind barbs
easyclimate.plot.mpas.plot_cell_streamplot(ds, u_da, v_da, *, ax=None, lon_min=None, lon_max=None, lat_min=None, lat_max=None, center_lon=None, input_radians=True, lon_name_cell='lonCell', lat_name_cell='latCell', nx=160, ny=100, interpolation_padding=None, interpolation_padding_cells=2.0, min_valid_fraction=0.02, use_triangulation_cache=True, use_interp_weight_cache=True, transform=None, project_to_map=True, regrid_shape=None, regrid_global_epsilon=1e-06, title=None, **streamplot_kwargs)

Plot cell-centered vector wind as streamlines on an MPAS mesh.

The MPAS cell-centered irregular vectors are first interpolated onto a regular lon-lat grid using Matplotlib triangular linear interpolation, then passed to Axes.streamplot / Cartopy GeoAxes streamplot.

Parameters

dsxarray.Dataset

MPAS dataset containing cell coordinate variables.

u_da, v_daxarray.DataArray or numpy.ndarray

Cell-centered zonal/eastward and meridional/northward vectors, 1D on nCells after selection.

axmatplotlib.axes.Axes, optional

Axes on which to draw. By default, use the current axes.

lon_min, lon_max, lat_min, lat_maxfloat

Plot extent in degrees. These bounds are required to define the regular interpolation grid.

center_lonfloat, optional

Longitude center used for wrapping. If None, infer it from the extent or valid cell centers.

input_radiansbool, default: True

If True, MPAS longitude and latitude variables are interpreted as radians and converted to degrees.

lon_name_cell, lat_name_cellstr

MPAS cell coordinate variable names.

nx, nyint, default: 160, 100

Number of longitude and latitude points in the regular interpolation grid.

interpolation_paddingfloat or (float, float) or None, optional

Extra longitude/latitude degrees used only when selecting source cells for triangular interpolation. Padding keeps the requested output grid inside the interpolation hull, reducing blank margins near plot edges. If None, padding is inferred from interpolation_padding_cells and the regular grid spacing.

interpolation_padding_cellsfloat, optional

Number of regular-grid cells used as automatic interpolation padding.

project_to_mapbool, optional

For Cartopy GeoAxes, transform the regular lon-lat grid and vector components to the target map projection before calling streamplot. This avoids Cartopy’s internal streamplot regridding from clipping a shifted PlateCarree window near the map edge.

regrid_shapeint or (int, int) or None, optional

Regrid vectors onto a regular grid in the target map projection before plotting. This is only supported for Cartopy GeoAxes. If provided, this projection-grid path takes precedence over project_to_map.

use_triangulation_cachebool, optional

Cache the geometry-only triangulation for repeated calls with the same dataset, extent, padding, and interpolation grid. This avoids rebuilding Qhull triangulation and TriFinder state when plotting multiple levels or time slices on the same MPAS mesh.

use_interp_weight_cachebool, optional

Cache target-grid barycentric interpolation weights. This avoids repeated LinearTriInterpolator setup and plane-coefficient calculations for repeated calls with the same geometry and interpolation grid.

transformcartopy.crs.CRS, optional

Coordinate reference system of the input coordinates for Cartopy axes.

min_valid_fractionfloat, default: 0.02

Minimum fraction of valid interpolated grid points required before plotting.

titlestr, optional

Axes title. If None, use a default streamline title.

**streamplot_kwargs

Additional keyword arguments passed to Axes.streamplot.

Returns

matplotlib.streamplot.StreamplotSet

Streamplot set returned by Axes.streamplot.

MPAS Cell-centered streamplots

MPAS Cell-centered streamplots