pelagos_py.steps.processing.salinity#

class pelagos_py.steps.processing.salinity.AdjustSalinity(name, parameters=None, diagnostics=False, context=None)[source]#

Bases: pelagos_py.steps.base_step.BaseStep, pelagos_py.utils.qc_handling.QCHandlingMixin

Corrects conductivity- and temperature-related sensor errors so that salinity can be derived cleanly from a glider CTD.

Two corrections are applied in sequence to the dataset:

  • Conductivity-temperature lag (C-T lag). Conductivity and temperature are measured by separate sensors with different response times, so the two records are slightly misaligned and produce salinity spikes at sharp gradients. correct_ct_lag() estimates the optimal time shift between CNDC and TEMP from a sample of profiles and applies the median shift to the whole dataset, following Woo (2019) [3].

  • Thermal-mass (thermal lag) error. The conductivity cell stores and releases heat, so the temperature of the water inside it lags the ambient temperature. correct_thermal_lag() reconstructs the in-cell temperature with the recursive filter and fixed coefficients of Morison et al. (1994) [1].

The thermal-mass coefficients (alpha/tau) are taken directly from Morison et al. (1994) and are not re-optimised in T/S space, as done by Morison et al. (1994) or Garau et al. (2011) [2]. They are appropriate for a pumped Sea-Bird CT sail at the conductivity-cell flow rate reported by Woo (2019); unpumped CTDs would require the flow rate to be derived from the glider’s velocity through the water (e.g. from pitch or a flight model).

Parameters:

filter_window_size (int, optional) – Length, in samples, of the running-average filter used when searching for the optimal C-T lag. Must be odd. Default 21.

Examples

Example usage in a pipeline configuration:

steps:
  - name: "ADJ: Salinity"
    parameters:
      filter_window_size: 21
    diagnostics: false

References

[1]

Morison, J., Andersen, R., Larson, N., D’Asaro, E., & Boyd, T. (1994). The correction for thermal-lag effects in Sea-Bird CTD data. Journal of Atmospheric and Oceanic Technology, 11(4), 1151-1164.

[2]

Garau, B., Ruiz, S., Zhang, W. G., Pascual, A., Heslop, E., Kerfoot, J., & Tintoré, J. (2011). Thermal lag correction on Slocum CTD glider data. Journal of Atmospheric and Oceanic Technology, 28(9), 1065-1071.

[3]

Woo, L. M. (2019). Delayed Mode QA/QC Best Practice Manual Version 2.0. Integrated Marine Observing System. DOI: 10.26198/5c997b5fdc9bd (http://dx.doi.org/10.26198/5c997b5fdc9bd).

correct_ct_lag()[source]#

Align conductivity to temperature to suppress salinity spikes.

Conductivity and temperature are measured by separate sensors whose physical offset and differing response times leave the two records slightly out of phase, producing salinity spikes at sharp gradients.

For a random sample of up to 100 qualifying profiles, the optimal time shift of CNDC relative to TEMP is found by minimising the standard deviation of (salinity - running-average salinity) — the approach used by RBR’s pyRSKtools — rather than comparing downcast against upcast as originally described by Woo (2019). The median of the per-profile lags is then applied to CNDC across the whole dataset.

Trial lags run from -2 s to +2 s in 0.1 s steps. Only profiles longer than one hour with more than 3 * filter_window_size samples contribute to the median.

Notes

Operates in place on self.data. self.ct_lag_median is stored for the diagnostics dashboard.

correct_thermal_lag()[source]#

Correct the thermal-mass error in temperature.

The conductivity cell stores and releases heat, so the temperature of the water inside it lags the ambient temperature and biases the derived salinity. This reconstructs the in-cell temperature for each profile using the recursive filter of Morison et al. (1994) (their eq. 5), which does not require the sensitivity of temperature to conductivity (their eq. 2).

The amplitude (alpha) and time-constant (tau) coefficients are the fixed values of Morison et al. (1994), scaled by the conductivity-cell flow rate reported by Woo (2019); they are not re-optimised in T/S space (cf. Garau et al., 2011). Temperature is resampled to 1 Hz for the filter and interpolated back onto the original sampling.

Notes

Operates in place on self.data.

generate_diagnostics()[source]#

Displays a comprehensive diagnostics dashboard detailing applied adjustments to conductivity and temperature, along with overall impacts on the dataset.