Skip to content

Commit

Permalink
Merge pull request #261 from mnlevy1981/update-cupid-task
Browse files Browse the repository at this point in the history
Add instructions for running nmse_PSL.ipynb
  • Loading branch information
nusbaume authored Aug 9, 2024
2 parents de2b3a7 + a61ee74 commit bff1d47
Showing 1 changed file with 74 additions and 18 deletions.
92 changes: 74 additions & 18 deletions notebooks/diagnostics/cupid.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@
" #from each component.\n",
"\n",
" atm:\n",
" vars: ['TREFHT']\n",
" vars: ['PSL']\n",
" derive_vars: []\n",
" hist_str: 'h0'\n",
" start_years: [1]\n",
Expand Down Expand Up @@ -253,7 +253,29 @@
" end_years: [3]\n",
" level: 'lev'\n",
"\n",
"#IGNORE EVERYTHING BELOW THIS LINE!\n",
"compute_notebooks:\n",
"\n",
" # This is where all the notebooks you want run and their\n",
" # parameters are specified. Several examples of different\n",
" # types of notebooks are provided.\n",
"\n",
" # The first key (here infrastructure) is the name of the\n",
" # notebook from nb_path_root, minus the .ipynb\n",
"\n",
" infrastructure:\n",
" index:\n",
" parameter_groups:\n",
" none: {}\n",
"\n",
" atm:\n",
" nmse_PSL:\n",
" parameter_groups:\n",
" none:\n",
" validation_path: '/glade/campaign/cesm/development/cross-wg/diagnostic_framework/nmse_validation/fv1.9x2.5'\n",
" start_date: '0001-01-01'\n",
" end_date: '0004-01-01'\n",
" regridded_output: False\n",
"\n",
"\n",
"########### JUPYTER BOOK CONFIG ###########\n",
"\n",
Expand All @@ -274,21 +296,13 @@
"\n",
" # Parts group notebooks into different sections in the Jupyter book\n",
" # table of contents, so you can organize different parts of your project.\n",
" # Each chapter is the name of one of the notebooks that you executed\n",
" # in compute_notebooks above, also without .ipynb\n",
"\n",
"# - caption: Atmosphere\n",
" - caption: Atmosphere\n",
" chapters:\n",
" - file: atm/nmse_PSL\n",
"\n",
" # Each chapter is the name of one of the notebooks that you executed\n",
" # in compute_notebooks above, also without .ipynb\n",
"# chapters:\n",
"# - file: atm/adf_quick_run\n",
"\n",
"# - caption: Land\n",
"# chapters:\n",
"# - file: lnd/land_comparison\n",
"\n",
"# - caption: Sea Ice\n",
"# chapters:\n",
"# - file: ice/seaice\n",
"\n",
"#####################################\n",
"# Keys for Jupyter Book _config.yml #\n",
Expand All @@ -315,7 +329,7 @@
"id": "27ed4c0c-f6ee-48a2-b264-2a2e58744f82",
"metadata": {},
"source": [
"## Generating time series"
"## Generating time series and Computing NMSE diagnostic"
]
},
{
Expand All @@ -334,7 +348,7 @@
"outputs": [],
"source": [
"module load nco #Currently the NetCDF Operators are needed by CUPiD in order to run the time series generator\n",
"cupid-run -ts"
"cupid-run --time-series"
]
},
{
Expand Down Expand Up @@ -384,13 +398,55 @@
"What is different?"
]
},
{
"cell_type": "markdown",
"id": "47b2e3aa",
"metadata": {},
"source": [
"## Looking at Diagnostics\n",
"\n",
"Besides creating time series data sets, the `cupid-run` command also ran the `examples/nblibrary/atm/nmse_PSL.ipynb` notebook with parameters set in `config.yml`.\n",
"The notebooks in `examples/nblibrary/atm/` are templates, but the completed notebook is in `examples/key_metrics/computed_notebooks/key_metrics/atm/nmse_PSL.ipynb`.\n",
"You can open this notebook directly via JupyterHub, or CUPiD can use Jupyter Book to create a webpage:"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "e1b5db8c-4890-46b3-8b5c-c095e75bcd18",
"metadata": {},
"outputs": [],
"source": []
"source": [
"cupid-build"
]
},
{
"cell_type": "markdown",
"id": "83a7bfc3",
"metadata": {},
"source": [
"When this command finishes running, you will have a new directory: `examples/key_metrics/computed_notebooks/key_metrics/_build/html/`.\n",
"The easiest way to view these files is to look at them via JupyterHub, although its HTML parsing is not the best.\n",
"You could also run firefox from casper (note that the browser is not installed on derecho!):"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "f686e7e6",
"metadata": {},
"outputs": [],
"source": [
"firefox &"
]
},
{
"cell_type": "markdown",
"id": "c3679cad",
"metadata": {},
"source": [
"and then point your browser to `examples/key_metrics/computed_notebooks/key_metrics/_build/html/index.html`, or copy the entire `html/` directory to your laptop."
]
}
],
"metadata": {
Expand Down

0 comments on commit bff1d47

Please sign in to comment.