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, 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.16.2

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.16.2
File Size Uploaded Provenance Actions
dpivsoft-0.16.2.tar.gz 1.6 MB Without provenance Details for dpivsoft-0.16.2.tar.gz

Built distribution (wheel)

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

Total release size: 3.1 MB

Release files / dpivsoft-0.16.2.tar.gz

Download URL dpivsoft-0.16.2.tar.gz
Size 1.6 MB
Tags Source
SHA-256 checksum
How to use checksums
38ae55905cd1b1a45d94f7da6865d1bca742aa1d4df6e64764d4a072750ea969
BLAKE2b-256 checksum
How to use checksums
af82abc96679c1408dc7b9c608603e804433ea6d711bc53376b3b8c5e2d39082
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.16.2-py3-none-any.whl

Download URL dpivsoft-0.16.2-py3-none-any.whl
Size 1.6 MB
Tags Python 3
SHA-256 checksum
How to use checksums
c337279c320fb89c43241a7340df9491f50049940b33431bdf96edfccc6a8f2a
BLAKE2b-256 checksum
How to use checksums
d8ea882909f768c7bb849d60dffc9489f7e08ccd6ade72a80b84edc74a12ea5c
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.16.2

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