From 0de38cd7553baf8032b2a1a14f29bc876de8cdf1 Mon Sep 17 00:00:00 2001 From: Ana Ordonez Date: Thu, 4 Nov 2021 14:12:29 -0700 Subject: [PATCH] update demo text file path --- doc/jupyter/Demo/Demo_6_ENSO.ipynb | 42 +++++++++++++++++++++++++++--- 1 file changed, 38 insertions(+), 4 deletions(-) diff --git a/doc/jupyter/Demo/Demo_6_ENSO.ipynb b/doc/jupyter/Demo/Demo_6_ENSO.ipynb index b987c9a2c..6c1ad6db2 100644 --- a/doc/jupyter/Demo/Demo_6_ENSO.ipynb +++ b/doc/jupyter/Demo/Demo_6_ENSO.ipynb @@ -2,6 +2,7 @@ "cells": [ { "cell_type": "markdown", + "id": "af662faf", "metadata": {}, "source": [ "# ENSO" @@ -9,6 +10,7 @@ }, { "cell_type": "markdown", + "id": "161973d0", "metadata": {}, "source": [ "This notebook provides an overview of running the ENSO metrics. More information can be found in the [README]( ). Example parameter files are located in the [PMP sample setups]( ). \n", @@ -28,6 +30,7 @@ }, { "cell_type": "markdown", + "id": "fc758afb", "metadata": {}, "source": [ "## Download demo data" @@ -35,6 +38,7 @@ }, { "cell_type": "markdown", + "id": "fc164e01", "metadata": {}, "source": [ "The ENSO metric requires a different set of sample data than the rest of the PMP metrics. This section of the notebook will download that data to your chosen location and generate a basic parameter file." @@ -43,19 +47,20 @@ { "cell_type": "code", "execution_count": 1, + "id": "ea19cd07", "metadata": {}, "outputs": [], "source": [ "# Lets get the file containing the data needed for this demo\n", "import requests\n", - "#r = requests.get(\"https://pcmdiweb.llnl.gov/pss/pmpdata/pmp_enso_tutorial_files.txt\")\n", - "r = requests.get(\"https://pcmdiweb.llnl.gov/pss/pmpdata/pmp_enso_tutorial_files.v20210823.txt\")\n", + "r = requests.get(\"https://pcmdiweb.llnl.gov/pss/pmpdata/pmp_enso_tutorial_files.txt\")\n", "with open(\"enso_data_files.txt\",\"wb\") as f:\n", " f.write(r.content)" ] }, { "cell_type": "markdown", + "id": "0bb7a8bb", "metadata": {}, "source": [ "If you want to change the location where the demo data and output are stored, you can do so here:" @@ -64,6 +69,7 @@ { "cell_type": "code", "execution_count": 2, + "id": "b800cfe7", "metadata": {}, "outputs": [], "source": [ @@ -75,6 +81,7 @@ }, { "cell_type": "markdown", + "id": "e0880b21", "metadata": {}, "source": [ "Then download the data. The total sample data size is 10.8 GB. This will take several minutes." @@ -83,6 +90,7 @@ { "cell_type": "code", "execution_count": 3, + "id": "2f8e10ad", "metadata": {}, "outputs": [ { @@ -105,6 +113,7 @@ }, { "cell_type": "markdown", + "id": "13785525", "metadata": {}, "source": [ "After downloading the data, we generate the parameter file for this demo." @@ -113,6 +122,7 @@ { "cell_type": "code", "execution_count": 4, + "id": "38fc987f", "metadata": {}, "outputs": [ { @@ -132,6 +142,7 @@ }, { "cell_type": "markdown", + "id": "548d309b", "metadata": {}, "source": [ "## Environment" @@ -139,6 +150,7 @@ }, { "cell_type": "markdown", + "id": "aec1bda9", "metadata": {}, "source": [ "[ENSO Metrics package](https://github.com/CLIVAR-PRP/ENSO_metrics) and [scipy](https://www.scipy.org/) installations are needed. This section will clone the ENSO Metrics repository and *install ENSO Metrics and scipy in your current conda environment*. Set the `enso_install_location` below to chose where to clone the ENSO Metrics repository." @@ -147,6 +159,7 @@ { "cell_type": "code", "execution_count": 5, + "id": "23984aa1", "metadata": {}, "outputs": [], "source": [ @@ -155,6 +168,7 @@ }, { "cell_type": "markdown", + "id": "bf3f25eb", "metadata": {}, "source": [ "To clone and install the ENSO Metrics package, un-comment the next cell and run it (delete quotes in lines 1 & 6)." @@ -163,6 +177,7 @@ { "cell_type": "code", "execution_count": 6, + "id": "3e2ceb0e", "metadata": { "scrolled": true }, @@ -190,6 +205,7 @@ }, { "cell_type": "markdown", + "id": "f24b3f95", "metadata": {}, "source": [ "To install scipy, un-comment the next cell and run it (delete quotes in lines 1 & 3)." @@ -198,6 +214,7 @@ { "cell_type": "code", "execution_count": 7, + "id": "4d1204d1", "metadata": {}, "outputs": [ { @@ -219,6 +236,7 @@ }, { "cell_type": "markdown", + "id": "6dbcc822", "metadata": {}, "source": [ "## Usage" @@ -226,6 +244,7 @@ }, { "cell_type": "markdown", + "id": "9a337b51", "metadata": {}, "source": [ "The ENSO driver can be run from the command line as `enso_driver.py`. In this notebook, we will use bash cell magic (cells beginning with `%%bash`) to run the ENSO driver as a subprocess." @@ -233,6 +252,7 @@ }, { "cell_type": "markdown", + "id": "c92bfab3", "metadata": {}, "source": [ "For help, type: \n", @@ -244,6 +264,7 @@ { "cell_type": "code", "execution_count": 8, + "id": "1c1abe78", "metadata": {}, "outputs": [ { @@ -328,6 +349,7 @@ }, { "cell_type": "markdown", + "id": "160b96e1", "metadata": {}, "source": [ "### Basic example" @@ -335,6 +357,7 @@ }, { "cell_type": "markdown", + "id": "3380307d", "metadata": {}, "source": [ "Parameters for the ENSO Metrics can be set on the command line or using a parameter file. This first example will use a parameter file, which is shown below." @@ -343,6 +366,7 @@ { "cell_type": "code", "execution_count": 9, + "id": "49a4ac2c", "metadata": {}, "outputs": [ { @@ -390,6 +414,7 @@ }, { "cell_type": "markdown", + "id": "19002649", "metadata": {}, "source": [ "The next cell runs the ENSO driver using the basic parameter file. This may take several minutes." @@ -398,6 +423,7 @@ { "cell_type": "code", "execution_count": 10, + "id": "334a0272", "metadata": {}, "outputs": [ { @@ -683,6 +709,7 @@ }, { "cell_type": "markdown", + "id": "46ff9996", "metadata": {}, "source": [ "This run saved metrics to two files: \n", @@ -696,6 +723,7 @@ { "cell_type": "code", "execution_count": 11, + "id": "511a1809", "metadata": {}, "outputs": [ { @@ -1091,6 +1119,7 @@ }, { "cell_type": "markdown", + "id": "52d29412", "metadata": {}, "source": [ "### ENSO Metrics Collections\n", @@ -1108,6 +1137,7 @@ { "cell_type": "code", "execution_count": 12, + "id": "6629c5d8", "metadata": {}, "outputs": [ { @@ -1358,6 +1388,7 @@ }, { "cell_type": "markdown", + "id": "22b4008b", "metadata": {}, "source": [ "All of the results (netCDF and JSON) are located in the output directory, which uses the metrics collection name." @@ -1366,6 +1397,7 @@ { "cell_type": "code", "execution_count": 13, + "id": "f963d430", "metadata": {}, "outputs": [ { @@ -1388,6 +1420,7 @@ }, { "cell_type": "markdown", + "id": "c48822c8", "metadata": {}, "source": [ "Finally, this example runs the remaining metrics collection ENSO_proc:" @@ -1396,6 +1429,7 @@ { "cell_type": "code", "execution_count": 14, + "id": "71ad2751", "metadata": {}, "outputs": [ { @@ -1842,7 +1876,7 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3", + "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, @@ -1856,7 +1890,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.8.6" + "version": "3.9.7" } }, "nbformat": 4,