pelagos_py.steps.processing.mixed_layer_depth#
- class pelagos_py.steps.processing.mixed_layer_depth.MixedLayerDepthStep(name, parameters=None, diagnostics=False, context=None)[source]#
Bases:
pelagos_py.steps.base_step.BaseStep,pelagos_py.utils.qc_handling.QCHandlingMixinCalculate the mixed layer depth (MLD) of each profile.
The MLD is found per profile by the threshold method of de Boyer Montégut et al. (2004) [1]: the first depth below
reference_depthat which the chosen variable departs from its reference value by the threshold marks the base of the mixed layer. The reference value is the median of samples within 2.5 m ofreference_depth, so a single noisy sample cannot shift it. Density must increase by the threshold; temperature may change either way.PROFILE_NUMBERandDEPTHmust already be derived. Inputs are read from their_ADJUSTEDversion (e.g.ASAL_ADJUSTED) where one exists. See Mixed Layer Depth.Two derived variables are written on the
N_MEASUREMENTSdimension:MLD, the profile’s mixed layer depth (positive down, matchingDEPTH;NaNwhere undefined), andMLD_BOOL,0above the MLD,1at/below it,NaNwhere undefined. Samples whose flags fall incalculation_flag_filtertake no part in the search, so a bad value cannot place the MLD; both variables are still written for every measurement in the profile.The density method uses potential density (sigma0, referenced to 0 dbar) derived here from
ASALandCONS_TEMP, not the dataset’s in-situDENSITYwhose pressure term alone crosses a typical threshold within a few metres of the surface. The derived sigma0 is not written to the dataset.- Parameters:
method (str, optional) –
"density","temp", or"auto"(default; density if its inputs are present, else temp). An explicit choice whose inputs are missing halts the pipeline.reference_depth (float, optional) – Near-surface reference depth (positive down). Default
10.density_threshold (float, optional) – Density departure (kg/m3) marking the MLD. Default
0.03.temp_threshold (float, optional) – Temperature departure (degC) marking the MLD. Default
0.2.
Examples
steps: - name: Mixed Layer Depth parameters: method: density reference_depth: 10 density_threshold: 0.03 temp_threshold: 0.2 diagnostics: true
References
[1]de Boyer Montégut, C., Madec, G., Fischer, A. S., Lazar, A., & Iudicone, D. (2004). Mixed layer depth over the global ocean: An examination of profile data and a profile-based climatology. Journal of Geophysical Research: Oceans, 109(C12), C12003. https://doi.org/10.1029/2004JC002378