pyiem.plot.windrose module#

A WindrosePlot.

class pyiem.plot.windrose.WindrosePlot(**kwargs)[source]#

Bases: object

A plot that has a single windrose on it.

barplot(direction, speed, bins, nsector, **kwargs)[source]#

Do the bar plotting work.

Parameters:

cmap (colormap,optional) – Use matplotlib cmap for bars.

plot_calm()[source]#

Clear out the center and plot the calm value.

Brand the plot.

draw_arrows()[source]#

Place arrows on the border.

pyiem.plot.windrose.histogram(speed, direction, bins, nsector)[source]#

Create the histogram on the given data.

Parameters:
  • speed (pint.Quantity) – wind speed with units attached.

  • direction (pint.Quantity) – wind direction from North.

  • bins (pint.Quantity) – wind thresholds to use for bining. Any value below the first value is considered calm. The last value is extended to infinity to represent the last bin.

Returns:

the percentage of reports below first bin value. dir_centers (list): the center of the direction bins. table (np.ndarray): The <direction>, <speed> histogram in percent.

Return type:

calm_percent (float)

pyiem.plot.windrose.plot(direction, speed, **kwargs)[source]#

Create a WindrosePlot, add bars and other standard things.

Parameters:
  • direction (pint.Quantity) – wind direction from North.

  • speed (pint.Quantity) – wind speeds with units attached.

  • bins (pint.Quantity) – wind speed bins to produce the histogram for.

  • nsector (int) – The number of directional centers to divide the wind rose into. The first sector is centered on north.

  • rmax (float) – Hard codes the max radius value for the polar plot.

  • cmap (colormap) – Matplotlib colormap to use.

  • plot_convention (str) – Either from (default) or to.

Returns:

WindrosePlot