From 82dee78f81e59355cbc008145d4cce28241e3a61 Mon Sep 17 00:00:00 2001 From: Robert Gieseke Date: Tue, 27 Feb 2024 13:14:56 +0100 Subject: [PATCH] Doc and code tweaks --- README.rst | 12 +++++------- docs/pyhector.rst | 2 +- docs/usage.rst | 2 +- scripts/plot_example.py | 6 +++--- 4 files changed, 10 insertions(+), 12 deletions(-) diff --git a/README.rst b/README.rst index 942b790..93d97f4 100644 --- a/README.rst +++ b/README.rst @@ -114,16 +114,14 @@ Advanced example .. code:: python import pyhector - from pyhector import rcp26, rcp45, rcp60, rcp85 - import matplotlib.pyplot as plt + from pyhector import ssp119, ssp126, ssp245, ssp370, ssp434, ssp460, ssp534_over, ssp585 - for rcp in [rcp26, rcp45, rcp60, rcp85]: - output = pyhector.run(rcp, {"core": {"endDate": 2100}}) - temp = output["temperature.Tgav"] - # Adjust to 1850 - 1900 reference period + for ssp in [ssp119, ssp126, ssp245, ssp370, ssp434, ssp460, ssp534_over, ssp585]: + output = pyhector.run(ssp, {"core": {"endDate": 2100}}) + temp = output["temperature.global_tas"] temp = temp.loc[1850:] - temp.loc[1850:1900].mean() - temp.plot(label=rcp.name.split("_")[0]) + temp.plot(label=ssp.name) plt.title("Global mean temperature") plt.ylabel("°C over pre-industrial (1850-1900 mean)") plt.legend(loc="best") diff --git a/docs/pyhector.rst b/docs/pyhector.rst index 574da11..b4d32f1 100644 --- a/docs/pyhector.rst +++ b/docs/pyhector.rst @@ -15,7 +15,7 @@ pyhector.default_config ----------------------- A dictionary with Hector's default configuration parameters. -See also `the original config file on GitHub `_. +See also `the original config file on GitHub `_. In **pyhector** this INI-file is represented as a dictionary. diff --git a/docs/usage.rst b/docs/usage.rst index 54d4a0a..829b345 100644 --- a/docs/usage.rst +++ b/docs/usage.rst @@ -3,7 +3,7 @@ :end-before: image-start .. image:: example-plot.png - :alt: Temperature Plot of RCP scenarios + :alt: Temperature Plot of SSP scenarios .. include:: ../README.rst :start-after: image-end diff --git a/scripts/plot_example.py b/scripts/plot_example.py index 9ce8e7f..0701e1b 100644 --- a/scripts/plot_example.py +++ b/scripts/plot_example.py @@ -13,11 +13,11 @@ path = os.path.join(os.path.dirname(__file__), "../docs/example-plot.png") -for rcp in [ssp119, ssp126, ssp245, ssp370, ssp434, ssp460, ssp534_over, ssp585]: - output = pyhector.run(rcp, {"core": {"endDate": 2100}}) +for ssp in [ssp119, ssp126, ssp245, ssp370, ssp434, ssp460, ssp534_over, ssp585]: + output = pyhector.run(ssp, {"core": {"endDate": 2100}}) temp = output["temperature.global_tas"] temp = temp.loc[1850:] - temp.loc[1850:1900].mean() - temp.plot(label=rcp.name.split("_")[0]) + temp.plot(label=ssp.name) plt.title("Global mean temperature") plt.ylabel("°C over pre-industrial (1850-1900 mean)") plt.legend(loc="best")