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 a threshold method: from a near-surface reference point, the first depth at which the chosen variable departs from its reference value by more than a threshold marks the base of the mixed layer.
PROFILE_NUMBERandDEPTHmust already be derived.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
ABS_SALINITYandCONS_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