Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

synpivimage - A transparent way of generating synthetic PIV images

Tests DOCS pyvers

This tool lets you generate synthetic Particle Image Velocimetry (PIV) images based on methods described in literature (mainly based on "Particle Image Velocimetry: A Practical Guide" by Raffel et al. (https://doi.org/10.1007/978-3-319-68852-7)).

Highlights

  • The user has full control over the parameters.
  • Data and metadata can be stored in a single HDF5 file or classically in TIF files.
  • The metadata (camera and laser settings) can be stored in a separate JSON-LD file, which adheres to the state of the art way of storing metadata, allowing for easy integration into any other software or database.

Installation

Manual installation

Clone the repository

git clone https://github.com/matthiasprobst/synpivimage

Then navigate into the repo directory and install the package:

cd synpivimage/
pip install .

For development adjust the installation to:

pip install -e .

Other installation options: For running tests:

pip install .[test]

For using the GUI (experimentally at this stage!!! see gui doc section):

pip install .[gui]

For installing everything:

pip install .[all]

Via pypi

Not yet available

Documentation

A comprehensive documentation can be found here.

Minimal example:

import numpy as np

import synpivimage

cam = synpivimage.Camera(
    nx=256,
    ny=256,
    bit_depth=16,
    qe=1,
    sensitivity=1,
    baseline_noise=50,
    dark_noise=10,
    shot_noise=False,
    fill_ratio_x=1.0,
    fill_ratio_y=1.0,
    particle_image_diameter=4  # px
)

laser = synpivimage.Laser(
    width=0.25,
    shape_factor=2
)

n = 100
particles = synpivimage.Particles(
    x=np.random.uniform(-3, cam.nx - 1, n),
    y=np.random.uniform(-4, cam.ny - 1, n),
    z=np.zeros(n),
    size=np.ones(n) * 2,
)

imgA, partA = synpivimage.take_image(laser,
                                     cam,
                                     particles,
                                     particle_peak_count=1000)

displaced_particles = partA.displace(dx=2.1, dy=3.4)

imgB, partB = synpivimage.take_image(laser,
                                     cam,
                                     displaced_particles,
                                     particle_peak_count=1000)

with synpivimage.Imwriter(case_name="test_case",
                          camera=cam,
                          laser=laser) as iw:
    iw.writeA(0, imgA, partA)
    iw.writeB(0, imgB, partB)

with synpivimage.HDF5Writer(filename='data.hdf',
                            n_images=1,
                            camera=cam,
                            laser=laser) as hw:
    hw.writeA(0, imgA, partA)
    hw.writeB(0, imgB, partB)

GUI

Is experimental and more for demonstrating and debugging purposes.

Go to synpivimage/gui and run python core.py to start the GUI.

Developers

Testing

Call the following inside the package directory to run the tests (with coverage)

pytest --cov=synpivimage --cov-report html

Contributing

Contributions are welcome! Please open an issue or a pull request.

License

This project is licensed under the MIT License.

Metadata

Release files for synpivimage 1.0.0a9

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

Source distribution (sdist)

Source distribution for synpivimage 1.0.0a9
File Size Uploaded
synpivimage-1.0.0a9.tar.gz 48.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for synpivimage 1.0.0a9
File Interpreter ABI Platform
synpivimage-1.0.0a9-py3-none-any.whl Python 3 none any Details

Total release size: 92.7 kB

Release files / synpivimage-1.0.0a9.tar.gz

Download URL synpivimage-1.0.0a9.tar.gz
Size 48.8 kB
Tags Source
SHA-256 checksum
How to use checksums
0b8aeb95b262dfc1a53bda2998ea4fed0d5457da3b2cb209dc7bf14dc4e017af
BLAKE2b-256 checksum
How to use checksums
4141ca3c8a7092caa97093fcd4d32ac692ccf24130613480adb1ee58ac26f86d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.12.0

Release files / synpivimage-1.0.0a9-py3-none-any.whl

Download URL synpivimage-1.0.0a9-py3-none-any.whl
Size 43.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1e0cb43c5e477f15df46e920efb61cc0c16351b45d07eca3cdd86df0cddc9eec
BLAKE2b-256 checksum
How to use checksums
aff683d78d2ac87b854c6ff07de835ad6396f256722dd1a52e93d36b4c9ac432
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.12.0

Release history Release notifications | RSS feed

This release

1.0.0a9 This release

2 release files

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