{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Wind Rose\n", "\n", "A wind rose is a graphic tool used by meteorologists to give a succinct view of how wind speed and direction are typically distributed at a particular location. Historically, wind roses were predecessors of the compass rose, as there was no differentiation between a cardinal direction and the wind which blew from such a direction. Using a polar coordinate system of gridding, the frequency of winds over a time period is plotted by wind direction, with color bands showing wind speed ranges. The direction of the longest spoke shows the wind direction with the greatest frequency (https://en.wikipedia.org/wiki/Wind_rose).\n", "\n", "This notebook is extracted from the python package of [windrose](https://github.com/python-windrose/windrose) with a little bit modification. Please refer to the original windrose’s documentation for more information." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 1. Load all needed libraries" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "collapsed": true }, "outputs": [], "source": [ "%matplotlib inline\n", "import pandas as pd\n", "import numpy as np\n", "from matplotlib import pyplot as plt\n", "import matplotlib.cm as cm\n", "import numpy as np\n", "from math import pi\n", "\n", "from windrose import WindroseAxes, WindAxes, plot_windrose\n", "\n", "from pylab import rcParams\n", "rcParams['figure.figsize'] = 6, 6" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 2. Load wind time series data" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", " | speed | \n", "direction | \n", "
---|---|---|
Timestamp | \n", "\n", " | \n", " |
2011-03-07 17:30:00 | \n", "3.6 | \n", "91.0 | \n", "
2011-03-07 17:40:00 | \n", "5.6 | \n", "92.0 | \n", "
2011-03-07 17:50:00 | \n", "4.9 | \n", "92.0 | \n", "
2011-03-07 18:00:00 | \n", "2.3 | \n", "113.0 | \n", "
2011-03-07 18:10:00 | \n", "3.2 | \n", "84.0 | \n", "