Skip to content

Commit a863992

Browse files
committed
I added the normalized median filter option into the typical_validation() function in validation.py.
1 parent 99ba810 commit a863992

1 file changed

Lines changed: 16 additions & 7 deletions

File tree

openpiv/validation.py

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -408,13 +408,22 @@ def typical_validation(
408408
# plt.quiver(u,v,color='k')
409409

410410

411-
flag_m = local_median_val(
412-
u,
413-
v,
414-
u_threshold=settings.median_threshold,
415-
v_threshold=settings.median_threshold,
416-
size=settings.median_size,
417-
)
411+
if settings.median_normalized:
412+
flag_m = local_norm_median_val(
413+
u,
414+
v,
415+
ε=0.2, # use the recomended value at this point, later add user's input for this
416+
threshold=settings.median_threshold,
417+
size=settings.median_size
418+
)
419+
else:
420+
flag_m = local_median_val(
421+
u,
422+
v,
423+
u_threshold=settings.median_threshold,
424+
v_threshold=settings.median_threshold,
425+
size=settings.median_size,
426+
)
418427

419428
# u[flag_m] = np.ma.masked
420429
# v[flag_m] = np.ma.masked

0 commit comments

Comments
 (0)