Skip to content

Commit

Permalink
add pivimage and fix example notebooks
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiasprobst committed Nov 11, 2024
1 parent a023b23 commit 2ae326d
Show file tree
Hide file tree
Showing 8 changed files with 272 additions and 196 deletions.
2 changes: 1 addition & 1 deletion codemeta.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"license": "https://spdx.org/licenses/MIT",
"codeRepository": "https://github.com/MatthiasProbst/synpivimage",
"name": "synpivimage",
"version": "1.0.0a6",
"version": "1.0.0a7",
"description": "Tool to build synthetic Particle Image Velocimetry (PIV) images",
"applicationCategory": "Engineering",
"programmingLanguage": [
Expand Down
271 changes: 160 additions & 111 deletions examples/out_of_plane.ipynb

Large diffs are not rendered by default.

90 changes: 44 additions & 46 deletions examples/take_a_single_image.ipynb

Large diffs are not rendered by default.

53 changes: 26 additions & 27 deletions examples/take_double_image.ipynb

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion requirements-doc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ myst-nb
nbsphinx
sphinxcontrib-bibtex
sphinx-math-dollar
h5rdmtoolbox==1.5.0
h5rdmtoolbox>=1.5.0
7 changes: 4 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ opencv-python
PyQt5
scipy
pydantic
ontolutils == 0.6.0
ssnolib==1.3.0.1a2
pivmetalib==0.1.0rc8
ontolutils >= 0.12.2
ssnolib>=1.3.0.1a12
pivmetalib>=0.1.0rc9
pivimage
9 changes: 5 additions & 4 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = synpivimage
version = 1.0.0a6
version = 1.0.0a7
author = Matthias Probst
author_email = matthias.probst@kit.edu
description = Tool to build synthetic Particle Image Velocimetry (PIV) images
Expand Down Expand Up @@ -33,9 +33,10 @@ install_requires =
opencv-python
scipy
pydantic
ontolutils == 0.6.0
ssnolib==1.3.0.1a2
pivmetalib==0.1.0rc8
ontolutils>=0.12.2
ssnolib>=1.3.0.1a12
pivmetalib>=0.1.0rc9
pivimage

[options.extras_require]
test =
Expand Down
34 changes: 31 additions & 3 deletions synpivimage/particles.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,12 +215,40 @@ def reset(self):
self._flag = np.zeros_like(self.x, dtype=int)

@classmethod
def generate(cls, ppp: float, dx_max, dy_max, dz_max, size, camera, laser) -> "Particles":
def generate(
cls,
ppp: float,
dx_max: float,
dy_max: float,
dz_max: float,
size: float,
camera: "Camera",
laser: "Laser"
) -> "Particles":
"""Generate particles based on a certain ppp (particles per pixel). With
dx, dy, dz the maximum displacement of the particles can be set. The camera and laser
are used to determine the sensor size and the laser width."""
are used to determine the sensor size and the laser width.
Parameters
----------
ppp : float
Particles per pixel
dx_max : float
Maximum displacement in x-direction
dy_max : float
Maximum displacement in y-direction
dz_max : float
Maximum displacement in z-direction
size : float
Particle size
camera : Camera
Camera model
laser : Laser
Laser model
"""
from .utils import generate_particles
return generate_particles(ppp=ppp, dx_max=dx_max, dy_max=dy_max, dz_max=dz_max, size=size, camera=camera, laser=laser)
return generate_particles(ppp=ppp, dx_max=dx_max, dy_max=dy_max, dz_max=dz_max, size=size, camera=camera,
laser=laser)

def get_ppp(self, camera_size: int) -> float:
"""Return the particles per pixel"""
Expand Down

0 comments on commit 2ae326d

Please sign in to comment.