Skip to content

Commit

Permalink
DOC: Update notebooks
Browse files Browse the repository at this point in the history
  • Loading branch information
Abel Aoun committed Jan 24, 2024
1 parent a76f2d4 commit e855da0
Show file tree
Hide file tree
Showing 7 changed files with 92 additions and 554 deletions.
1 change: 1 addition & 0 deletions doc/source/tutorials/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ capabilities. To see how icclim can solve specific issues see
notebooks/tg90p_calculate__subset_and_plot
notebooks/custom_freezing_tas
notebooks/cold_spell_duration
notebooks/su_summer_days__subset_and_plot
2 changes: 1 addition & 1 deletion doc/source/tutorials/notebooks/averaged_tas_anomaly.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"\n",
"## Averaged Temperature Anomaly 2081-2100 vs 1971-2000 SSP585\n",
"\n",
"This example calculates the averaged temperature anomaly (using the TG indicator) for the period 2081-2100 compared to the reference 1971-2000 for SSP585 and several climate models.\n",
"This example calculates the averaged temperature anomaly (using the **TG** indicator) for the period 2081-2100 compared to the reference 1971-2000 for SSP585 and several climate models.\n",
"\n",
"We assume to have the **tas** variable in netCDF files in a `./data` folder.\n",
"The data can be dowloaded using the [metalink](data/cmcc_gfdl_tas.metalink) provided with this notebook.\n",
Expand Down
536 changes: 1 addition & 535 deletions doc/source/tutorials/notebooks/cold_spell_duration.ipynb

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion doc/source/tutorials/notebooks/custom_freezing_tas.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"tags": []
},
"source": [
"# Calculate number of days with freezing mean temperature\n",
"# Calculate custom index: number of days with freezing mean temperature\n",
"\n",
"Example notebook that runs icclim.\n",
"\n",
Expand Down
68 changes: 68 additions & 0 deletions doc/source/tutorials/notebooks/data/cmcc_tas.metalink
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
<metalink xmlns="urn:ietf:params:xml:ns:metalink">
<file name="tas_day_CMCC-ESM2_ssp585_r1i1p1f1_gn_20150101-20391231.nc">
<size>1147761901</size>
<hash type="SHA256">1842d1e9d4d880f431f1a08cff252501ea32aac39e85dd02426f1616b7cc34d9</hash>
<url priority="1">http://esgf-node2.cmcc.it/thredds/fileServer/esg_dataroot/CMIP6/ScenarioMIP/CMCC/CMCC-ESM2/ssp585/r1i1p1f1/day/tas/gn/v20210126/tas_day_CMCC-ESM2_ssp585_r1i1p1f1_gn_20150101-20391231.nc</url>
</file>

<file name="tas_day_CMCC-ESM2_ssp585_r1i1p1f1_gn_20400101-20641231.nc">
<size>1145071534</size>
<hash type="SHA256">749ca55115708a81b59e0430fc2dca9674fe16ec7328b639f1232bfeb2531720</hash>
<url priority="1">http://esgf-node2.cmcc.it/thredds/fileServer/esg_dataroot/CMIP6/ScenarioMIP/CMCC/CMCC-ESM2/ssp585/r1i1p1f1/day/tas/gn/v20210126/tas_day_CMCC-ESM2_ssp585_r1i1p1f1_gn_20400101-20641231.nc</url>
</file>

<file name="tas_day_CMCC-ESM2_ssp585_r1i1p1f1_gn_20650101-20891231.nc">
<size>1141932140</size>
<hash type="SHA256">823c0ddcd5d607508f6d2c1cf262ae8345c9f5e7b90b83dff459c9768c01b874</hash>
<url priority="1">http://esgf-node2.cmcc.it/thredds/fileServer/esg_dataroot/CMIP6/ScenarioMIP/CMCC/CMCC-ESM2/ssp585/r1i1p1f1/day/tas/gn/v20210126/tas_day_CMCC-ESM2_ssp585_r1i1p1f1_gn_20650101-20891231.nc</url>
</file>

<file name="tas_day_CMCC-ESM2_ssp585_r1i1p1f1_gn_20900101-21001231.nc">
<size>501759828</size>
<hash type="SHA256">009c5804afeeac37e5337e1f9a0defcded19e1418ec604fe3c9ec921e80e7122</hash>
<url priority="1">http://esgf-node2.cmcc.it/thredds/fileServer/esg_dataroot/CMIP6/ScenarioMIP/CMCC/CMCC-ESM2/ssp585/r1i1p1f1/day/tas/gn/v20210126/tas_day_CMCC-ESM2_ssp585_r1i1p1f1_gn_20900101-21001231.nc</url>
</file>

<file name="tas_day_CMCC-ESM2_historical_r1i1p1f1_gn_18500101-18741231.nc">
<size>1150891671</size>
<hash type="SHA256">e04ed7e8cd9d826534e62d9f1f3f475d82c598c4afe4c895f6a09f611a3b2b55</hash>
<url priority="1">http://esgf-node2.cmcc.it/thredds/fileServer/esg_dataroot/CMIP6/CMIP/CMCC/CMCC-ESM2/historical/r1i1p1f1/day/tas/gn/v20210114/tas_day_CMCC-ESM2_historical_r1i1p1f1_gn_18500101-18741231.nc</url>
</file>

<file name="tas_day_CMCC-ESM2_historical_r1i1p1f1_gn_18750101-18991231.nc">
<size>1151025700</size>
<hash type="SHA256">6c4b4daf593a7f4f367422cd3809cc1903b150416768082f6f23ff7d0d423c2e</hash>
<url priority="1">http://esgf-node2.cmcc.it/thredds/fileServer/esg_dataroot/CMIP6/CMIP/CMCC/CMCC-ESM2/historical/r1i1p1f1/day/tas/gn/v20210114/tas_day_CMCC-ESM2_historical_r1i1p1f1_gn_18750101-18991231.nc</url>
</file>

<file name="tas_day_CMCC-ESM2_historical_r1i1p1f1_gn_19000101-19241231.nc">
<size>1150811941</size>
<hash type="SHA256">41ce66cfc99260dcc3f444c4d331af1bd0e31a584ce58efcf99e4fd6e1018315</hash>
<url priority="1">http://esgf-node2.cmcc.it/thredds/fileServer/esg_dataroot/CMIP6/CMIP/CMCC/CMCC-ESM2/historical/r1i1p1f1/day/tas/gn/v20210114/tas_day_CMCC-ESM2_historical_r1i1p1f1_gn_19000101-19241231.nc</url>
</file>

<file name="tas_day_CMCC-ESM2_historical_r1i1p1f1_gn_19250101-19491231.nc">
<size>1150101826</size>
<hash type="SHA256">9d98438740d5df41f8c32134ee1517bbdc1ff8fc44edae4ee7ef0f1b77cca6db</hash>
<url priority="1">http://esgf-node2.cmcc.it/thredds/fileServer/esg_dataroot/CMIP6/CMIP/CMCC/CMCC-ESM2/historical/r1i1p1f1/day/tas/gn/v20210114/tas_day_CMCC-ESM2_historical_r1i1p1f1_gn_19250101-19491231.nc</url>
</file>

<file name="tas_day_CMCC-ESM2_historical_r1i1p1f1_gn_19500101-19741231.nc">
<size>1149723510</size>
<hash type="SHA256">934178eea0dc6b0d34631f4b0a897308da91b0525217302b1cddf79a491d0eef</hash>
<url priority="1">http://esgf-node2.cmcc.it/thredds/fileServer/esg_dataroot/CMIP6/CMIP/CMCC/CMCC-ESM2/historical/r1i1p1f1/day/tas/gn/v20210114/tas_day_CMCC-ESM2_historical_r1i1p1f1_gn_19500101-19741231.nc</url>
</file>

<file name="tas_day_CMCC-ESM2_historical_r1i1p1f1_gn_19750101-19991231.nc">
<size>1149098090</size>
<hash type="SHA256">20087e4531105f3d3aec33b39c33b1ebfd9f4bf266cb58e2e40dc70a98ee2eb8</hash>
<url priority="1">http://esgf-node2.cmcc.it/thredds/fileServer/esg_dataroot/CMIP6/CMIP/CMCC/CMCC-ESM2/historical/r1i1p1f1/day/tas/gn/v20210114/tas_day_CMCC-ESM2_historical_r1i1p1f1_gn_19750101-19991231.nc</url>
</file>

<file name="tas_day_CMCC-ESM2_historical_r1i1p1f1_gn_20000101-20141231.nc">
<size>688921916</size>
<hash type="SHA256">2a085848340fcd18a92885461075e7573f30739322c60d9008a04c9206bf4e04</hash>
<url priority="1">http://esgf-node2.cmcc.it/thredds/fileServer/esg_dataroot/CMIP6/CMIP/CMCC/CMCC-ESM2/historical/r1i1p1f1/day/tas/gn/v20210114/tas_day_CMCC-ESM2_historical_r1i1p1f1_gn_20000101-20141231.nc</url>
</file>

</metalink>
20 changes: 12 additions & 8 deletions doc/source/tutorials/notebooks/deltaT_deltaP_anomaly.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,16 @@
"source": [
"# Calculate averaged surface temperature and precipitation anomalies\n",
"\n",
"#### The averaged surface temperature anomaly and the same for precipitation anomaly over the period 2081-2100 compared to the period 1981-2000, and display delta-T delta-P diagram\n",
"\n",
"Example notebook that runs icclim.\n",
"\n",
"The example calculates the averaged temperature anomaly (using the [TG](https://knmi-ecad-assets-prd.s3.amazonaws.com/documents/atbd.pdf#subsubsection.5.3.11.TG) indicator) vs the precipitation anomaly (using the PRCPTOT indicator) for the period 2081-2100 compared to the reference 1981-2000 for SSP 585 and several climate models.\n",
"Goals:\n",
"- Compute the averaged surface temperature anomaly and the same for precipitation anomaly over the period 2081-2100 compared to the period 1981-2000\n",
"- Display delta-T delta-P diagram"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The example calculates the averaged temperature anomaly (using the **TG**) indicator) vs the precipitation anomaly (using the **PRCPTOT** indicator) for the period 2081-2100 compared to the reference 1981-2000 for SSP 585 and several climate models.\n",
"\n",
"We assume to have the **tas** and the **pr** variables in netCDF files in a `./data` folder.\n",
"The data can be dowloaded using the [metalink](data/cmcc_gfdl_pr_and_tas.metalink) provided with this notebook.\n",
Expand All @@ -22,7 +27,7 @@
"\n",
"The datasets that are expected for this notebook are tas and pr parameters (needed to calculate the TG and PRCPTOT indicators respectively) for several climate models, for the historical (1981-2000) and future (2081-2100) SSP 585 experiment and for several climate models and one member. Daily data is used. In C4I, you can find all of the data needed in the CMIP6 project, at the **esgf-data3.ceda.ac.uk** and **esgf.nci.org.au** mirrors.\n",
"\n",
"### Preparation of the needed modules"
"### Preparation of the modules"
]
},
{
Expand Down Expand Up @@ -144,8 +149,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"### Specification of the parameters and period of interest\n",
"\n",
"### Parameters Setup \n",
"The time period of interest as well as the reference period are defined here.\n",
"A list of models is listed here as an example.\n",
"Here we used Monthly data (Amon) but daily data could also be used.\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,12 @@
"\n",
"Example notebook that runs icclim.\n",
"\n",
"The example calculates the percentage of days when Tmax > 90th percentile (TG90p indicator) for the dataset chosen by the user on C4I.\n",
"We assume to have the **tas** variable in netCDF files in a `./data` folder.\n",
"The data can be dowloaded using the [metalink](data/cmcc_gfdl_tas.metalink) provided with this notebook.\n",
"The example calculates the percentage of days when Tas > 90th percentile (TG90pindicator) for the dataset chosen by the user on C4I. \n",
"We assume to have the **tas** variable in netCDF files in a `./data` folder for model `CMCC` and for one member `r1i1p1f1`. \n",
"The data can be dowloaded using the [metalink](data/cmcc_tas.metalink) provided with this notebook.\n",
"The data described in a `.metalink` file can be dowloaded with tools such as [aria2](https://aria2.github.io/) or a browser plugin such as [DownThemAll!](https://addons.mozilla.org/en-US/firefox/addon/downthemall/)\n",
"If you wish to use a different dataset, you can use the [climate 4 impact portal](https://www.climate4impact.eu/c4i-frontend/) to search and select the data you wish to use and a metalink file to the [ESGF](https://esgf.llnl.gov/) data will be provided.\n",
"\n",
"\n",
"The data is read using xarray and a plot of the time series over a specific region is generated, as well as an average spatial map. Several output types examples are shown.\n",
"\n",
"The dataset that is expected for this notebook are tas parameter (needed to calculate the TG90p indicator) for one specific climate model and experiment as well as one member. The time period should be continuous.\n",
Expand Down Expand Up @@ -1195,7 +1194,7 @@
"# Quickly plot the data using xarray.plot()\n",
"tg90_two.plot(x=\"lon\", y=\"lat\", col=\"time\", col_wrap=1)\n",
"\n",
"plt.suptitle(\"Two Time Steps of TX90P\", y=1.03)\n",
"plt.suptitle(\"Two Time Steps of TG90P\", y=1.03)\n",
"plt.show()"
]
},
Expand Down Expand Up @@ -1240,7 +1239,7 @@
"\n",
"# Plot information\n",
"plt.suptitle(\n",
" \"Percentage of days when Tmax > 90th percentil Period 2081-2100 Reference 1981-2000 TX90P\",\n",
" \"Percentage of days when Tas > 90th percentil Period 2081-2100 Reference 1981-2000 TG90P\",\n",
" y=1,\n",
")\n",
"\n",
Expand All @@ -1250,7 +1249,7 @@
"ax.set_extent(extent)\n",
"\n",
"# Save plot as png\n",
"plt.savefig(\"c4i_tx90p_icclim.png\")"
"plt.savefig(\"c4i_tg90p_icclim.png\")"
]
},
{
Expand Down Expand Up @@ -1292,7 +1291,7 @@
"\n",
"# Plot information\n",
"plt.suptitle(\n",
" \"Percentage of days when tas > 90th percentile - Period 2081-2100 - Reference 1981-2000 - TX90P\",\n",
" \"Percentage of days when tas > 90th percentile - Period 2081-2100 - Reference 1981-2000 - TG90P\",\n",
" y=1,\n",
")\n",
"\n",
Expand All @@ -1302,7 +1301,7 @@
"ax.set_extent(extent)\n",
"\n",
"# Save plot as png\n",
"plt.savefig(\"c4i_tx90p_contours_icclim.png\")"
"plt.savefig(\"c4i_tg90p_contours_icclim.png\")"
]
}
],
Expand Down

0 comments on commit e855da0

Please sign in to comment.