Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Openpiv updated #59

Merged
merged 7 commits into from
May 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

*.pyc
dist/*
openpivgui.egg-info/*
.vscode/*
build/*
docs/_build/*
docs/_build/doctrees/*
docs/_build/html/*
docs/_build/html/_static/*
dist/*
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "openpiv-python"]
path = openpiv-python
url = https://github.com/openpiv/openpiv-python
5 changes: 3 additions & 2 deletions build/lib/openpivgui/OpenPivGui.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from openpivgui.CreateToolTip import CreateToolTip
from openpivgui.OpenPivParams import OpenPivParams
import openpivgui.AddInHandler as AddInHandler
from scipy.ndimage.filters import gaussian_filter, gaussian_laplace
from scipy.ndimage import gaussian_filter, gaussian_laplace
from matplotlib.figure import Figure as Fig
from matplotlib.backend_bases import key_press_handler
from matplotlib.backends.backend_tkagg import (
Expand Down Expand Up @@ -222,6 +222,7 @@ def processing(self):
(os.cpu_count() - cpu_count), os.cpu_count()))

mp.run(func=mp.process, n_cpus=cpu_count)
# mp.run(func=mp.process, n_cpus=cpu_count)

# update file list with result vector files:
self.tkvars['fnames'].set(return_fnames)
Expand Down Expand Up @@ -531,7 +532,7 @@ def __init_buttons(self):
piv = ttk.Menubutton(f, text='Analysis')
options2 = tk.Menu(piv, tearoff=0)
piv.config(menu=options2)
options2.add_command(label='Algorithms\Calibration',
options2.add_command(label='Algorithms/Calibration',
command=lambda: self.selection(2))
options2.add_command(label='Windowing',
command=lambda: self.selection(3))
Expand Down
1 change: 1 addition & 0 deletions openpiv-python
Submodule openpiv-python added at 55b811
86 changes: 0 additions & 86 deletions openpivgui.egg-info/PKG-INFO

This file was deleted.

26 changes: 0 additions & 26 deletions openpivgui.egg-info/SOURCES.txt

This file was deleted.

1 change: 0 additions & 1 deletion openpivgui.egg-info/dependency_links.txt

This file was deleted.

2 changes: 0 additions & 2 deletions openpivgui.egg-info/requires.txt

This file was deleted.

1 change: 0 additions & 1 deletion openpivgui.egg-info/top_level.txt

This file was deleted.

25 changes: 14 additions & 11 deletions openpivgui/MultiProcessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
import openpiv.filters as piv_flt
import openpiv.validation as piv_vld
import openpiv.windef as piv_wdf
import openpiv.pyprocess as piv_prc
import openpiv.preprocess as piv_pre
import openpiv.tools as piv_tls


__licence__ = '''
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -229,9 +229,12 @@ def smoothn(u, s):
overlap_0)

# validating first pass
mask = np.full_like(x, 0)
mask = np.zeros_like(x, dtype=bool)
u = np.ma.copy(u)
v = np.ma.copy(v)

if self.parameter['fp_vld_global_threshold']:
u, v, Mask = piv_vld.global_val(
Mask = piv_vld.global_val(
u, v,
u_thresholds=(self.parameter['fp_MinU'],
self.parameter['fp_MaxU']),
Expand All @@ -241,7 +244,7 @@ def smoothn(u, s):
mask += Mask

if self.parameter['fp_local_med']:
u, v, Mask = piv_vld.local_median_val(
Mask = piv_vld.local_median_val(
u, v,
u_threshold=self.parameter['fp_local_med'],
v_threshold=self.parameter['fp_local_med'],
Expand All @@ -250,7 +253,7 @@ def smoothn(u, s):

if self.parameter['adv_repl']:
u, v = piv_flt.replace_outliers(
u, v,
u, v, mask,
method=self.parameter['adv_repl_method'],
max_iter=self.parameter['adv_repl_iter'],
kernel_size=self.parameter['adv_repl_kernel'])
Expand Down Expand Up @@ -293,7 +296,7 @@ def smoothn(u, s):
sizeX = corr_window

# translate settings to windef settings object
piv_wdf_settings = piv_wdf.Settings()
piv_wdf_settings = piv_wdf.PIVSettings()
piv_wdf_settings.correlation_method = \
self.parameter['corr_method']
piv_wdf_settings.normalized_correlation = \
Expand Down Expand Up @@ -322,7 +325,7 @@ def smoothn(u, s):

# validate other passes
if self.parameter['sp_vld_global_threshold']:
u, v, Mask = piv_vld.global_val(
Mask = piv_vld.global_val(
u, v,
u_thresholds=(self.parameter['sp_MinU'],
self.parameter['sp_MaxU']),
Expand All @@ -331,13 +334,13 @@ def smoothn(u, s):
mask += Mask # consolidate effects of mask

if self.parameter['sp_vld_global_threshold']:
u, v, Mask = piv_vld.global_std(
Mask = piv_vld.global_std(
u, v,
std_threshold=self.parameter['sp_std_threshold'])
mask += Mask

if self.parameter['sp_local_med_validation']:
u, v, Mask = piv_vld.local_median_val(
Mask = piv_vld.local_median_val(
u, v,
u_threshold=self.parameter['sp_local_med'],
v_threshold=self.parameter['sp_local_med'],
Expand All @@ -346,7 +349,7 @@ def smoothn(u, s):

if self.parameter['adv_repl']:
u, v = piv_flt.replace_outliers(
u, v,
u, v, mask,
method=self.parameter['adv_repl_method'],
max_iter=self.parameter['adv_repl_iter'],
kernel_size=self.parameter['adv_repl_kernel'])
Expand Down
Loading
Loading