diff --git a/README.md b/README.md index 1f099a0..e49ea01 100644 --- a/README.md +++ b/README.md @@ -25,18 +25,18 @@ Wavelets are a powerful tool to analyze time-series data. When data frequencies This cookbook is broken into two main sections: -- Foundations -- Example Workflows +- Introduction +- Example Geoscience Workflows -### Foundations - -_"Wavelet Basics"_ covers the motivation and background for wavelet analysis by reviewing time-series data and the strengths and weaknesses of other signal analysis tools like Fourier Transform - -### Example Workflows +### Introduction +- _"Wavelet Basics"_: Understand the motivation and background for wavelet analysis by reviewing time-series data and the strengths and weaknesses of other signal analysis tools like Fourier Transform - _"PyWavelets and Jingle Bells"_: Learn how to use `PyWavelets`, a Python implementation of wavelet analysis, to determine the order of notes in a simple musical piece - _"Spy Keypad"_: Learn how to use wavelets to undercover the frequency and order of notes in an unknown piece of audio data -- _"Atmospheric Data: Nino 3 SST Index"_: Learn how to apply wavelets to real atmospheric and oceanic data to generate a power wavelet scalogram, similiar to the 1999 paper ["A Practical Guide to Wavelet Analysis"](https://psl.noaa.gov/people/gilbert.p.compo/Torrence_compo1998.pdf) by Torrence and Compo in Python + +### Geoscience Workflows + +- _"Atmospheric Data: Nino 3 SST Index"_: Learn how to apply wavelets to real atmospheric and oceanic data to generate a power wavelet scalogram, similar to the 1999 paper ["A Practical Guide to Wavelet Analysis"](https://psl.noaa.gov/people/gilbert.p.compo/Torrence_compo1998.pdf) by Torrence and Compo in Python ## Running the Notebooks @@ -63,17 +63,15 @@ Jupyter](https://foundations.projectpythia.org/foundations/getting-started-jupyt If you are interested in running this material locally on your computer, you will need to follow this workflow: -(Replace "cookbook-example" with the title of your cookbooks) - -1. Clone the `https://github.com/ProjectPythia/cookbook-example` repository: +1. Clone the `https://github.com/ProjectPythia/wavelet-cookbook` repository: ```bash - git clone https://github.com/ProjectPythia/cookbook-example.git + git clone https://github.com/ProjectPythia/wavelet-cookbook.git ``` -1. Move into the `cookbook-example` directory +1. Move into the `wavelet-cookbook` directory ```bash - cd cookbook-example + cd wavelet-cookbook ``` 1. Create and activate your conda environment from the `environment.yml` file ```bash diff --git a/_toc.yml b/_toc.yml index 8659918..5f61f61 100644 --- a/_toc.yml +++ b/_toc.yml @@ -7,8 +7,8 @@ parts: - caption: Introduction chapters: - file: notebooks/wavelet-introduction/wavelet-basics - - caption: Example Workflows + - file: notebooks/wavelet-introduction/jingle-bells + - file: notebooks/wavelet-introduction/spy-keypad + - caption: Geoscience Workflows chapters: - - file: notebooks/example-workflows/jingle-bells - - file: notebooks/example-workflows/spy-keypad - file: notebooks/example-workflows/nino3 diff --git a/notebooks/example-workflows/nino3.ipynb b/notebooks/example-workflows/nino3.ipynb index 7dbad16..fbf10eb 100644 --- a/notebooks/example-workflows/nino3.ipynb +++ b/notebooks/example-workflows/nino3.ipynb @@ -231,8 +231,10 @@ ] }, { - "cell_type": "markdown", + "cell_type": "code", + "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "wavelets = [f\"cmor{x:.1f}-{y:.1f}\" for x in [0.5, 1.5, 2.5] for y in [0.5, 1.0, 1.5]]\n", "fig, axs = plt.subplots(3, 3, figsize=(10, 10), sharex=True, sharey=True)\n", @@ -349,7 +351,7 @@ "metadata": {}, "source": [ "## Power Spectrum\n", - "The power spectrum is the real component of the wavelet coefficents. We can find this value by squaring the absolute value of the `wavelet_coeffs` to return the magnitude of the real component to make a better graph." + "The power spectrum is the real component of the wavelet coefficients. We can find this value by squaring the absolute value of the `wavelet_coeffs` to return the magnitude of the real component to make a better graph." ] }, { @@ -460,7 +462,7 @@ "metadata": {}, "source": [ "## Summary\n", - "Frequency signals appear in more than just audio! A frequency analysis of weather data can inform us about how weather trends change through a year and over a decades worth of data\n", + "Frequency signals appear in more than just audio! A frequency analysis of weather data can inform us about how weather trends change through a year and over a decades worth of data.\n", "\n", "### What's next?\n", "\n", diff --git a/notebooks/example-workflows/jingle-bells.ipynb b/notebooks/wavelet-introduction/jingle-bells.ipynb similarity index 98% rename from notebooks/example-workflows/jingle-bells.ipynb rename to notebooks/wavelet-introduction/jingle-bells.ipynb index d3e408e..d57ade1 100644 --- a/notebooks/example-workflows/jingle-bells.ipynb +++ b/notebooks/wavelet-introduction/jingle-bells.ipynb @@ -107,7 +107,7 @@ "source": [ "## PyWavelets Overview\n", "\n", - "PyWavelets returns both the coefficents and frequency information for wavelets from the input data\n", + "PyWavelets returns both the coefficients and frequency information for wavelets from the input data\n", "\n", "```\n", "coeffs, frequencies = pywt.cwt(data, scales, wavelet, sampling_period)\n", @@ -124,10 +124,10 @@ "Required:\n", "- data: input data (as an array)\n", "- wavelet: name of the Mother wavelet\n", - "- scales: collection of the scales to use will determine the range which the wavelet will be streched or squished\n", + "- scales: collection of the scales to use will determine the range which the wavelet will be stretched or squished\n", "\n", "Optional:\n", - "- sampling_period: sampling period for frequencies output. Scales are not scaled by the period (and coefficents are independent of the sampling_period)" + "- sampling_period: sampling period for frequencies output. Scales are not scaled by the period (and coefficients are independent of the sampling_period)" ] }, { @@ -137,7 +137,7 @@ "### Return Values\n", "The continuous wavelet transforms in PyWavelets returns two values:\n", "\n", - "- coefficents: collection of complex number outputs for wavelet coefficients\n", + "- coefficients: collection of complex number outputs for wavelet coefficients\n", "- frequencies: collection of frequencies (if the sampling period are in seconds then frequencies are in hertz otherwise a sampling period of 1 is assumed)\n", "\n", "The final size of coefficients depends on the length of the input data and the length of the given scales." diff --git a/notebooks/example-workflows/spy-keypad.ipynb b/notebooks/wavelet-introduction/spy-keypad.ipynb similarity index 98% rename from notebooks/example-workflows/spy-keypad.ipynb rename to notebooks/wavelet-introduction/spy-keypad.ipynb index 5a319d0..36595d9 100644 --- a/notebooks/example-workflows/spy-keypad.ipynb +++ b/notebooks/wavelet-introduction/spy-keypad.ipynb @@ -159,7 +159,7 @@ "source": [ "## Wavelet Analysis: Power Spectrum\n", "\n", - "The power spectrum plots the real component of the complex number returns from wavelet coefficents. This will return information about the frequency and time that we need to use to determine which notes are used in what order for the keypad.\n", + "The power spectrum plots the real component of the complex number returns from wavelet coefficients. This will return information about the frequency and time that we need to use to determine which notes are used in what order for the keypad.\n", "\n", "For the purpose of this example, we will use the Morlet mother wavelet. Morlet is one type of mother wavelet useful for working with audio signals and is a good general wavelet to start with when analyzing frequencies of a signal.\n", "\n",