glidertools.processing.calc_fluorescence
- glidertools.processing.calc_fluorescence(flr_raw, bbp, dives, depth, time, lat, lon, dark_count, scale_factor, spike_window=7, spike_method='median', night_day_group=True, sunrise_sunset_offset=1, profiles_ref_depth=300, deep_multiplier=1, deep_method='median', return_figure=False, verbose=True)
This function processes raw fluorescence and corrects for quenching using the Thomalla et al. (2018) approach [1].
The following standard sequence is applied:
find_bad_profiles (e.g. high Fluorescence in > 300 m water signals bad profile)
fluorescence_dark_count & scale factor (i.e. factory correction)
despike (using Briggs et al. 2011 - rolling min–max)
quenching_correction (corrects for quenching with Thomalla et al. 2017)
- Parameters:
flr_raw (np.array / pd.Series, dtype=float, shape=[n, ]) – The raw output of fluorescence data in instrument counts.
bbp (np.array / pd.Series, dtype=float, shape=[n, ]) – The processed backscatter data from the less noisy channel, i.e. the one dataset with less spikes or bad profiles.
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.
time (np.array / pd.Series, dtype=float, shape=[n, ]) – The date & time array in a numpy.datetime64 format.
lat (np.array / pd.Series, dtype=float, shape=[n, ]) – The latitude of the glider position.
lon (np.array / pd.Series, dtype=float, shape=[n, ]) – The longitude of the glider position.
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=7) – The window size over which to run the despiking method.
spike_method (str=median) – Whether to use a rolling median or combination of min+max filter as the despiking method.
night_day_group (bool=True) – If True, use preceding night otherwise use following night for calculating the flr:bbp ratio.
sunrise_sunset_offset (int=1) – The delayed onset and recovery of quenching in hours [1] (assumes symmetrical).
profiles_ref_depth (int=300) – 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. mean ± std x [1].
deep_method (str='median') – Whether to use the deep median or deep mean to determine bad profiles for optics.find_bad_profiles.
return_figure (bool=False) – If True, will return a figure object that shows before and after the quenching correction was applied.
verbose (bool=True) – If True, will print the progress of the processing function.
- Returns:
baseline (array, dtype=float, shape=[n, ]) – The despiked + bad profile identified fluorescence that has not had the quenching correction applied.
quench_corrected (array, dtype=float, shape=[n, ]) – The fluorescence data corrected for quenching.
quench_layer (array, dtype=bool, shape=[n, ]) – The quenching layer as a mask.
figs (object) – The figures reporting the despiking, bad profiles and quenching correction.
References