openpiv_cxx.validate.normalized_local_median¶
- openpiv_cxx.validate.normalized_local_median(u, v, threshold_u=3.0, threshold_v=3.0, threshold=None, size=2, kernel_min_size=1, eps=0.1)¶
Eliminate spurious vectors with a local normalized median threshold.
This validation method tests for the spatial consistency of the data. Vectors are classified as outliers and replaced with Nan (Not a Number) if the absolute difference with the local median is greater than a user specified threshold. The median is computed for both velocity components.
- Parameters:
u (ndarray) – A two dimensional array containing the u velocity component.
v (ndarray) – A two dimensional array containing the v velocity component.
threshold_u (float) – Threshold for u component.
threshold_v (float) – Threshold for v component.
threshold (float, optional) – Set thresholds for both u and v components.
size (int) – The radius of the median kernel.
kernel_min_size (int) – The minimum amount of non-NaN values in a kernel. If less, the kernel is marked as invalid due to not enough valid points.
eps (float) – Epsilon, should remain bewteen 0.1 and 0.2.
- Returns:
mask – A boolean or integer array where elemtents that = 0 are valid and 1 = invalid.
- Return type:
ndarray