PySPOD: A Python package for Spectral Proper Orthogonal Decomposition (SPOD)

Gianmarco Mengaldo, Romit MaulikJ. Open Source Softw 2021 · DBLP

Introduction

In fields such as meteorology, aerodynamics, and seismology, researchers are frequently confronted with "unstructured" datasets—massive volumes of data where patterns evolve dynamically across both time and space. While standard techniques like Proper Orthogonal Decomposition (POD) and Singular Value Decomposition (SVD) are widely used for dimensionality reduction, they often fail to capture the rhythmic, frequency-specific coherence inherent in many physical phenomena.

PySPOD addresses this gap by providing a robust, Python-native implementation of Spectral Proper Orthogonal Decomposition (SPOD). Specifically designed for stationary data, SPOD yields modes that oscillate at a single frequency, offering a clearer view of phenomena like turbulent flows or climate cycles. Before PySPOD, researchers often relied on proprietary Matlab-based tools or fragmented Python scripts that lacked the scalability required for modern big-data challenges.

Methodology and Implementation

PySPOD provides a modular framework for SPOD, producing modes that are time-harmonic, coherent across space and time, and optimized to represent the statistical variability of stationary random processes. To accommodate varying hardware constraints, the package introduces three distinct implementation "flavors":

  • Low Storage: Optimized for computational speed, this version is ideal for smaller datasets or systems with high RAM capacity.
  • Low RAM: Designed for massive datasets that exceed system memory, this variant utilizes frequent disk I/O to process data that cannot fit in RAM.
  • Streaming: Implementing the algorithm by Schmidt & Towne (2019), this version processes data incrementally. It is essential for real-time analysis or datasets too large to be stored even on disk in traditional formats.

The library leverages high-performance C and Fortran backends for computationally intensive tasks such as Fast Fourier Transforms (FFT) and eigenvalue decompositions, ensuring efficiency without sacrificing the ease of use provided by Python.

Application: Climate Variability Analysis

To demonstrate the package's utility, the authors applied PySPOD to the ECMWF reanalysis datasets (E20C). The analysis focused on monthly averages of six critical climate variables, including mean sea-level pressure (MSL), surface wind components (U10, V10), and sea surface temperature (SST). These variables were analyzed to identify the Multivariate ENSO Index (MEI), a primary signal in global climate variability.

Results and Discussion

PySPOD successfully identified the leading spectral modes for several climate variables. Notably, the analysis revealed a potential coupling between the El Niño-Southern Oscillation (ENSO) and atmospheric vortices over West Antarctica. This finding is significant for climate science, as these vortices influence the stability and height of Antarctic ice shelves.

Leading modes of meridional surface wind (left) and mean sea-level pressure (right) identified using PySPOD.

The software provides a user-friendly API that simplifies the visualization of these complex modes, bridging the gap between raw data and physical interpretation. The results demonstrate that SPOD can isolate meaningful physical signals from noisy, high-dimensional datasets more effectively than traditional time-domain decomposition methods.

Conclusion

PySPOD serves as a critical tool for the scientific community, offering a hardware-aware approach to spectral analysis. By providing "Low RAM" and "Streaming" options, it acknowledges the physical limitations of modern computing environments. Furthermore, the ability to reduce complex flows into coherent spectral modes suggests that PySPOD could play a vital role in feature engineering for machine learning, potentially enhancing the interpretability of neural networks applied to physical sciences.

Summary updated

BibTeX
@article{mengaldo2021pyspod,
  author = {Gianmarco Mengaldo and Romit Maulik and Romit Maulik},
  title = {{PySPOD: A Python package for Spectral Proper Orthogonal Decomposition (SPOD)}},
  journal = {J. Open Source Softw},
  year = {2021},
  doi = {10.21105/joss.02862},
}

Loading related content...

Figure