Skip to content

Commit baae66d

Browse files
authored
Merge pull request #266 from hifabian/master
Scaling adjustments for windef and output notation
2 parents 0f365d9 + 18d8414 commit baae66d

3 files changed

Lines changed: 7 additions & 4 deletions

File tree

openpiv/test/test_tools.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def test_display_vector_field(file_a=_file_a, file_b=_file_b, test_file=_test_fi
4343
display_vector_field('tmp.txt', on_img=True, image_name=file_a, ax=ax)
4444
decorators.remove_ticks_and_titles(fig)
4545
fig.savefig('./tmp.png')
46-
res = compare.compare_images('./tmp.png', test_file, 0.001)
46+
res = compare.compare_images('./tmp.png', test_file, 0.05)
4747
assert res is None
4848

4949
def test_file_patterns():
@@ -62,4 +62,4 @@ def test_file_patterns():
6262
# settings.frame_pattern_b = '(1+2),(3+4)'
6363
"""
6464

65-
65+

openpiv/tools.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ def find_boundaries(threshold, list_img1, list_img2, filename, picname):
329329
return list_bound
330330

331331

332-
def save(x, y, u, v, mask, filename, fmt="%8.4f", delimiter="\t"):
332+
def save(x, y, u, v, mask, filename, fmt="%.4e", delimiter="\t"):
333333
"""Save flow field to an ascii file.
334334
335335
Parameters
@@ -652,4 +652,4 @@ def transform_coordinates(x, y, u, v):
652652
y = y[::-1, :]
653653
v *= -1
654654
return x, y, u, v
655-
655+

openpiv/windef.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,9 @@ def func(args):
321321
u = u.filled(0.)
322322
v = v.filled(0.)
323323

324+
# pixel / frame -> pixel / second
325+
u /= settings.dt
326+
v /= settings.dt
324327
# "scales the results pixel-> meter"
325328
x, y, u, v = scaling.uniform(x, y, u, v,
326329
scaling_factor=settings.scaling_factor)

0 commit comments

Comments
 (0)