{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Gold Coast wave monitoring \n", "\n", "Measured and derived wave parameters from data collected by a wave monitoring buoy anchored at the Gold Coast.\n", "For more information please refer to www.qld.gov.au/waves.\n", "\n", "The dataset is available from the [Gold Coast wave monitoring](https://www.qld.gov.au/environment/coasts-waterways/beach/monitoring/waves-sites/gold-coast) website. On this page you will find at the bottom right a `Download data` button, which provides a link to a series of dataset.\n", "\n", "\n", "```{figure} ../_static/qldgov.png\n", "---\n", "figclass: margin\n", "name: margin_figure21\n", "---\n", "```\n", "\n", ":::{admonition} Field names:\n", ":class: toggle, hint, toggle-shown\n", "\n", "+ `Hs` - Significant wave height, an average of the highest third of the waves in a record (26.6 minute recording period).\n", "+ `Hmax` - The maximum wave height in the record.\n", "+ `Tz` - The zero upcrossing wave period.\n", "+ `Tp` - The peak energy wave period.\n", "+ `Peak Direction` - Direction (related to true north) from which the peak period waves are coming from.\n", "+ `SST` - Approximation of sea surface temperature.\n", "\n", ":::\n" ] }, { "cell_type": "code", "execution_count": 40, "metadata": {}, "outputs": [], "source": [ "%matplotlib inline\n", "import io\n", "import requests\n", "from pylab import *\n", "import netCDF4\n", "import datetime as dt\n", "import numpy as np\n", "import pandas as pd\n", "import matplotlib.dates as mdates\n", "\n", "from pylab import rcParams\n", "import warnings\n", "warnings.filterwarnings('ignore')\n", "%config InlineBackend.figure_format = 'svg'" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Getting the dataset \n", "\n", "From the website you can either download a `CSV` containing the data or directly get it from the provided `url`." ] }, { "cell_type": "code", "execution_count": 24, "metadata": {}, "outputs": [], "source": [ "# Get the URL link\n", "url = \"https://www.data.qld.gov.au/dataset/d656d418-31b1-41fe-aae2-3d8a12588711/resource/73b4e42a-f3e7-4632-8b8e-d52205899048/download/gold-coast_2020-01-01t00_00-2020-12-31t23_30.csv\"\n", "\n", "# Open it with Pandas Library\n", "s = requests.get(url).content\n", "data_df = pd.read_csv(io.StringIO(s.decode('utf-8')))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We can visualise what is in the dataset by doing:" ] }, { "cell_type": "code", "execution_count": 25, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", " | Date/Time | \n", "Hs | \n", "Hmax | \n", "Tz | \n", "Tp | \n", "Peak Direction | \n", "SST | \n", "
---|---|---|---|---|---|---|---|
0 | \n", "2020-01-01 00:00:00 | \n", "1.490 | \n", "2.48 | \n", "7.339 | \n", "12.174 | \n", "78.08 | \n", "25.35 | \n", "
1 | \n", "2020-01-01 00:30:00 | \n", "1.515 | \n", "2.56 | \n", "7.106 | \n", "13.074 | \n", "79.08 | \n", "25.40 | \n", "
2 | \n", "2020-01-01 01:00:00 | \n", "1.533 | \n", "2.42 | \n", "7.274 | \n", "13.406 | \n", "79.08 | \n", "25.35 | \n", "
3 | \n", "2020-01-01 01:30:00 | \n", "1.501 | \n", "2.59 | \n", "6.888 | \n", "12.242 | \n", "81.08 | \n", "25.35 | \n", "
4 | \n", "2020-01-01 02:00:00 | \n", "1.499 | \n", "2.72 | \n", "7.255 | \n", "12.920 | \n", "84.08 | \n", "25.35 | \n", "
... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "
17563 | \n", "2020-12-31 21:30:00 | \n", "1.295 | \n", "2.21 | \n", "4.809 | \n", "6.192 | \n", "103.24 | \n", "23.90 | \n", "
17564 | \n", "2020-12-31 22:00:00 | \n", "1.190 | \n", "1.85 | \n", "4.705 | \n", "6.826 | \n", "106.24 | \n", "23.90 | \n", "
17565 | \n", "2020-12-31 22:30:00 | \n", "1.144 | \n", "1.89 | \n", "4.867 | \n", "5.997 | \n", "115.24 | \n", "23.90 | \n", "
17566 | \n", "2020-12-31 23:00:00 | \n", "1.215 | \n", "2.22 | \n", "5.119 | \n", "6.973 | \n", "82.24 | \n", "23.95 | \n", "
17567 | \n", "2020-12-31 23:30:00 | \n", "1.210 | \n", "2.39 | \n", "5.040 | \n", "7.491 | \n", "101.24 | \n", "24.00 | \n", "
17568 rows × 7 columns
\n", "