Skip to content

Commit

Permalink
FIX exercises 1 and 4 and minor changes in header, as well as removal…
Browse files Browse the repository at this point in the history
… of mean calculation duplicate.
  • Loading branch information
nsea-log committed Apr 25, 2024
1 parent 19cd772 commit cf9976e
Showing 1 changed file with 28 additions and 89 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"\n",
"**Production editors:** Wesley Banfield, Paul Heubel, Jenna Pearson, Konstantine Tsafatinos, Chi Zhang, Ohad Zivan\n",
"\n",
"**Our 2024 Sponsors:** NFDI4Earth, CMIP\n"
"**Our 2024 Sponsors:** CMIP, NFDI4Earth\n"
]
},
{
Expand Down Expand Up @@ -65,7 +65,6 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"execution": {},
"tags": [
"colab"
]
Expand All @@ -80,9 +79,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"execution": {}
},
"metadata": {},
"outputs": [],
"source": [
"import matplotlib.pyplot as plt\n",
Expand All @@ -103,8 +100,7 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"cellView": "form",
"execution": {}
"cellView": "form"
},
"outputs": [],
"source": [
Expand Down Expand Up @@ -156,8 +152,7 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"cellView": "form",
"execution": {}
"cellView": "form"
},
"outputs": [],
"source": [
Expand All @@ -184,8 +179,7 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"cellView": "form",
"execution": {}
"cellView": "form"
},
"outputs": [],
"source": [
Expand All @@ -203,7 +197,6 @@
"execution_count": null,
"metadata": {
"cellView": "form",
"execution": {},
"tags": []
},
"outputs": [],
Expand Down Expand Up @@ -261,7 +254,6 @@
"execution_count": null,
"metadata": {
"cellView": "form",
"execution": {},
"pycharm": {
"name": "#%%\n"
},
Expand Down Expand Up @@ -342,9 +334,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"execution": {}
},
"metadata": {},
"outputs": [],
"source": [
"# note this can take a few minutes to download\n",
Expand All @@ -369,21 +359,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"execution": {}
},
"outputs": [],
"source": [
"# take the temporal mean over 26 years (Jan 1980 - Dec 2005)\n",
"ERA5_mean = ERA5_mm.mean(\"time\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"execution": {}
},
"metadata": {},
"outputs": [],
"source": [
"# take the temporal mean over 26 years (Jan 1980 - Dec 2005)\n",
Expand All @@ -393,9 +369,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"execution": {}
},
"metadata": {},
"outputs": [],
"source": [
"ERA5_mean"
Expand All @@ -414,7 +388,6 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"execution": {},
"tags": []
},
"outputs": [],
Expand Down Expand Up @@ -468,9 +441,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"execution": {}
},
"metadata": {},
"outputs": [],
"source": [
"#################################################\n",
Expand All @@ -484,7 +455,7 @@
"dataplot = ax.contourf(\n",
" ERA5_mean.longitude,\n",
" ERA5_mean.latitude,\n",
" ERA5_ANN[var],\n",
" ERA5_mean[var],\n",
" levels=colorlevels_clim,\n",
" transform=ccrs.PlateCarree(),\n",
" cmap=plt.cm.coolwarm,\n",
Expand All @@ -495,9 +466,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"execution": {}
},
"metadata": {},
"outputs": [],
"source": [
"# to_remove solution\n",
Expand Down Expand Up @@ -544,9 +513,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"execution": {}
},
"metadata": {},
"outputs": [],
"source": [
"# to_remove explanation\n",
Expand All @@ -570,9 +537,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"execution": {}
},
"metadata": {},
"outputs": [],
"source": [
"fig, ax = plt.subplots()\n",
Expand Down Expand Up @@ -624,9 +589,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"execution": {}
},
"metadata": {},
"outputs": [],
"source": [
"# to_remove explanation\n",
Expand Down Expand Up @@ -654,9 +617,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"execution": {}
},
"metadata": {},
"outputs": [],
"source": [
"# Note how we use several commands in one line.\n",
Expand All @@ -669,9 +630,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"execution": {}
},
"metadata": {},
"outputs": [],
"source": [
"# Have a look at our new dataset, which incorporates the zonal mean and the temporal mean of every month\n",
Expand All @@ -694,9 +653,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"execution": {}
},
"metadata": {},
"outputs": [],
"source": [
"# Note how we use several commands in one line.\n",
Expand All @@ -709,9 +666,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"execution": {}
},
"metadata": {},
"outputs": [],
"source": [
"# Have a look at our new dataset, which incorporates the zonal mean and the temporal mean of every month\n",
Expand All @@ -734,9 +689,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"execution": {}
},
"metadata": {},
"outputs": [],
"source": [
"# plot the zonal wind component of the wind vector\n",
Expand Down Expand Up @@ -772,9 +725,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"execution": {}
},
"metadata": {},
"outputs": [],
"source": [
"# select the variable of interest and plot it with xarray's plotting method\n",
Expand All @@ -784,9 +735,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"execution": {}
},
"metadata": {},
"outputs": [],
"source": [
"# to_remove solution\n",
Expand Down Expand Up @@ -843,9 +792,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"execution": {}
},
"metadata": {},
"outputs": [],
"source": [
"# select the variable of interest, group the data by season, and average over all seasons.\n",
Expand All @@ -857,9 +804,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"execution": {}
},
"metadata": {},
"outputs": [],
"source": [
"# to_remove solution\n",
Expand All @@ -872,9 +817,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"execution": {}
},
"metadata": {},
"outputs": [],
"source": [
"ERA5_season_u10"
Expand All @@ -883,12 +826,9 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"execution": {}
},
"metadata": {},
"outputs": [],
"source": [
"# to_remove solution\n",
"var='u10'\n",
"season='DJF'\n",
"F, ax = set_projection_figure(projection = ccrs.PlateCarree())\n",
Expand Down Expand Up @@ -917,11 +857,10 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"execution": {}
},
"metadata": {},
"outputs": [],
"source": [
"# to_remove solution\n",
"var='u10'\n",
"season='DJF'\n",
"F, ax = set_projection_figure(projection = ccrs.PlateCarree())\n",
Expand Down Expand Up @@ -1024,7 +963,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.19"
"version": "3.9.18"
},
"toc-autonumbering": true
},
Expand Down

0 comments on commit cf9976e

Please sign in to comment.