Visualization Helpers¶
Suggested Colormaps¶
Waveguidability proxy (‖∇log(PV)‖₂
):
The colormap is adapted from a cubehelix scheme with 2.5
start, -2.0
rotations, 1.0
hue and 1.0
gamma.
16 levels were extracted, but only the lightest 10 are used.
Colors up to 1.2e-6
(1/m) have been desaturated to highlight the winter-season waveguide detection threshold used by Polster and Wirth (2023).
plt.contourf(
...,
levels=1.0e-6*np.asarray([0.6, 0.8, 1.0, 1.2, 1.4, 1.6, 1.8, 2.0, 3.0]),
colors=[
"#FFFFFF", "#EEEEEE", "#DDDDDD", "#CCCCCC", "#DFAF9A",
"#AEB272", "#74B471", "#4FA48F", "#5280AA", "#6D57A1"
],
extend="both"
)
Waveguide occurrence frequency:
The colormap is adapted from a cubehelix scheme with 2.0
start, -1.5
rotations, 1.4
hue and 1.0
gamma.
13 levels were extracted, but only the lightest 10 are used.
plt.contourf(
...,
levels=[10, 20, 30, 40, 50, 60, 70, 80, 90],
colors=[
"#FFFFFF", "#FFDFE3", "#EED0AA", "#B5D17F", "#70CF83",
"#48B7AB", "#5288CC", "#7854BD", "#8F307C", "#7B252F"
],
extend="both"
)
Xarray Interface¶
- rwguide.xarray.hovmoeller.mean_along_contour(xvalue, da_x, da_y, da_area=None, lat_kernel=None, lon_kernel=None, *, vectorize=True, names=None)¶
Kernel-weighted mean along a contour.
Note
This function can be used to create a refined Hovmöller diagram as described by Martius et al. (2006) along a contour of a rolling zonalized state, since almost all PV contours in a rolling zonalized state are circumglobal and occur exactly once. It should not be used to create refined Hovmöller diagrams of arbitrary input fields, where contours do not fulfil these properties. No checks on the followed contour are performed.
- Parameters:
xvalue (number) – Value of the contour to follow.
da_x (xarray.DataArray) – Field containing the contour to follow. Core dimensions: latitude, longitude.
da_y (xarray.DataArray) – Field of which the mean is taken. Core dimensions: latitude, longitude.
da_area (xarray.DataArray, optional) – Area weights for a weighted mean on the sphere. Core dimension: latitude. Weights are normalized during the computation. If None,
cos(ϕ)
-weights are used.lat_kernel (numpy.ndarray, optional) – Latitude weighting kernel about the contour. Size in gridpoints. Weights are normalized during the computation.
lon_kernel (numpy.ndarray, optional) – Longitude weighting kernel about the contour. Size in gridpoints. Weights are normalized during the computation.
vectorize (boolean, optional) – Use vectorization of
xarray.apply_ufunc()
.names (dict, optional) – Variable name override.
- Returns:
Mean of da_y along contour xvalue in da_x.
- Return type:
xarray.DataArray
Numpy Interface¶
- rwguide.hovmoeller.mean_along_contour(xvalue, field_x, field_y, area_weights, lat_kernel=None, lon_kernel=None)¶