glidertools.optics.find_bad_profiles

glidertools.optics.find_bad_profiles(dives, depth, var, ref_depth=None, stdev_multiplier=1, method='median')

Find profiles that exceed a threshold at a reference depth.

This function masks bad dives based on

mean + std x [1] or median + std x [1] at a reference depth.

Function is typically used to clean raw fluorescence and backscatter data.

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.

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

  • ref_depth (int) – The depth threshold for optics.find_bad_profiles below which the median or mean is calculated for identifying outliers.

  • stdev_multiplier (int) – The standard deviation multiplier for calculating outliers, i.e. mean +- std x [1].

  • method (str) – Whether to use the deep median or deep mean to determine bad profiles for optics.find_bad_profiles.

Returns:

  • bad_dive_idx (numpy.ndarray or pandas.Series) – The index of dives where the deep mean/median is greater than the limit

  • bad_dive (mask) – If True, the dive deep mean/median is greater than the limit.