$ show OpenPIV/openpiv-python
OpenPIV is a Python library for Particle Image Velocimetry (PIV) analysis, used to extract velocity fields from image pairs of seeded fluid flows. It provides a complete pipeline including image preprocessing, cross-correlation with subpixel interpolation, outlier validation, filtering, and scaling. The library supports both 2D and 3D PIV, multi-pass window deformation, and batch processing of image sequences. The architecture is modular with a dual-backend design: a pure Python/SciPy reference implementation and an optional Rust backend (openpiv_rust) for accelerated computation. Core algorithms are implemented in pyprocess.py (FFT correlation, peak detection) and windef.py (multi-grid window deformation). The library includes a comprehensive validation module (global, local median, signal-to-noise ratio) and a smoothing module ported from a MATLAB robust spline algorithm. OpenPIV is designed for researchers and engineers in experimental fluid dynamics. It includes synthetic image generation tools for testing, benchmarking scripts for performance evaluation, and Jupyter notebooks for tutorials and algorithm exploration. The library is in beta (v0.26.1) with an API subject to change, and conda packages are no longer maintained.
The LLM identified 2 files worth highlighting for reuse:
Port of Garcia's robust spline smoothing algorithm (2010) for smoothing noisy data. Self-contained implementation using numpy and scipy.sparse. Can be extracted and used in any project requiring robust smoothing of 1D or 2D data with automatic regularization parameter selection.
Generates synthetic Particle Image Velocimetry (PIV) image pairs with known displacement fields. Uses numpy and PIL to create realistic particle images with controlled parameters. Reusable for testing PIV algorithms or generating ground truth data for validation.