easyclimate.plot.mpas.cell_barbs

Cell-centered barb plotting utilities for MPAS meshes.

Functions

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

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

Module Contents

easyclimate.plot.mpas.cell_barbs.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