diff --git a/doc/examples/ERA5-GRIB-example.ipynb b/doc/examples/ERA5-GRIB-example.ipynb index 808d6f619a0..9fdba414832 100644 --- a/doc/examples/ERA5-GRIB-example.ipynb +++ b/doc/examples/ERA5-GRIB-example.ipynb @@ -1,5 +1,19 @@ { "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# GRIB Data Example " + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "GRIB format is commonly used to disemminate atmospheric model data. With Xarray and the cfgrib engine, GRIB data can easily be analyzed and visualized." + ] + }, { "cell_type": "code", "execution_count": null, @@ -10,6 +24,13 @@ "import matplotlib.pyplot as plt" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "To read GRIB data, you can use `xarray.load_dataset`. The only extra code you need is to specify the engine as `cfgrib`." + ] + }, { "cell_type": "code", "execution_count": null, @@ -19,6 +40,13 @@ "ds = xr.load_dataset('data/era5-2mt-2019-03-uk.grib', engine='cfgrib')" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Let's create a simple plot of 2-m air temperature in degrees Celsius:" + ] + }, { "cell_type": "code", "execution_count": null, @@ -29,6 +57,13 @@ "ds.t2m[0].plot(cmap=plt.cm.coolwarm)" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "With CartoPy, we can create a more detailed plot, using built-in shapefiles to help provide geographic context:" + ] + }, { "cell_type": "code", "execution_count": null, @@ -45,13 +80,10 @@ ] }, { - "cell_type": "code", - "execution_count": null, + "cell_type": "markdown", "metadata": {}, - "outputs": [], "source": [ - "ds.t2m.sel(longitude=0,latitude=51.5).plot()\n", - "plt.title('ERA5 - London 2m temperature March 2019')" + "Finally, we can also pull out a time series for a given location easily:" ] }, { @@ -59,7 +91,10 @@ "execution_count": null, "metadata": {}, "outputs": [], - "source": [] + "source": [ + "ds.t2m.sel(longitude=0,latitude=51.5).plot()\n", + "plt.title('ERA5 - London 2m temperature March 2019')" + ] } ], "metadata": {