glidertools.cleaning.horizontal_diff_outliers

glidertools.cleaning.horizontal_diff_outliers(dives, depth, arr, multiplier=1.5, depth_threshold=450, mask_frac=0.2)

Find Z-score outliers (> 3) on the horizontal. Can be limited below a certain depth.

The function uses the horizontal gradient as a threshold, below a defined depth threshold to find outliers. Useful to identify when a variable at depth is not the same as neighbouring values.

Parameters:
  • dives (numpy.ndarray or pandas.Series) – The dive count (round is down dives, 0.5 is up dives)

  • depth (numpy.ndarray or pandas.Series) – The depth array in metres

  • arr (numpy.ndarray or pandas.Series) – Array of data variable for cleaning to be performed on.

  • multiplier (float) – A z-score threshold

  • depth_threshold (int) – Outliers will be identified below this depth value to the max depth value of the dive.

  • mask_frac (float) – When the ratio of bad values per dive is greater than this value, then the dive will be masked.

Returns:

A mask of dives where the bad values per dive ratio is greater than mask_frac.

Return type:

mask