Skip to content

Commit 2d9b16b

Browse files
committed
I finished the description of the function local_norm_median_val() and corrected the description of returns in the function local_median_val()
1 parent 96b8269 commit 2d9b16b

1 file changed

Lines changed: 16 additions & 6 deletions

File tree

openpiv/validation.py

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ def local_median_val(
202202
Returns
203203
-------
204204
205-
flag : boolean 2d np.ndarray
205+
ind : boolean 2d np.ndarray
206206
a boolean array. True elements corresponds to outliers.
207207
208208
"""
@@ -231,14 +231,15 @@ def local_median_val(
231231
def local_norm_median_val(
232232
u: np.ndarray,
233233
v: np.ndarray,
234+
ε: float,
234235
u_threshold: float,
235236
v_threshold: float,
236237
size: int=1
237238
)->np.ndarray:
238239
"""This function is adapted from OpenPIV's implementation of
239240
validation.local_median_val(). validation.local_median_val() is,
240241
basically, Westerweel's original median filter (with some changes).
241-
This function builts upon validation.local_median_val() and implements
242+
The current function builts upon validation.local_median_val() and implements
242243
improved Westerweel's median filter (normalized filter) as described
243244
in 2007 edition of the German PIV book (paragraph 6.1.5) and in Westerweel's
244245
article J. Westerweel, F. Scarano, "Universal outlier detection for PIV data",
@@ -258,22 +259,31 @@ def local_norm_median_val(
258259
Parameters
259260
----------
260261
u : 2d np.ndarray
261-
a two dimensional array containing the u velocity component.
262+
a two dimensional array containing the u velocity component
262263
263264
v : 2d np.ndarray
264-
a two dimensional array containing the v velocity component.
265+
a two dimensional array containing the v velocity component
266+
267+
ε : float
268+
minimum normalization level (see the referenced article, eqn.2)
265269
266270
u_threshold : float
267271
the threshold value for component u
268272
269273
v_threshold : float
270274
the threshold value for component v
271275
276+
size: int
277+
the representative size of the kernel of the median filter, the
278+
actual size of the kernel is (2*size+1, 2*size+1) - i.e., it's the
279+
number of interrogation windows away from the interrogation
280+
window of interest
281+
272282
Returns
273283
-------
274284
275-
flag : boolean 2d np.ndarray
276-
a boolean array. True elements corresponds to outliers.
285+
ind : boolean 2d np.ndarray
286+
a boolean array; true elements corresponds to outliers
277287
278288
"""
279289

0 commit comments

Comments
 (0)