openpiv_cxx.validate.local_median¶
- openpiv_cxx.validate.local_median(u, v, threshold_u=3.0, threshold_v=3.0, threshold=None, size=2, kernel_min_size=1)¶
Eliminate spurious vectors with a local 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.
- Returns:
mask – An integer array where elemtents that = 0 are valid and 1 = invalid.
- Return type:
ndarray