From 7f78d0303cf98407038c82b77d9639df4759b845 Mon Sep 17 00:00:00 2001 From: Ana Ordonez Date: Fri, 9 Feb 2024 14:27:35 -0800 Subject: [PATCH 1/2] add toc --- .../Demo/Demo_9_seaIceExtent_ivanova.ipynb | 187 +++++++++++++----- 1 file changed, 143 insertions(+), 44 deletions(-) diff --git a/doc/jupyter/Demo/Demo_9_seaIceExtent_ivanova.ipynb b/doc/jupyter/Demo/Demo_9_seaIceExtent_ivanova.ipynb index 596ddd7db..01dac9188 100644 --- a/doc/jupyter/Demo/Demo_9_seaIceExtent_ivanova.ipynb +++ b/doc/jupyter/Demo/Demo_9_seaIceExtent_ivanova.ipynb @@ -50,18 +50,34 @@ "id": "848c69e5", "metadata": {}, "source": [ - "**Summary**\n", + "**Summary** \n", "The PCMDI Metrics Package (PMP) sea ice driver produces metrics that compare modeled and observed sea ice extent. This notebook demonstrates how to run the PMP sea ice code.\n", "\n", - "**Authors**\n", + "**Authors** \n", "Ana Ordonez, Jiwoo Lee, Paul Durack, Peter Gleckler ([PCMDI](https://pcmdi.llnl.gov/), [Lawrence Livermore National Laboratory](https://www.llnl.gov/))\n", "\n", - "**Reference**\n", + "**Reference** \n", "Ivanova, D. P., P. J. Gleckler, K. E. Taylor, P. J. Durack, and K. D. Marvel, 2016: Moving beyond the Total Sea Ice Extent in Gauging Model Biases. *J. Climate*, **29**, Pp 8965–8987, https://doi.org/10.1175/JCLI-D-16-0026.1.\n", "\n", - "**NOTES**\n", + "**Notes** \n", "The installation instructions for the PMP can be found [here](http://pcmdi.github.io/pcmdi_metrics/install.html).\n", - "The documentation for the sea ice metrics can be found [here](http://pcmdi.github.io/pcmdi_metrics/metrics_sea_ice.html)." + "The documentation for the sea ice metrics can be found [here](http://pcmdi.github.io/pcmdi_metrics/metrics_sea_ice.html).\n", + "\n", + "**Table of Contents**\n", + "\n", + "Note: Links to the sections work best when viewing this notebook via [nbviewer](https://nbviewer.org/github/PCMDI/pcmdi_metrics/blob/main/doc/jupyter/Demo/Demo_9_seaIceExtent_ivanova.ipynb).\n", + "- [1. Demo data](Demo_9_seaIceExtent_ivanova.ipynb#data)\n", + " * [1.1 Model output](Demo_9_seaIceExtent_ivanova.ipynb#mo)\n", + " * [1.2 Reference dataset](Demo_9_seaIceExtent_ivanova.ipynb#ref)\n", + "- [2. Sectors](Demo_9_seaIceExtent_ivanova.ipynb#sector)\n", + "- [3. Basic Example](Demo_9_seaIceExtent_ivanova.ipynb#basic)\n", + " * [3.1.1 Introducing the PMP parameter file](Demo_9_seaIceExtent_ivanova.ipynb#param)\n", + " * [3.1.2 Introducing the PMP driver file](Demo_9_seaIceExtent_ivanova.ipynb#driver)\n", + " * [3.1.2 Running the PMP sea ice demo](Demo_9_seaIceExtent_ivanova.ipynb#run)\n", + "- [4. Working with multiple realizations](Demo_9_seaIceExtent_ivanova.ipynb#multi)\n", + "- [5. Working with multiple models](Demo_9_seaIceExtent_ivanova.ipynb#mm)\n", + "- [6. Further exploration](Demo_9_seaIceExtent_ivanova.ipynb#further)\n", + " * [6.1 Debugging the LLNL Nimbus binder environment](Demo_9_seaIceExtent_ivanova.ipynb#debug)" ] }, { @@ -69,10 +85,10 @@ "id": "6bfd3b73", "metadata": {}, "source": [ - "## Demo data\n", + "## Demo data \n", "\n", "\n", - "### Model output\n", + "### Model output \n", "\n", "This demo uses three CMIP6 models. The Sea-Ice Area Percentage (Ocean Grid; 'siconc') and Grid-Cell Area for Ocean Variables ('areacello') variables are needed and can be found in the following directories. In addition, six other models are available that can be added to the analyses in this demo:\n", "```\n", @@ -138,7 +154,7 @@ "id": "00d48042", "metadata": {}, "source": [ - "### Reference dataset\n", + "### Reference dataset \n", "\n", "The observational dataset provided is the satellite derived sea ice concentration dataset from EUMETSAT OSI-SAF. More data information can be found at the [osi-450-a product page](https://osi-saf.eumetsat.int/products/osi-450-a). The path to this data is:\n", "```\n", @@ -180,12 +196,22 @@ "id": "0b854017", "metadata": {}, "source": [ - "## Sectors\n", + "## Sectors \n", "This code block produces maps that show the different regions used in the analysis along with the mean observed (OSI-SAF) sea ice concentration. The code to generate these figures can be found in the script [`sea_ice_sector_plots.py`](sea_ice_sector_plots.py).\n", "\n", "Below process will take about 30 seconds." ] }, + { + "cell_type": "markdown", + "id": "4b0a0555", + "metadata": {}, + "source": [ + "
\n", + "Go back to Top\n", + "
" + ] + }, { "cell_type": "code", "execution_count": 4, @@ -198,8 +224,8 @@ "text": [ "Creating Arctic map\n", "Creating Antarctic map\n", - "CPU times: user 9.07 ms, sys: 4.13 ms, total: 13.2 ms\n", - "Wall time: 32.3 s\n" + "CPU times: user 9.36 ms, sys: 5.53 ms, total: 14.9 ms\n", + "Wall time: 46.2 s\n" ] } ], @@ -252,7 +278,7 @@ "id": "5294910f", "metadata": {}, "source": [ - "## Basic example" + "## Basic example " ] }, { @@ -269,6 +295,16 @@ "Below process will take about 15 seconds." ] }, + { + "cell_type": "markdown", + "id": "5e99f724", + "metadata": {}, + "source": [ + "
\n", + "Go back to Top\n", + "
" + ] + }, { "cell_type": "code", "execution_count": 7, @@ -279,8 +315,8 @@ "name": "stdout", "output_type": "stream", "text": [ - "CPU times: user 5.24 ms, sys: 3.1 ms, total: 8.34 ms\n", - "Wall time: 23.5 s\n" + "CPU times: user 6.91 ms, sys: 2.07 ms, total: 8.99 ms\n", + "Wall time: 26.6 s\n" ] } ], @@ -322,7 +358,7 @@ "id": "404ed8d1", "metadata": {}, "source": [ - "## Introducing the PCMDI Metrics Package (PMP) parameter file" + "### Introducing the PCMDI Metrics Package (PMP) parameter file " ] }, { @@ -333,6 +369,16 @@ "The PMP drivers can all read user arguments from parameter files. We provide a demo parameter file, which is shown below. Comments (beginning with a '#') explain each of the parameters." ] }, + { + "cell_type": "markdown", + "id": "f7ebfa21", + "metadata": {}, + "source": [ + "
\n", + "Go back to Top\n", + "
" + ] + }, { "cell_type": "code", "execution_count": 9, @@ -437,7 +483,17 @@ "id": "dc0d0eeb", "metadata": {}, "source": [ - "## Introducing the PMP driver file" + "### Introducing the PMP driver file " + ] + }, + { + "cell_type": "markdown", + "id": "f71e219a", + "metadata": {}, + "source": [ + "
\n", + "Go back to Top\n", + "
" ] }, { @@ -565,7 +621,7 @@ "id": "9bfa9c97", "metadata": {}, "source": [ - "## Running the PMP sea ice demo\n", + "### Running the PMP sea ice demo \n", "The PMP drivers are run on the command line. In this Jupyter Notebook, we use the bash cell magic function %%bash to run command line functions from the notebook.\n", "\n", "The PMP sea ice metrics driver call follows the basic format:\n", @@ -576,6 +632,16 @@ "Below process will take about 3 minutes." ] }, + { + "cell_type": "markdown", + "id": "a137d3c3", + "metadata": {}, + "source": [ + "
\n", + "Go back to Top\n", + "
" + ] + }, { "cell_type": "code", "execution_count": 11, @@ -586,9 +652,9 @@ "name": "stderr", "output_type": "stream", "text": [ - "INFO::2024-02-02 13:53::pcmdi_metrics:: Results saved to a json file: /home/ordonez4/git/pcmdi_metrics/doc/jupyter/Demo/sea_ice_demo/ex1/sea_ice_metrics.json\n", - "2024-02-02 13:53:40,272 [INFO]: base.py(write:251) >> Results saved to a json file: /home/ordonez4/git/pcmdi_metrics/doc/jupyter/Demo/sea_ice_demo/ex1/sea_ice_metrics.json\n", - "2024-02-02 13:53:40,272 [INFO]: base.py(write:251) >> Results saved to a json file: /home/ordonez4/git/pcmdi_metrics/doc/jupyter/Demo/sea_ice_demo/ex1/sea_ice_metrics.json\n" + "INFO::2024-02-09 13:59::pcmdi_metrics:: Results saved to a json file: /home/ordonez4/git/pcmdi_metrics/doc/jupyter/Demo/sea_ice_demo/ex1/sea_ice_metrics.json\n", + "2024-02-09 13:59:50,809 [INFO]: base.py(write:251) >> Results saved to a json file: /home/ordonez4/git/pcmdi_metrics/doc/jupyter/Demo/sea_ice_demo/ex1/sea_ice_metrics.json\n", + "2024-02-09 13:59:50,809 [INFO]: base.py(write:251) >> Results saved to a json file: /home/ordonez4/git/pcmdi_metrics/doc/jupyter/Demo/sea_ice_demo/ex1/sea_ice_metrics.json\n" ] }, { @@ -639,8 +705,8 @@ "sp\n", "sa\n", "io\n", - "CPU times: user 32.6 ms, sys: 12.9 ms, total: 45.4 ms\n", - "Wall time: 2min 1s\n" + "CPU times: user 32.4 ms, sys: 22.3 ms, total: 54.7 ms\n", + "Wall time: 2min 24s\n" ] } ], @@ -897,7 +963,7 @@ " \"Version\": \"23.1.0\",\n", " \"buildVersion\": \"not installed\"\n", " },\n", - " \"date\": \"2024-02-02 13:53:25\",\n", + " \"date\": \"2024-02-09 13:59:32\",\n", " \"openGL\": {\n", " \"GLX\": {\n", " \"client\": {},\n", @@ -996,7 +1062,7 @@ "id": "a9b323ec", "metadata": {}, "source": [ - "## Working with multiple realizations" + "## Working with multiple realizations " ] }, { @@ -1011,6 +1077,16 @@ "Below process will take about 5 minutes." ] }, + { + "cell_type": "markdown", + "id": "d83f2294", + "metadata": {}, + "source": [ + "
\n", + "Go back to Top\n", + "
" + ] + }, { "cell_type": "code", "execution_count": 15, @@ -1108,9 +1184,9 @@ "name": "stderr", "output_type": "stream", "text": [ - "INFO::2024-02-02 13:58::pcmdi_metrics:: Results saved to a json file: /home/ordonez4/git/pcmdi_metrics/doc/jupyter/Demo/sea_ice_demo/ex2/sea_ice_metrics.json\n", - "2024-02-02 13:58:50,574 [INFO]: base.py(write:251) >> Results saved to a json file: /home/ordonez4/git/pcmdi_metrics/doc/jupyter/Demo/sea_ice_demo/ex2/sea_ice_metrics.json\n", - "2024-02-02 13:58:50,574 [INFO]: base.py(write:251) >> Results saved to a json file: /home/ordonez4/git/pcmdi_metrics/doc/jupyter/Demo/sea_ice_demo/ex2/sea_ice_metrics.json\n" + "INFO::2024-02-09 14:05::pcmdi_metrics:: Results saved to a json file: /home/ordonez4/git/pcmdi_metrics/doc/jupyter/Demo/sea_ice_demo/ex2/sea_ice_metrics.json\n", + "2024-02-09 14:05:15,105 [INFO]: base.py(write:251) >> Results saved to a json file: /home/ordonez4/git/pcmdi_metrics/doc/jupyter/Demo/sea_ice_demo/ex2/sea_ice_metrics.json\n", + "2024-02-09 14:05:15,105 [INFO]: base.py(write:251) >> Results saved to a json file: /home/ordonez4/git/pcmdi_metrics/doc/jupyter/Demo/sea_ice_demo/ex2/sea_ice_metrics.json\n" ] }, { @@ -1149,8 +1225,8 @@ "sp\n", "sa\n", "io\n", - "CPU times: user 65.7 ms, sys: 24.6 ms, total: 90.3 ms\n", - "Wall time: 5min 10s\n" + "CPU times: user 79.4 ms, sys: 27.2 ms, total: 107 ms\n", + "Wall time: 5min 26s\n" ] } ], @@ -1192,7 +1268,7 @@ "id": "499d3935", "metadata": {}, "source": [ - "## Working with multiple models" + "## Working with multiple models " ] }, { @@ -1209,19 +1285,22 @@ "Below process will take about 10 minutes." ] }, + { + "cell_type": "markdown", + "id": "34943f08", + "metadata": {}, + "source": [ + "
\n", + "Go back to Top\n", + "
" + ] + }, { "cell_type": "code", "execution_count": 17, "id": "679d7289", "metadata": {}, "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "bash: line 1: fg: no job control\n" - ] - }, { "name": "stdout", "output_type": "stream", @@ -1336,9 +1415,9 @@ "name": "stderr", "output_type": "stream", "text": [ - "INFO::2024-02-02 14:09::pcmdi_metrics:: Results saved to a json file: /home/ordonez4/git/pcmdi_metrics/doc/jupyter/Demo/sea_ice_demo/ex3/sea_ice_metrics.json\n", - "2024-02-02 14:09:12,697 [INFO]: base.py(write:251) >> Results saved to a json file: /home/ordonez4/git/pcmdi_metrics/doc/jupyter/Demo/sea_ice_demo/ex3/sea_ice_metrics.json\n", - "2024-02-02 14:09:12,697 [INFO]: base.py(write:251) >> Results saved to a json file: /home/ordonez4/git/pcmdi_metrics/doc/jupyter/Demo/sea_ice_demo/ex3/sea_ice_metrics.json\n" + "INFO::2024-02-09 14:14::pcmdi_metrics:: Results saved to a json file: /home/ordonez4/git/pcmdi_metrics/doc/jupyter/Demo/sea_ice_demo/ex3/sea_ice_metrics.json\n", + "2024-02-09 14:14:50,757 [INFO]: base.py(write:251) >> Results saved to a json file: /home/ordonez4/git/pcmdi_metrics/doc/jupyter/Demo/sea_ice_demo/ex3/sea_ice_metrics.json\n", + "2024-02-09 14:14:50,757 [INFO]: base.py(write:251) >> Results saved to a json file: /home/ordonez4/git/pcmdi_metrics/doc/jupyter/Demo/sea_ice_demo/ex3/sea_ice_metrics.json\n" ] }, { @@ -1435,7 +1514,9 @@ "antarctic\n", "sp\n", "sa\n", - "io\n" + "io\n", + "CPU times: user 148 ms, sys: 39.5 ms, total: 188 ms\n", + "Wall time: 9min 34s\n" ] } ], @@ -2697,7 +2778,7 @@ " \"Version\": \"23.1.0\",\n", " \"buildVersion\": \"not installed\"\n", " },\n", - " \"date\": \"2024-02-02 14:08:57\",\n", + " \"date\": \"2024-02-09 14:14:34\",\n", " \"openGL\": {\n", " \"GLX\": {\n", " \"client\": {},\n", @@ -2778,7 +2859,7 @@ "id": "bc43281a", "metadata": {}, "source": [ - "## Further exploration" + "## Further exploration " ] }, { @@ -2815,7 +2896,7 @@ "id": "f1161f29", "metadata": {}, "source": [ - "## Debugging the LLNL Nimbus binder environment" + "## Debugging the LLNL Nimbus binder environment " ] }, { @@ -2837,6 +2918,24 @@ "\n", "Once you refresh the start page ([https://binder-nimbus.llnl.gov](https://binder-nimbus.llnl.gov)), login and start again, it should work as expected" ] + }, + { + "cell_type": "markdown", + "id": "84a123eb", + "metadata": {}, + "source": [ + "
\n", + "Go back to Top\n", + "
" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "e3b50c5e", + "metadata": {}, + "outputs": [], + "source": [] } ], "metadata": { From aca3a772e39a0e882fc5de1f76c0bd8f27a40067 Mon Sep 17 00:00:00 2001 From: Ana Ordonez Date: Fri, 9 Feb 2024 14:44:43 -0800 Subject: [PATCH 2/2] add index --- .../Demo/Demo_9_seaIceExtent_ivanova.ipynb | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/doc/jupyter/Demo/Demo_9_seaIceExtent_ivanova.ipynb b/doc/jupyter/Demo/Demo_9_seaIceExtent_ivanova.ipynb index 01dac9188..6c267c460 100644 --- a/doc/jupyter/Demo/Demo_9_seaIceExtent_ivanova.ipynb +++ b/doc/jupyter/Demo/Demo_9_seaIceExtent_ivanova.ipynb @@ -77,7 +77,7 @@ "- [4. Working with multiple realizations](Demo_9_seaIceExtent_ivanova.ipynb#multi)\n", "- [5. Working with multiple models](Demo_9_seaIceExtent_ivanova.ipynb#mm)\n", "- [6. Further exploration](Demo_9_seaIceExtent_ivanova.ipynb#further)\n", - " * [6.1 Debugging the LLNL Nimbus binder environment](Demo_9_seaIceExtent_ivanova.ipynb#debug)" + "- [7. Debugging the LLNL Nimbus binder environment](Demo_9_seaIceExtent_ivanova.ipynb#debug)" ] }, { @@ -85,10 +85,10 @@ "id": "6bfd3b73", "metadata": {}, "source": [ - "## Demo data \n", + "## 1. Demo data \n", "\n", "\n", - "### Model output \n", + "### 1.1 Model output \n", "\n", "This demo uses three CMIP6 models. The Sea-Ice Area Percentage (Ocean Grid; 'siconc') and Grid-Cell Area for Ocean Variables ('areacello') variables are needed and can be found in the following directories. In addition, six other models are available that can be added to the analyses in this demo:\n", "```\n", @@ -154,7 +154,7 @@ "id": "00d48042", "metadata": {}, "source": [ - "### Reference dataset \n", + "### 1.2 Reference dataset \n", "\n", "The observational dataset provided is the satellite derived sea ice concentration dataset from EUMETSAT OSI-SAF. More data information can be found at the [osi-450-a product page](https://osi-saf.eumetsat.int/products/osi-450-a). The path to this data is:\n", "```\n", @@ -196,7 +196,7 @@ "id": "0b854017", "metadata": {}, "source": [ - "## Sectors \n", + "## 2. Sectors \n", "This code block produces maps that show the different regions used in the analysis along with the mean observed (OSI-SAF) sea ice concentration. The code to generate these figures can be found in the script [`sea_ice_sector_plots.py`](sea_ice_sector_plots.py).\n", "\n", "Below process will take about 30 seconds." @@ -278,7 +278,7 @@ "id": "5294910f", "metadata": {}, "source": [ - "## Basic example " + "## 3. Basic example " ] }, { @@ -358,7 +358,7 @@ "id": "404ed8d1", "metadata": {}, "source": [ - "### Introducing the PCMDI Metrics Package (PMP) parameter file " + "### 3.1 Introducing the PCMDI Metrics Package (PMP) parameter file " ] }, { @@ -483,7 +483,7 @@ "id": "dc0d0eeb", "metadata": {}, "source": [ - "### Introducing the PMP driver file " + "### 3.2 Introducing the PMP driver file " ] }, { @@ -621,7 +621,7 @@ "id": "9bfa9c97", "metadata": {}, "source": [ - "### Running the PMP sea ice demo \n", + "### 3.3 Running the PMP sea ice demo \n", "The PMP drivers are run on the command line. In this Jupyter Notebook, we use the bash cell magic function %%bash to run command line functions from the notebook.\n", "\n", "The PMP sea ice metrics driver call follows the basic format:\n", @@ -1062,7 +1062,7 @@ "id": "a9b323ec", "metadata": {}, "source": [ - "## Working with multiple realizations " + "## 4. Working with multiple realizations " ] }, { @@ -1268,7 +1268,7 @@ "id": "499d3935", "metadata": {}, "source": [ - "## Working with multiple models " + "## 5. Working with multiple models " ] }, { @@ -2859,7 +2859,7 @@ "id": "bc43281a", "metadata": {}, "source": [ - "## Further exploration " + "## 6. Further exploration " ] }, { @@ -2896,7 +2896,7 @@ "id": "f1161f29", "metadata": {}, "source": [ - "## Debugging the LLNL Nimbus binder environment " + "## 7. Debugging the LLNL Nimbus binder environment " ] }, {