Skip to main content

DPIVSoft Python

DPIVSoft is an open-source PIV (Particle Image Velocimetry) code, originally written in MATLAB by Thomas Leweke and Patrice Meunier (https://www.irphe.fr/~meunier/). This project ports it to Python and adds GPU acceleration through OpenCL.

Documentation (user guide and API reference): https://dpivsoft-python.readthedocs.io

Features

  • 2D PIV with iterative window deformation, on CPU or GPU (OpenCL), with masking of solid bodies
  • Stereo PIV: target calibration (TSI and LaVision), Soloff 3-component reconstruction and disparity (Δz) correction
  • Synthetic particle images from analytic flows or custom velocity fields (e.g. CFD)
  • Post-processing: vorticity, divergence and other derived fields
  • Per-vector uncertainty from the correlation peak ratio — Xue et al., Meas. Sci. Technol. 25, 115301 (2014)
  • Forces from 2D PIV fields:
    • Vorticity-based impulse method — Martín-Alcántara & Fernández-Feria, Phys. Rev. Fluids 4, 024702 (2019)
    • Mesh-based projection method — Chang, Proc. R. Soc. A 437:517–525 (1992)
  • A GUI for PIV, masks, stereo, post-processing, forces, synthetic images and uncertainty

Status

DPIVSoft is in beta, and the API may change between versions.

  • 2D PIV (CPU and GPU) is the mature part: tested against analytic flows, with the GPU path checked against the CPU one.
  • Stereo PIV is validated on synthetic images only, not yet against experimental ground truth. Treat it as experimental.
  • Force methods are validated on analytic benchmark fields, not on noisy PIV data. The wall-shear term of the projection method is not reliable from PIV.

Results changed in several recent releases; check the changelog before reprocessing older data. Testing and feedback are welcome.

Installing

pip install dpivsoft

From source:

git clone https://gitlab.com/jacabello/dpivsoft_python.git
cd dpivsoft_python
python -m pip install .

For development, install in editable mode with the build, lint and documentation tools: python -m pip install -e ".[dev,docs]". requirements.txt pins one set of versions known to work.

Requirements:

  • Python ≥ 3.11 (tested on 3.11, 3.12 and 3.13). Dependencies are listed in pyproject.toml and installed by pip.
  • For the GPU path, an OpenCL runtime for your device (tested on an AMD RX 580). The CPU path needs none.

Quick start

GUI

Start the GUI from the Python environment where DPIVSoft is installed:

python -m dpivsoft.gui                 # empty window
python -m dpivsoft.gui session.yaml    # reopen a saved session (File → Save session)

The GUI needs tkinter, which pip cannot install. Some Python distributions package it separately (python3-tk on Debian/Ubuntu, python-tk on Homebrew). python -m tkinter opens a small test window if it is available.

Each PIV or stereo run writes its parameters.yaml next to the results, so it can be repeated from a script. Forces have no GUI tab; compute them from a script.

Scripts

Start with dpivsoft/Examples/simple_tutorial.py, then the getting started guide.

Examples

Example scripts are in dpivsoft/Examples/:

  • simple_tutorial.py — basic 2D PIV run (synthetic images → CPU PIV → plotting)
  • GPU_simple_tutorial.py — the same run on the GPU
  • masked_airfoil_tutorial.py — airfoil flow with the solid body masked out
  • stereo_tutorial.py — stereo PIV with calibration and 3-component reconstruction (downloads a ~197 MB public dataset)
  • forces_tutorial.py — forces on an analytic oscillating-cylinder flow with both methods
  • mesh_tutorial.py — FEM mesh and auxiliary potentials for the projection method
  • uncertainty_tutorial.py — calibrate per-vector uncertainty and check its coverage
  • performance.py — GPU vs CPU benchmark

Testing

Run the tests from a cloned repository (some write inside Examples/):

python -m unittest discover dpivsoft/tests -b

Or run a single suite, e.g. python -m unittest dpivsoft.tests.test_masking -b.

The GPU tests need an OpenCL device, the GUI smoke tests need a display, and the real-image part of test_cpt_sorting needs the PIV Challenge case E target downloaded by stereo_tutorial.py.

Contributors

  1. Jorge Aguilar-Cabello

Acknowledgements

  1. Patrice Meunier
  2. Thomas Leweke
  3. Raul Infante-Sainz
  4. Luis Parras
  5. Carlos del Pino

How to cite this work

J. Aguilar-Cabello, L. Parras, C. del Pino (2022), "DPIVSoft-OpenCL: A multicore CPU–GPU accelerated open-source code for 2D Particle Image Velocimetry," SoftwareX 20, 101256. https://doi.org/10.1016/j.softx.2022.101256

Metadata

Release files for dpivsoft 0.17.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dpivsoft 0.17.0
File Size Uploaded Provenance Actions
dpivsoft-0.17.0.tar.gz 1.6 MB Without provenance Details for dpivsoft-0.17.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for dpivsoft 0.17.0
File Interpreter ABI Platform Actions
dpivsoft-0.17.0-py3-none-any.whl Python 3 none any Details for dpivsoft-0.17.0-py3-none-any.whl

Total release size: 3.2 MB

Release files / dpivsoft-0.17.0.tar.gz

Download URL dpivsoft-0.17.0.tar.gz
Size 1.6 MB
Tags Source
SHA-256 checksum
How to use checksums
25d9b18e79ea12a700631886b9f514f88f13583683af47a0bb36a4d6d3839507
BLAKE2b-256 checksum
How to use checksums
950c785ea545d9733de8a24700921316b884277ccca96502b4449410f0449dc5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / dpivsoft-0.17.0-py3-none-any.whl

Download URL dpivsoft-0.17.0-py3-none-any.whl
Size 1.6 MB
Tags Python 3
SHA-256 checksum
How to use checksums
5d0297864322d7d9ba0fa1f5134cb8dae06cae1f87c16bae7a67368f75588f7c
BLAKE2b-256 checksum
How to use checksums
b783624ab1ab78aace2a4becf7e40a31447dfdb4175cc0f69c8b43337837e7cf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Security for dpivsoft 0.17.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page