glidertools.optics.quenching_correction

glidertools.optics.quenching_correction(flr, bbp, dives, depth, time, lat, lon, max_photic_depth=100, night_day_group=True, surface_layer=5, sunrise_sunset_offset=1)

Corrects the fluorescence data based upon Thomalla et al. (2017).

The function calculates the quenching depth and performs the quenching correction based on the fluorescence to backscatter ratio. The quenching depth is calculated based upon the different between night and daytime fluorescence. The default setting is for the preceding night to be used to correct the following day’s quenching (night_day_group=True). This can be changed so that the following night is used to correct the preceding day. The quenching depth is then found from the difference between the night and daytime fluorescence, using the steepest gradient of the {5 minimum differences and the points the difference changes sign (+ve/-ve)}. The function gets the backscatter/fluorescence ratio between from the quenching depth to the surface, and then calculates a mean nighttime ratio for each night. The quenching ratio is calculated from the nighttime ratio and the daytime ratio, which is then applied to fluorescence to correct for quenching. If the corrected value is less than raw, then the function will return the original raw data.

Parameters:
  • flr (numpy.ndarray or pandas.Series) – fluorescence data after cleaning and factory calibration conversion

  • bbp (numpy.ndarray or pandas.Series) – Total backscatter after cleaning and factory calibration conversion

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

  • time (numpy.ndarray or pandas.Series) – The date & time array in a numpy.datetime64 format.

  • lat (numpy.ndarray or pandas.Series) – The latitude of the glider position.

  • lon (numpy.ndarray or pandas.Series) – The longitude of the glider position.

  • max_photic_depth (int) – Limit the quenching correction to depth less than a given value [100].

  • night_day_group (bool) – If True, use preceding night otherwise use following night for calculating the flr:bbp ratio.

  • surface_layer (int) – The surface depth that is omitted from the correction calculations (metres)

  • sunrise_sunset_offset (int) – The delayed onset and recovery of quenching in hours [1] (assumes symmetrical).

Returns:

  • flr_corrected (numpy.ndarray or pandas.Series) – The fluorescence data corrected for quenching.

  • quenching layer (bool) – A boolean mask of where the fluorescence is quenched.