openpiv_cxx.validate.local_difference

openpiv_cxx.validate.local_difference(u, v, mask=None, threshold_u=3.0, threshold_v=3.0, threshold=None, convention='openpiv')

Eliminate spurious vectors with a local threshold.

This validation method tests for the local consistency of the data and outliers vector are replaced with NaN (Not a Number) if there are greater than 4 vector differences that exceed the threshold limit. See reference for more details.

Parameters:
  • u (ndarray) – A two dimensional array containing the u velocity component.

  • v (ndarray) – A two dimensional array containing the v velocity component.

  • mask (ndarray, optional) – A two dimensional array containing the flags for invalid vectors.

  • 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.

  • convention (str) – Which flag convention to use.

Returns:

  • u (ndarray, optional) – A two dimensional array containing the u velocity component, where spurious vectors have been replaced by NaN if convention is set to ‘openpiv’.

  • v (ndarray, optional) – A two dimensional array containing the v velocity component, where spurious vectors have been replaced by NaN if convention is set to ‘openpiv’.

  • mask (ndarray) – A boolean or integer array where elemtents that = 0 are valid and 1 = invalid.