xoa.plot.plot_rose#
- xoa.plot.plot_rose(value, direction=None, cartesian=None, from_=False, **kwargs)[source]#
Plot a wind, wave or current rose
The frequencies of the directions are stacked by bins of value. The samples that are missing in the value or in the direction are ignored: mask the bad quality ones before, for instance with
xarray.DataArray.where().- Parameters:
value (xarray.DataArray, xarray.Dataset) – Wind speed or wave height, for instance, or the eastward component when
cartesianis true. With a dataset, the first of the"wspd"and"hs"generic meta names that is found is used, and the direction is searched withxoa.metawhen not provided. When none is found, the components of the currents are searched withxoa.dyn.get_u()andxoa.dyn.get_v(), then those of the wind.direction (None, xarray.DataArray) – Direction in degrees, clockwise from the north, with the same shape as the value. It is the direction that the wind or the waves come from or go to: this does not change the plot. The
"wfdir","wtdir","wdir","th1p"and"dp"generic names are searched in a dataset. It is the northward component whencartesianis true.cartesian (None, bool) – Are the arguments the eastward and northward components
(u, v)instead of(value, direction)? The rose is then made of the speed and of its direction. If None,directionis taken as a northward component when it is identified as such withxoa.metaand has no angle units.from (bool) – With components, use the direction the flow comes from, like the wind and the waves, instead of the direction it goes to, like the currents.
kwargs – Extra parameters, like
nsector,edges,cmaporrmax, are passed toxoa.core.plot.plot_rose().
- Returns:
xoa.core.plot.Rose
Example
plot_rose(ds.hs, ds.direction, nsector=12) plot_rose(ds) # variables are searched plot_rose(ds.u, ds.v, from_=True) plot_rose(ds.uo, ds.vo_alias, cartesian=True) # when the components are not identified
See also