Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Atmospheric Data: Nino 3 SST Index

Weekly Sea Surface Temperature Patterns from NOAA

Atmospheric Data: Nino 3 SST Index


Overview

Generating a wavelet power and phase spectrum from the time-series data Nino 3 SST Index

  1. Prerequisties

  2. Background

  3. Download and Organize Nino 3 SST Data

  4. Wavelet Input Values

  5. PyWavelets

  6. Power Spectrum

  7. Phase Spectrum

Prerequisites

ConceptsImportanceNotes
Intro to MatplotlibNecessaryUsed to plot data
Intro to PandasNecessaryUsed to read in and organize data (in particular dataframes)
Intro to NumpyNecessaryUsed to work with large arrays
Intro to SciPyHelpfulUsed to work with .wav files and built-in Fast Fourier Transform
  • Time to learn: 45 minutes


Background

What is an El Niño?

Learn more!

Wavelets and Atmospheric Data

Weather is a great example of time-series data. Weather varies in cycles of temperature over weeks due to a huge number of variables. Wavelet analysis can be used to find patterns in temperature by analyzing both the temperature and the time when the temperature occurs.

Imports

Downloading file 'registry.txt' from 'https://github.com/NCAR/geocat-datafiles/raw/main/registry.txt' to '/home/runner/.cache/geocat'.

Download Nino 3 SST Data

We will be downloading the sst_nino3 data from geocat-datafiles

Downloading file 'ascii_files/sst_nino3.dat' from 'https://github.com/NCAR/geocat-datafiles/raw/main/ascii_files/sst_nino3.dat' to '/home/runner/.cache/geocat'.

Plot and View Data

Let’s give the data a look! We have over a hundred years worth of temperature readings.

<Figure size 800x800 with 1 Axes>

Update the X-Axis

By default, the loaded data lists the year as time since 1871, we can add a new x-axis to view the years along the x-axis

<Figure size 800x800 with 1 Axes>

Wavelet Input Values

Wavelet inputs include:

  • x: Input time-series data (for example, the time and temperature data from nino3)

  • wavelet: mother wavelet name

  • dt: sampling period (time between each y-value)

  • s0: smallest scale

  • dj: spacing between each discrete scales

  • jtot: largest scale

Define Complex Morlet

A complex Morlet allows us to define both the bandwidth and the center frequency that the Morlet wavelet will be built from to produce optimal results.

Here you can learn more about how PyWavelets configures Complex Morlet wavelets

Below you can see how changing the bandwidth and center frequency will change how the mother Complex Morlet wavelet’s shape is formed. The shape of the wavelet will impact which frequencies it is sensitive to.

<Figure size 1000x1000 with 9 Axes>

Changing the bandwidth and center frequency can be a useful tool to optimize how well the mother wavelet will be able to find frequencies in the data.

Below you will see how different values for bandwidth and center frequency can lead to greater or poorer resolution of the same signal.

<Figure size 1000x1000 with 18 Axes>

For this example, we will be using a complex Morlet with a bandwidth of 1.5 and a center frequency of 1

cmor1.5-1

Applying Wavelets

Power Spectrum

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.

<Figure size 1000x1000 with 2 Axes>

The power spectrum above demonstrates a strong peak (in yellow) at 50 that represents an interesting consistent pattern across the decades of atmosphere data.

Phase Spectrum

While less commonly used, the phase spectrum is the imaginary component of the wavelet.

<Figure size 1000x1000 with 2 Axes>

Summary

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.

What’s next?

  • Buoys and Wave(lets)