glidertools.processing.calc_backscatter

glidertools.processing.calc_backscatter(bb_raw, tempC, salt, dives, depth, wavelength, dark_count, scale_factor, spike_window=7, spike_method='median', iqr=3, profiles_ref_depth=300, deep_multiplier=1, deep_method='median', return_figure=False, verbose=True)

The function processes the raw backscattering data in counts into total backscatter (bbp) in metres.

The function uses a series of steps to clean the data before applying the Zhang et al. (2009) functions to convert the data into total backscatter (bbp/m)). The function uses functions from the flo_functions toolkit [1]. The theta angle of sensors (124deg) and xfactor for theta 124 (1.076) are set values that should be updated if you are not using a WetLabs ECO BB2FL

The following standard sequence is applied:

  1. find IQR outliers (i.e. data values outside of the lower and upper limits calculated by cleaning.outlier_bounds_iqr)

  2. find_bad_profiles (e.g. high values below 300 m are counted as bad profiles)

  3. flo_scale_and_offset (factory scale and offset)

  4. flo_bback_total (total backscatter based on Zhang et al. 2009) [2]

  5. backscatter_dark_count (based on Briggs et al. 2011) [3]

  6. despike (using Briggs et al. 2011 - rolling min–max) [3]

Parameters:
  • bb_raw (np.array / pd.Series, dtype=float, shape=[n, ]) – The raw output from the backscatter channel in counts.

  • tempC (np.array / pd.Series, dtype=float, shape=[n, ]) – The QC’d temperature data in degC.

  • salt (np.array / pd.Series, dtype=float, shape=[n, ]) – The QC’d salinity in PSU.

  • dives (np.array / pd.Series, dtype=float, shape=[n, ]) – The dive count (round is down dives, 0.5 is up dives).

  • depth (np.array / pd.Series, dtype=float, shape=[n, ]) – The depth array in metres.

  • wavelength (int) – The wavelength of the backscatter channel, e.g. 700 nm.

  • dark_count (float) – The dark count factory values from the calibration sheet.

  • scale_factor (float) – The scale factor factory values from the calibration sheet.

  • spike_window (int) – The window size over which to run the despiking method.

  • spike_method (str) – Whether to use a rolling median or combination of min+max filter as the despiking method.

  • iqr (int) – Multiplier to determine the lower and upper limits of the interquartile range for outlier detection.

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

  • deep_multiplier (int=1) – The standard deviation multiplier for calculating outliers, i.e. \(\mu \pm \sigma \cdot[1]\).

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

  • return_figure (bool) – If True, will return a figure object that shows before and after the quenching correction was applied.

  • verbose (bool) – If True, will print the progress of the processing function.

Returns:

  • baseline (numpy.ma.masked_array) – The despiked + bad profile identified backscatter with the mask denoting the filtered values of the backscatter baseline as defined in Briggs et al. (2011).

  • quench_corrected (np.array / pd.Series, dtype=float, shape=[n, ]) – The backscatter spikes as defined in Briggs et al. (2011).

  • figs (object) – The figures reporting the despiking, bad profiles and quenching correction.

References