"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# ERA5_ARCO Pressure Level Data Exploration: Matplotlib"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"---"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Overview\n",
"A team at [Google Research & Cloud](https://research.google/) are making parts of the [ECMWF Reanalysis version 5](https://www.ecmwf.int/en/forecasts/dataset/ecmwf-reanalysis-v5) (aka **ERA-5**) accessible in a [Analysis Ready, Cloud Optimized](https://www.frontiersin.org/articles/10.3389/fclim.2021.782909/full) (aka **ARCO**) format.\n",
"\n",
"In this notebook, we will do the following:\n",
"\n",
"1. Access the [ERA-5 ARCO](https://github.com/google-research/arco-era5) catalog\n",
"1. Select a particular dataset and variable from the catalog\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Prerequisites\n",
"\n",
"| Concepts | Importance | Notes |\n",
"| --- | --- | --- |\n",
"| [Cartopy](https://foundations.projectpythia.org/core/cartopy/cartopy.html) | Necessary | |\n",
"| [Xarray](https://foundations.projectpythia.org/core/xarray) | Necessary | |\n",
"\n",
"\n",
"- **Time to learn**: 30 minutes"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"---"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Imports"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import xarray as xr\n",
"import matplotlib.pyplot as plt\n",
"import cartopy.crs as ccrs\n",
"import cartopy.feature as cfeature\n",
"from metpy import calc as mpcalc\n",
"from metpy.units import units\n",
"import metpy\n",
"import numpy as np\n",
"from datetime import datetime, timedelta"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Access the ARCO ERA-5 catalog on Google Cloud"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Let's open the **37-level isobaric surfaces reanalysis** Zarr file"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"reanalysis = xr.open_zarr(\n",
" 'gs://gcp-public-data-arco-era5/ar/1959-2022-full_37-1h-0p25deg-chunk-1.zarr-v2', \n",
" consolidated=True\n",
")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"reanalysis"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"geop = reanalysis.geopotential\n",
"temp = reanalysis.temperature"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"geop"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"Select time and level ranges from the dataset."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"nHours = 6 \n",
"startTime = datetime(1993,3,13,18)\n",
"endTime = startTime + timedelta(hours=nHours)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"
\n",
" RESTRICT YOUR TIME/LEVEL RANGES! \n",
"The full dataset is over 70 TB ... if you try to load in too large a range (or forget to specify the start/stop points), you will likely run out of system memory!\n",
"