Skip to content

Commit 597800f

Browse files
committed
adjusting template
1 parent f500b04 commit 597800f

File tree

2 files changed

+52
-167
lines changed

2 files changed

+52
-167
lines changed

projections-cmip6.ipynb

Lines changed: 29 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -61,20 +61,13 @@
6161
]
6262
},
6363
"source": [
64-
"## Learning Objectives\n",
64+
"## Learning Objectives 🎯\n",
6565
"\n",
6666
"This notebook provides a practical introduction on how to access and process [CMIP6 global climate projections](https://cds.climate.copernicus.eu/datasets/projections-cmip6?tab=overview) data available in the Climate Data Store (CDS) of the Copernicus Climate Change Service (C3S). The workflow shows how to compute and visualize the output of an ensemble of models for the annual global average temperature between 1850 to 2100. You will use the `historical` experiment for the temporal period 1850 to 2014 and the three scenarios `SSP1-2.6`, `SSP2-4.5` and `SSP5-8.5` for the period from 2015 to 2100.\n",
6767
"\n",
6868
"Learn [here](https://confluence.ecmwf.int/display/CKB/CMIP6%3A+Global+climate+projections#CMIP6:Globalclimateprojections) more about CMIP6 global climate projections and the CMIP6 experiments in the CDS."
6969
]
7070
},
71-
{
72-
"cell_type": "markdown",
73-
"metadata": {},
74-
"source": [
75-
"<hr>"
76-
]
77-
},
7871
{
7972
"cell_type": "markdown",
8073
"metadata": {
@@ -133,7 +126,7 @@
133126
},
134127
{
135128
"cell_type": "code",
136-
"execution_count": 7,
129+
"execution_count": null,
137130
"metadata": {
138131
"editable": true,
139132
"slideshow": {
@@ -148,6 +141,7 @@
148141
"# General libs for file paths, data extraction, etc\n",
149142
"from glob import glob\n",
150143
"from pathlib import Path\n",
144+
"import os\n",
151145
"from os.path import basename\n",
152146
"import zipfile # To extract zipfiles\n",
153147
"import urllib3 \n",
@@ -204,13 +198,6 @@
204198
"os.makedirs(DATADIR, exist_ok=True)"
205199
]
206200
},
207-
{
208-
"cell_type": "markdown",
209-
"metadata": {},
210-
"source": [
211-
"<hr>"
212-
]
213-
},
214201
{
215202
"cell_type": "markdown",
216203
"metadata": {
@@ -249,34 +236,24 @@
249236
"source": [
250237
"Having selected the correct dataset, we now need to specify what product type, variables, temporal and geographic coverage we are interested in. These can all be selected in the **\"Download data\"** tab. In this tab a form appears in which we will select the following parameters to download:\n",
251238
"\n",
252-
"<details>\n",
253-
" <summary><strong> Parameters of data to download</strong></summary>\n",
239+
":::{dropdown} Parameters of data to download\n",
254240
" \n",
255-
" - Data: `CMIP6 global climate projections of near-surface air temperature`\n",
256-
" - Experiments: `Historical`, `SSP1-2.6`, `SSP2-4.5`, `SSP5-8.5`\n",
257-
" - Models: 7 models from Germany, France, UK, Japan and Russia\n",
258-
" - Temporal range: `Historical: 1850 - 2014`. `Scenarios: 2015 - 2100`\n",
259-
" - Spatial coverage: `Global`\n",
260-
" - Format: `NetCDF`, compressed into zip files"
261-
]
262-
},
263-
{
264-
"cell_type": "markdown",
265-
"metadata": {
266-
"editable": true,
267-
"slideshow": {
268-
"slide_type": ""
269-
},
270-
"tags": [
271-
"request"
272-
]
273-
},
274-
"source": [
241+
"- Data: `CMIP6 global climate projections of near-surface air temperature`\n",
242+
"- Experiments: `Historical`, `SSP1-2.6`, `SSP2-4.5`, `SSP5-8.5`\n",
243+
"- Models: 7 models from Germany, France, UK, Japan and Russia\n",
244+
"- Temporal range: `Historical: 1850 - 2014`. `Scenarios: 2015 - 2100`\n",
245+
"- Spatial coverage: `Global`\n",
246+
"- Format: `NetCDF`, compressed into zip files\n",
247+
"\n",
248+
":::\n",
249+
"\n",
275250
"At the end of the download form, select **\"Show API request\"**. This will reveal a block of code, which you can simply copy and paste into a cell of your Jupyter Notebook (see cell below). Having copied the API request into the cell below, running this will retrieve and download the data you requested into your local directory.\n",
276251
"\n",
277-
"*Please note that text below will appear in a warning box when rendered on the JupyterBook html pages*\n",
252+
":::{warning}\n",
253+
"\n",
254+
"Please remember to accept the terms and conditions of the dataset, at the bottom of the CDS download form!\n",
278255
"\n",
279-
":warning: Please remember to accept the terms and conditions of the dataset, at the bottom of the CDS download form!"
256+
":::"
280257
]
281258
},
282259
{
@@ -352,9 +329,11 @@
352329
]
353330
},
354331
"source": [
355-
"<div class=\"alert alert-block alert-success\">\n",
356-
"<b>NOTE</b>: <br>\n",
357-
" Note that these are a selection of the lightest models (in terms of data volume), to facilitate download for the sake of this exercise. There are many <a href=\"https://cds.climate.copernicus.eu/datasets/projections-cmip6?tab=overview\">more models available on the CDS.</a></div>"
332+
":::{note}\n",
333+
"\n",
334+
"Note that these are a selection of the lightest models (in terms of data volume), to facilitate download for the sake of this exercise. There are many [more models](https://cds.climate.copernicus.eu/datasets/projections-cmip6?tab=overview\") available on the CDS.\n",
335+
"\n",
336+
":::"
358337
]
359338
},
360339
{
@@ -441,13 +420,6 @@
441420
" f'{DATADIR}cmip6_monthly_2015-2100_{i}_{j}.zip')"
442421
]
443422
},
444-
{
445-
"cell_type": "markdown",
446-
"metadata": {},
447-
"source": [
448-
"<hr>"
449-
]
450-
},
451423
{
452424
"cell_type": "markdown",
453425
"metadata": {},
@@ -478,7 +450,7 @@
478450
"cell_type": "markdown",
479451
"metadata": {},
480452
"source": [
481-
"#### Create a list of the extracted files\n",
453+
"### Create a list of the extracted files\n",
482454
"\n",
483455
"To facilitate batch processing later in the tutorial, here we create a list of the extracted NetCDF files:"
484456
]
@@ -526,13 +498,6 @@
526498
"cmip6_nc[0:5]"
527499
]
528500
},
529-
{
530-
"cell_type": "markdown",
531-
"metadata": {},
532-
"source": [
533-
"<hr>"
534-
]
535-
},
536501
{
537502
"cell_type": "markdown",
538503
"metadata": {},
@@ -558,7 +523,7 @@
558523
"cell_type": "markdown",
559524
"metadata": {},
560525
"source": [
561-
"#### Load and inspect data"
526+
"### Load and inspect data"
562527
]
563528
},
564529
{
@@ -1110,7 +1075,7 @@
11101075
"cell_type": "markdown",
11111076
"metadata": {},
11121077
"source": [
1113-
"#### Spatial aggregation"
1078+
"### Spatial aggregation"
11141079
]
11151080
},
11161081
{
@@ -1155,7 +1120,7 @@
11551120
"cell_type": "markdown",
11561121
"metadata": {},
11571122
"source": [
1158-
"#### Temporal aggregation"
1123+
"### Temporal aggregation"
11591124
]
11601125
},
11611126
{
@@ -1180,7 +1145,7 @@
11801145
"cell_type": "markdown",
11811146
"metadata": {},
11821147
"source": [
1183-
"#### Conversion from Kelvin to Celsius"
1148+
"### Conversion from Kelvin to Celsius"
11841149
]
11851150
},
11861151
{
@@ -1203,7 +1168,7 @@
12031168
"cell_type": "markdown",
12041169
"metadata": {},
12051170
"source": [
1206-
"#### Create additional data dimensions (to later combine data from multiple models & experiments)"
1171+
"### Create additional data dimensions (to later combine data from multiple models & experiments)"
12071172
]
12081173
},
12091174
{
@@ -1225,13 +1190,6 @@
12251190
"da_yr = da_yr.expand_dims('experiment')"
12261191
]
12271192
},
1228-
{
1229-
"cell_type": "markdown",
1230-
"metadata": {},
1231-
"source": [
1232-
"<hr>"
1233-
]
1234-
},
12351193
{
12361194
"cell_type": "markdown",
12371195
"metadata": {},
@@ -1776,13 +1734,6 @@
17761734
"data = data_ds['tas']"
17771735
]
17781736
},
1779-
{
1780-
"cell_type": "markdown",
1781-
"metadata": {},
1782-
"source": [
1783-
"<hr>"
1784-
]
1785-
},
17861737
{
17871738
"cell_type": "markdown",
17881739
"metadata": {},
@@ -1833,7 +1784,7 @@
18331784
"cell_type": "markdown",
18341785
"metadata": {},
18351786
"source": [
1836-
"#### View time-series"
1787+
"### View time-series"
18371788
]
18381789
},
18391790
{
@@ -1897,13 +1848,6 @@
18971848
"The visualization of the `CMIP6 annual global average temperature (1850 to 2100)` above shows that the global average temperature was more or less stable in the pre-industrial phase, but steadily increases since the 1990s. It shows further that, depending on the SSP scenario, the course and increase of the global annual temperature differs. While for the best case `SSP1-2.6` scenario, the global annual temperature could stabilize around 15 degC, in the worst case `SSP5-8.5` scenario, the global annual temperature could increase to above 20 degC."
18981849
]
18991850
},
1900-
{
1901-
"cell_type": "markdown",
1902-
"metadata": {},
1903-
"source": [
1904-
"<hr>"
1905-
]
1906-
},
19071851
{
19081852
"cell_type": "markdown",
19091853
"metadata": {},

0 commit comments

Comments
 (0)