Skip to content

Commit 19c8e4a

Browse files
authored
Merge pull request #271 from alexlib/master
update windef.simple_pass and tutorial in the docs
2 parents fd769d6 + 0328ad0 commit 19c8e4a

File tree

3 files changed

+35
-21
lines changed

3 files changed

+35
-21
lines changed

openpiv/docs/src/tutorial1.ipynb

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
},
1313
{
1414
"cell_type": "code",
15-
"execution_count": 1,
15+
"execution_count": 21,
1616
"metadata": {
1717
"lines_to_next_cell": 2
1818
},
@@ -39,7 +39,7 @@
3939
},
4040
{
4141
"cell_type": "code",
42-
"execution_count": 2,
42+
"execution_count": 22,
4343
"metadata": {},
4444
"outputs": [],
4545
"source": [
@@ -49,7 +49,7 @@
4949
},
5050
{
5151
"cell_type": "code",
52-
"execution_count": 3,
52+
"execution_count": 23,
5353
"metadata": {},
5454
"outputs": [
5555
{
@@ -94,7 +94,7 @@
9494
},
9595
{
9696
"cell_type": "code",
97-
"execution_count": 4,
97+
"execution_count": 24,
9898
"metadata": {},
9999
"outputs": [],
100100
"source": [
@@ -123,7 +123,7 @@
123123
},
124124
{
125125
"cell_type": "code",
126-
"execution_count": 5,
126+
"execution_count": 25,
127127
"metadata": {},
128128
"outputs": [],
129129
"source": [
@@ -149,7 +149,7 @@
149149
},
150150
{
151151
"cell_type": "code",
152-
"execution_count": 6,
152+
"execution_count": 26,
153153
"metadata": {},
154154
"outputs": [],
155155
"source": [
@@ -168,7 +168,7 @@
168168
},
169169
{
170170
"cell_type": "code",
171-
"execution_count": 7,
171+
"execution_count": 27,
172172
"metadata": {},
173173
"outputs": [],
174174
"source": [
@@ -190,7 +190,7 @@
190190
},
191191
{
192192
"cell_type": "code",
193-
"execution_count": 8,
193+
"execution_count": 28,
194194
"metadata": {},
195195
"outputs": [],
196196
"source": [
@@ -217,7 +217,7 @@
217217
},
218218
{
219219
"cell_type": "code",
220-
"execution_count": 9,
220+
"execution_count": 29,
221221
"metadata": {},
222222
"outputs": [],
223223
"source": [
@@ -235,7 +235,7 @@
235235
},
236236
{
237237
"cell_type": "code",
238-
"execution_count": 10,
238+
"execution_count": 30,
239239
"metadata": {
240240
"scrolled": true
241241
},

openpiv/test/test_windef.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,15 @@ def test_simple_rectangular_window():
265265
print('test simple pass with rectangular windows')
266266

267267
settings = windef.PIVSettings()
268+
269+
270+
x, y, _,_,_ = windef.simple_multipass(
271+
frame_a,
272+
frame_b,
273+
settings,
274+
)
275+
276+
268277
settings.windowsizes = ((64, 32),)
269278
settings.overlap = ((32, 16),)
270279
settings.num_iterations = 1
@@ -273,7 +282,7 @@ def test_simple_rectangular_window():
273282
settings.subpixel_method = 'gaussian'
274283
settings.sig2noise_mask = 2
275284

276-
x, y, u, v, flags = windef.simple_multipass(
285+
x, y, _,_,_ = windef.simple_multipass(
277286
frame_a,
278287
frame_b,
279288
settings,
@@ -290,7 +299,7 @@ def test_simple_rectangular_window():
290299
settings.overlap = ((16, 32), (8, 16))
291300
settings.num_iterations = 2
292301

293-
x, y, u, v, flags = windef.simple_multipass(
302+
x, y, _, _, _ = windef.simple_multipass(
294303
frame_a,
295304
frame_b,
296305
settings,

openpiv/windef.py

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -972,17 +972,22 @@ def multipass_img_deform(
972972
def simple_multipass(
973973
frame_a: np.ndarray,
974974
frame_b: np.ndarray,
975-
settings: "PIVSettings",
976-
windows: Optional[Tuple[int, ...]]=None,
975+
settings: Optional["PIVSettings"]=None,
977976
)->Tuple:
978-
""" Simple windows deformation multipass run with
979-
default settings
980-
"""
977+
"""_summary_
981978
982-
if windows is not None:
983-
settings.num_iterations = len(windows)
984-
settings.windowsizes = windows
985-
settings.overlap = tuple(int(w/2) for w in windows)
979+
Args:
980+
frame_a (np.ndarray): frame A image as an array
981+
frame_b (np.ndarray): frame B,
982+
settings (Optional["PIVSettings"], optional): _description_. Defaults to None.
983+
984+
Returns:
985+
Tuple: _description_
986+
"""
987+
if settings is None:
988+
settings = PIVSettings()
989+
settings.windowsizes = (64, 32)
990+
settings.overlap = (32, 16)
986991

987992
x, y, u, v, s2n = first_pass(
988993
frame_a,

0 commit comments

Comments
 (0)