{ "cells": [ { "cell_type": "code", "execution_count": 1, "id": "facc85f9", "metadata": {}, "outputs": [], "source": [ "from pathlib import Path\n", "import numpy as np\n", "import xarray as xr\n", "\n", "import matplotlib.pyplot as plt\n", "\n", "from cartopy.geodesic import Geodesic\n", "import cartopy.crs as ccrs" ] }, { "cell_type": "markdown", "id": "35dca707", "metadata": {}, "source": [ "Set paths to datasets. The 2D and 3D variables are stored in different files" ] }, { "cell_type": "code", "execution_count": 2, "id": "0a755183", "metadata": {}, "outputs": [], "source": [ "datadir = Path('data')\n", "data_file_2D = datadir / \"ERA5_merged_Aus_6hourly_2021-03_2D.nc\"\n", "data_file_3D = datadir / \"ERA5_merged_Aus_6hourly_2021-03_3D.nc\"" ] }, { "cell_type": "markdown", "id": "77b4978e", "metadata": {}, "source": [ "Open data files and load metadata into [``xarray.Dataset``](https://docs.xarray.dev/en/stable/generated/xarray.Dataset.html) objects. Note no data is loaded at this point, just metadata." ] }, { "cell_type": "code", "execution_count": 3, "id": "c40c8a59", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
<xarray.Dataset>\n",
"Dimensions: (time: 56, longitude: 201, latitude: 141)\n",
"Coordinates:\n",
" * time (time) datetime64[ns] 2021-03-16T03:00:00 ... 2021-03-29T21:00:00\n",
" * longitude (longitude) float32 110.0 110.2 110.5 110.8 ... 159.5 159.8 160.0\n",
" * latitude (latitude) float32 -10.0 -10.25 -10.5 ... -44.5 -44.75 -45.0\n",
"Data variables:\n",
" u10 (time, latitude, longitude) float32 ...\n",
" v10 (time, latitude, longitude) float32 ...\n",
" t2m (time, latitude, longitude) float32 ...\n",
" mer (time, latitude, longitude) float32 ...\n",
" msl (time, latitude, longitude) float32 ...\n",
" mtnlwrf (time, latitude, longitude) float32 ...\n",
" mtpr (time, latitude, longitude) float32 ...\n",
" tciw (time, latitude, longitude) float32 ...\n",
" tclw (time, latitude, longitude) float32 ...\n",
" tcwv (time, latitude, longitude) float32 ...\n",
" p71.162 (time, latitude, longitude) float32 ...\n",
" p72.162 (time, latitude, longitude) float32 ...\n",
"Attributes:\n",
" CDI: Climate Data Interface version 1.9.10 (https://mpimet.mpg.d...\n",
" Conventions: CF-1.6\n",
" history: Fri May 13 00:02:43 2022: cdo merge ERA5_Aus_6hourly_2021-0...\n",
" license: Licence to use Copernicus Products: https://apps.ecmwf.int/...\n",
" summary: ERA5 is the fifth generation ECMWF atmospheric reanalysis o...\n",
" title: ERA5 single-levels reanalysis 10m_u_component_of_wind 20210...\n",
" NCO: netCDF Operators version 5.0.5 (Homepage = http://nco.sf.ne...\n",
" var_nm: u10\n",
" CDO: Climate Data Operators version 1.9.10 (https://mpimet.mpg.d...<xarray.Dataset>\n",
"Dimensions: (time: 56, longitude: 201, latitude: 141, level: 10)\n",
"Coordinates:\n",
" * time (time) datetime64[ns] 2021-03-16T03:00:00 ... 2021-03-29T21:00:00\n",
" * longitude (longitude) float32 110.0 110.2 110.5 110.8 ... 159.5 159.8 160.0\n",
" * latitude (latitude) float32 -10.0 -10.25 -10.5 ... -44.5 -44.75 -45.0\n",
" * level (level) float64 70.0 150.0 225.0 350.0 ... 850.0 925.0 1e+03\n",
"Data variables:\n",
" q (time, level, latitude, longitude) float32 ...\n",
" t (time, level, latitude, longitude) float32 ...\n",
" u (time, level, latitude, longitude) float32 ...\n",
" v (time, level, latitude, longitude) float32 ...\n",
" z (time, level, latitude, longitude) float32 ...\n",
"Attributes:\n",
" CDI: Climate Data Interface version 1.9.10 (https://mpimet.mpg.d...\n",
" Conventions: CF-1.6\n",
" history: Fri May 13 00:02:43 2022: cdo merge ERA5_Aus_6hourly_2021-0...\n",
" license: Licence to use Copernicus Products: https://apps.ecmwf.int/...\n",
" summary: ERA5 is the fifth generation ECMWF atmospheric reanalysis o...\n",
" title: ERA5 pressure-levels oper specific_humidity 20210301-20210331\n",
" NCO: netCDF Operators version 5.0.5 (Homepage = http://nco.sf.ne...\n",
" var_nm: q\n",
" CDO: Climate Data Operators version 1.9.10 (https://mpimet.mpg.d...<xarray.DataArray 'p72.162' (longitude: 37)>\n",
"array([-319.9227 , -359.9646 , -387.0301 , -413.7336 , -438.17163, -463.96362,\n",
" -488.49548, -515.2392 , -540.76306, -553.954 , -565.6569 , -553.8333 ,\n",
" -538.71204, -521.80786, -499.12595, -471.85938, -443.88235, -420.74463,\n",
" -395.34143, -373.49063, -348.52982, -327.05438, -310.82043, -300.59213,\n",
" -293.56772, -295.72598, -297.9647 , -311.04834, -334.3201 , -352.9938 ,\n",
" -377.01627, -394.92587, -409.9399 , -421.1066 , -427.46075, -414.10898,\n",
" -379.6169 ], dtype=float32)\n",
"Coordinates:\n",
" time datetime64[ns] 2021-03-22T03:00:00\n",
" * longitude (longitude) float32 141.0 141.2 141.5 141.8 ... 149.5 149.8 150.0\n",
" latitude float32 -30.0\n",
"Attributes:\n",
" long_name: Vertical integral of northward water vapour flux\n",
" units: kg m**-1 s**-1\n",
" cell_methods: time: mean