pelagos_py.steps.quality_control.valid_profile_qc#
- class pelagos_py.steps.quality_control.valid_profile_qc.valid_profile_qc(data, **kwargs)[source]#
Bases:
pelagos_py.steps.base_qc.BaseQCFlag whole profiles that are too short or never reach a target depth range.
Target variable:PROFILE_NUMBERVariables flagged:PROFILE_NUMBERFlags applied: 1 (good), 3 (probably bad), 4 (bad), 9 (missing)Each profile (a group of measurements sharing a
PROFILE_NUMBER, as produced by Find Profiles) is assessed as a whole and every row in that profile receives the samePROFILE_NUMBER_QC:9 (missing) — the row has no profile (
PROFILE_NUMBERis NaN, e.g. surfacing rows or data gaps).4 (bad) — the profile contains fewer than
profile_lengthmeasurements.3 (probably bad) — the profile is long enough but has no measurement whose
DEPTHfalls insidedepth_range.1 (good) — the profile passes both checks.
Only
PROFILE_NUMBER_QCis written; the underlying data is never modified.- Parameters:
profile_length (int, optional) – Minimum number of measurements a profile must contain to be kept. Profiles shorter than this are flagged bad (4). Default
100.depth_range (tuple of float, optional) –
(min, max)depth window (in the same units/sign convention asDEPTH, i.e. negative downward) that a profile must reach into. A profile with no data inside this window is flagged probably bad (3). Default(-1000, 0).
Examples
The check works with its defaults, so the minimal configuration sets no parameters:
- name: "Apply QC" parameters: qc_settings: valid profile qc: {}
Both parameters may be tuned — here profiles must be at least 50 points long and contain data somewhere between 1000 m depth and the surface:
- name: "Apply QC" parameters: qc_settings: valid profile qc: profile_length: 50 depth_range: [-1000, 0] diagnostics: true # plot DEPTH vs index, coloured by the resulting flag