Skip to content

Commit

Permalink
Fix Merge (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
cyschneck authored Jul 26, 2024
1 parent 2da73b8 commit 136069e
Show file tree
Hide file tree
Showing 5 changed files with 104 additions and 174 deletions.
2 changes: 1 addition & 1 deletion _toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ parts:
- caption: Example Workflows
chapters:
- file: notebooks/example-workflows/jingle-bells
- file: notebooks/example-workflows/spy-sounds
- file: notebooks/example-workflows/spy-keypad
- file: notebooks/example-workflows/nino3
11 changes: 10 additions & 1 deletion notebooks/example-workflows/jingle-bells.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"<img src=\"images/ProjectPythia_Logo_Final-01-Blue.svg\" width=250 alt=\"Project Pythia Logo\"></img>"
"[IMAGE]"
]
},
{
Expand Down Expand Up @@ -66,6 +66,13 @@
"---"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Background"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand All @@ -76,6 +83,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -102,6 +110,7 @@
"metadata": {},
"source": [
"### Input Values\n",
"- data: input data as a array_like\n",
"- scales: array_like collection of the scales to use (np.arange(s0, jtot, dj))\n",
"- wavelet: name of Mother wavelet\n",
"- sampling_period: optional sampling period for frequencies output"
Expand Down
145 changes: 59 additions & 86 deletions notebooks/example-workflows/nino3.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Weekly Sea Surface Temperature Patterns from NOAA\n",
"<p align=\"center\">\n",
" <img src=\"https://www.climate.gov/sites/default/files/2023-06/ENSOblog_animation_SSTA_anom_weekly_2023_Jun.gif\" alt=\"Weekly Sea Surface Temperature Patterns from NOAA\" />\n",
"</p>"
Expand Down Expand Up @@ -89,7 +90,7 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 12,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -116,27 +117,62 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 13,
"metadata": {},
"outputs": [
{
"ename": "ValueError",
"evalue": "did not find a match in any of xarray's currently installed IO backends ['scipy']. Consider explicitly selecting one of the installed engines via the ``engine`` parameter, or installing additional IO dependencies, see:\nhttps://docs.xarray.dev/en/stable/getting-started-guide/installing.html\nhttps://docs.xarray.dev/en/stable/user-guide/io.html",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mValueError\u001b[0m Traceback (most recent call last)",
"Cell \u001b[0;32mIn[7], line 3\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[38;5;66;03m#nino_url = 'https://paos.colorado.edu/research/wavelets/wave_idl/nino3sst.txt'\u001b[39;00m\n\u001b[1;32m 2\u001b[0m \u001b[38;5;66;03m#nino3_data = np.genfromtxt(nino_url, skip_header=19)\u001b[39;00m\n\u001b[0;32m----> 3\u001b[0m nino3_data \u001b[38;5;241m=\u001b[39m xr\u001b[38;5;241m.\u001b[39mopen_dataset(gcd\u001b[38;5;241m.\u001b[39mget(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mascii_files/sst_nino3.dat\u001b[39m\u001b[38;5;124m'\u001b[39m))\n\u001b[1;32m 4\u001b[0m \u001b[38;5;28mprint\u001b[39m(nino3_data)\n",
"File \u001b[0;32m~/miniconda3/envs/wavelet_tutorial/lib/python3.11/site-packages/xarray/backends/api.py:552\u001b[0m, in \u001b[0;36mopen_dataset\u001b[0;34m(filename_or_obj, engine, chunks, cache, decode_cf, mask_and_scale, decode_times, decode_timedelta, use_cftime, concat_characters, decode_coords, drop_variables, inline_array, chunked_array_type, from_array_kwargs, backend_kwargs, **kwargs)\u001b[0m\n\u001b[1;32m 549\u001b[0m kwargs\u001b[38;5;241m.\u001b[39mupdate(backend_kwargs)\n\u001b[1;32m 551\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m engine \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[0;32m--> 552\u001b[0m engine \u001b[38;5;241m=\u001b[39m plugins\u001b[38;5;241m.\u001b[39mguess_engine(filename_or_obj)\n\u001b[1;32m 554\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m from_array_kwargs \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[1;32m 555\u001b[0m from_array_kwargs \u001b[38;5;241m=\u001b[39m {}\n",
"File \u001b[0;32m~/miniconda3/envs/wavelet_tutorial/lib/python3.11/site-packages/xarray/backends/plugins.py:197\u001b[0m, in \u001b[0;36mguess_engine\u001b[0;34m(store_spec)\u001b[0m\n\u001b[1;32m 189\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[1;32m 190\u001b[0m error_msg \u001b[38;5;241m=\u001b[39m (\n\u001b[1;32m 191\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mfound the following matches with the input file in xarray\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124ms IO \u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 192\u001b[0m \u001b[38;5;124mf\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mbackends: \u001b[39m\u001b[38;5;132;01m{\u001b[39;00mcompatible_engines\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m. But their dependencies may not be installed, see:\u001b[39m\u001b[38;5;130;01m\\n\u001b[39;00m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 193\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mhttps://docs.xarray.dev/en/stable/user-guide/io.html \u001b[39m\u001b[38;5;130;01m\\n\u001b[39;00m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 194\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mhttps://docs.xarray.dev/en/stable/getting-started-guide/installing.html\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 195\u001b[0m )\n\u001b[0;32m--> 197\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mValueError\u001b[39;00m(error_msg)\n",
"\u001b[0;31mValueError\u001b[0m: did not find a match in any of xarray's currently installed IO backends ['scipy']. Consider explicitly selecting one of the installed engines via the ``engine`` parameter, or installing additional IO dependencies, see:\nhttps://docs.xarray.dev/en/stable/getting-started-guide/installing.html\nhttps://docs.xarray.dev/en/stable/user-guide/io.html"
"name": "stdout",
"output_type": "stream",
"text": [
"[-0.15 -0.3 -0.14 -0.41 -0.46 -0.66 -0.5 -0.8 -0.95 -0.72 -0.31 -0.71\n",
" -1.04 -0.77 -0.86 -0.84 -0.41 -0.49 -0.48 -0.72 -1.21 -0.8 0.16 0.46\n",
" 0.4 1. 2.17 2.5 2.34 0.8 0.14 -0.06 -0.34 -0.71 -0.34 -0.73\n",
" -0.48 -0.11 0.22 0.51 0.51 0.25 -0.1 -0.33 -0.42 -0.23 -0.53 -0.44\n",
" -0.3 0.15 0.09 0.19 -0.06 0.25 0.3 0.81 0.26 0.1 0.34 1.01\n",
" -0.31 -0.9 -0.73 -0.92 -0.73 -0.31 -0.03 0.12 0.37 0.82 1.22 1.83\n",
" 1.6 0.34 -0.72 -0.87 -0.85 -0.4 -0.39 -0.65 0.07 0.67 0.39 0.03\n",
" -0.17 -0.76 -0.87 -1.36 -1.1 -0.99 -0.78 -0.93 -0.87 -0.44 -0.34 -0.5\n",
" -0.39 -0.04 0.42 0.62 0.17 0.23 1.03 1.54 1.09 0.01 0.12 -0.27\n",
" -0.47 -0.41 -0.37 -0.36 -0.39 0.43 1.05 1.58 1.25 0.86 0.6 0.21\n",
" 0.19 -0.23 -0.29 0.18 0.12 0.71 1.42 1.59 0.93 -0.25 -0.66 -0.95\n",
" -0.47 0.06 0.7 0.81 0.78 1.43 1.22 1.05 0.44 -0.35 -0.67 -0.84\n",
" -0.66 -0.45 -0.12 -0.2 -0.16 -0.47 -0.52 -0.79 -0.8 -0.62 -0.86 -1.29\n",
" -1.04 -1.05 -0.75 -0.81 -0.9 -0.25 0.62 1.22 0.96 0.21 -0.11 -0.25\n",
" -0.24 -0.43 0.23 0.67 0.78 0.41 0.98 1.28 1.45 1.02 0.03 -0.59\n",
" -1.34 -0.99 -1.49 -1.74 -1.33 -0.55 -0.51 -0.36 -0.99 0.32 1.04 1.41\n",
" 0.99 0.66 0.5 0.22 0.71 -0.16 0.38 0. -1.11 -1.04 0.05 -0.64\n",
" -0.34 -0.5 -1.85 -0.94 -0.78 0.29 0.27 0.69 -0.06 -0.83 -0.8 -1.02\n",
" -0.96 -0.09 0.62 0.87 1.03 0.7 -0.1 -0.31 0.04 -0.46 0.04 0.24\n",
" -0.08 -0.28 0.06 0.05 -0.31 0.11 0.27 0.26 0.04 0.12 1.11 1.53\n",
" 1.23 0.17 -0.18 -0.56 0.05 0.41 0.22 0.04 -0.19 -0.46 -0.65 -1.06\n",
" -0.54 0.14 0.25 -0.21 -0.73 -0.43 0.48 0.26 0.05 0.11 -0.27 -0.08\n",
" -0.1 0.29 -0.15 -0.28 -0.55 -0.44 -1.4 -0.55 -0.69 0.58 0.37 0.42\n",
" 1.83 1.23 0.65 0.41 1.03 0.64 -0.07 0.98 0.36 -0.3 -1.33 -1.39\n",
" -0.94 0.34 -0. -0.15 0.06 0.39 0.36 -0.49 -0.53 0.35 0.07 -0.24\n",
" 0.2 -0.22 -0.68 -0.44 0.02 -0.22 -0.3 -0.59 0.1 -0.02 -0.27 -0.6\n",
" -0.48 -0.37 -0.53 -1.35 -1.22 -0.99 -0.34 -0.79 -0.24 0.02 0.69 0.78\n",
" 0.17 -0.17 -0.29 -0.27 0.31 0.44 0.38 0.24 -0.13 -0.89 -0.76 -0.71\n",
" -0.37 -0.59 -0.63 -1.47 -0.4 -0.18 -0.37 -0.43 -0.06 0.61 1.33 1.19\n",
" 1.13 0.31 0.14 0.03 0.21 0.15 -0.22 -0.02 0.03 -0.17 0.12 -0.35\n",
" -0.06 0.38 -0.45 -0.32 -0.33 -0.49 -0.14 -0.56 -0.18 0.46 1.09 1.04\n",
" 0.23 -0.99 -0.59 -0.92 -0.28 0.52 1.31 1.45 0.61 -0.11 -0.18 -0.39\n",
" -0.39 -0.36 -0.5 -0.81 -1.1 -0.29 0.57 0.68 0.78 0.78 0.63 0.98\n",
" 0.49 -0.42 -1.34 -1.2 -1.18 -0.65 -0.42 -0.97 -0.28 0.77 1.77 2.22\n",
" 1.05 -0.67 -0.99 -1.52 -1.17 -0.22 -0.04 -0.45 -0.46 -0.75 -0.7 -1.38\n",
" -1.15 -0.01 0.97 1.1 0.68 -0.02 -0.04 0.47 0.3 -0.55 -0.51 -0.09\n",
" -0.01 0.34 0.61 0.58 0.33 0.38 0.1 0.18 -0.3 -0.06 -0.28 0.12\n",
" 0.58 0.89 0.93 2.39 2.44 1.92 0.64 -0.24 0.27 -0.13 -0.16 -0.54\n",
" -0.13 -0.37 -0.78 -0.22 0.03 0.25 0.31 1.03 1.1 1.05 1.11 1.28\n",
" 0.57 -0.55 -1.16 -0.99 -0.38 0.01 -0.29 0.09 0.46 0.57 0.24 0.39\n",
" 0.49 0.86 0.51 0.95 1.25 1.33 -0. 0.34 0.66 1.11 0.34 0.48\n",
" 0.56 0.39 -0.17 1.04 0.77 0.12 -0.35 -0.22 0.08 -0.08 -0.18 -0.06]\n"
]
}
],
"source": [
"#nino_url = 'https://paos.colorado.edu/research/wavelets/wave_idl/nino3sst.txt'\n",
"#nino3_data = np.genfromtxt(nino_url, skip_header=19)\n",
"nino3_data = xr.open_dataset(gcd.get('ascii_files/sst_nino3.dat'))\n",
"nino_url = 'https://paos.colorado.edu/research/wavelets/wave_idl/nino3sst.txt'\n",
"nino3_data = np.genfromtxt(nino_url, skip_header=19)\n",
"#nino3_data = xr.open_dataset(gcd.get('ascii_files/sst_nino3.dat'))\n",
"print(nino3_data)"
]
},
Expand All @@ -149,7 +185,7 @@
},
{
"cell_type": "code",
"execution_count": 61,
"execution_count": 14,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -195,7 +231,7 @@
},
{
"cell_type": "code",
"execution_count": 54,
"execution_count": 15,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -221,7 +257,7 @@
},
{
"cell_type": "code",
"execution_count": 55,
"execution_count": 16,
"metadata": {},
"outputs": [
{
Expand All @@ -248,7 +284,7 @@
},
{
"cell_type": "code",
"execution_count": 56,
"execution_count": 17,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -267,7 +303,7 @@
},
{
"cell_type": "code",
"execution_count": 57,
"execution_count": 18,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -277,7 +313,7 @@
},
{
"cell_type": "code",
"execution_count": 62,
"execution_count": 19,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -335,7 +371,7 @@
},
{
"cell_type": "code",
"execution_count": 59,
"execution_count": 20,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -345,7 +381,7 @@
},
{
"cell_type": "code",
"execution_count": 63,
"execution_count": 21,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -388,69 +424,6 @@
"plt.show()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Last Section\n",
"\n",
"If you're comfortable, and as we briefly used for our embedded logo up top, you can embed raw html into Jupyter Markdown cells (edit to see):"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<div class=\"admonition alert alert-info\">\n",
" <p class=\"admonition-title\" style=\"font-weight:bold\">Info</p>\n",
" Your relevant information here!\n",
"</div>"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Feel free to copy this around and edit or play around with yourself. Some other `admonitions` you can put in:"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<div class=\"admonition alert alert-success\">\n",
" <p class=\"admonition-title\" style=\"font-weight:bold\">Success</p>\n",
" We got this done after all!\n",
"</div>"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<div class=\"admonition alert alert-warning\">\n",
" <p class=\"admonition-title\" style=\"font-weight:bold\">Warning</p>\n",
" Be careful!\n",
"</div>"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<div class=\"admonition alert alert-danger\">\n",
" <p class=\"admonition-title\" style=\"font-weight:bold\">Danger</p>\n",
" Scary stuff be here.\n",
"</div>"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"We also suggest checking out Jupyter Book's [brief demonstration](https://jupyterbook.org/content/metadata.html#jupyter-cell-tags) on adding cell tags to your cells in Jupyter Notebook, Lab, or manually. Using these cell tags can allow you to [customize](https://jupyterbook.org/interactive/hiding.html) how your code content is displayed and even [demonstrate errors](https://jupyterbook.org/content/execute.html#dealing-with-code-that-raises-errors) without altogether crashing our loyal army of machines!"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down
37 changes: 17 additions & 20 deletions notebooks/example-workflows/spy-keypad.ipynb

Large diffs are not rendered by default.

Loading

0 comments on commit 136069e

Please sign in to comment.