pelagos_py.steps.quality_control.flag_full_profile#
- class pelagos_py.steps.quality_control.flag_full_profile.flag_full_profile(data, **kwargs)[source]#
Bases:
pelagos_py.steps.base_qc.BaseQCFlag an entire profile once it accumulates too many bad measurements.
Target variable: user-defined (dynamic)Variables flagged: the same user-defined variable(s)Flag applied: 4 (bad)For each variable in
check_vars, the number of bad (4) flags in its_QCcolumn is counted per profile (grouped byPROFILE_NUMBER, as produced by Find Profiles). If a profile’s count reaches the variable’s threshold, every measurement of that variable in the profile is set to bad (4) — the rationale being that a profile riddled with bad points is untrustworthy as a whole.Each variable is evaluated independently against its own threshold, and only the listed variables’
_QCcolumns are modified.- Parameters:
check_vars (dict) – Mapping of variable name to an integer threshold, e.g.
{"PRES": 10, "CHLA": 20}. A profile with at least that many bad (4) flags in<variable>_QChas all of that variable’s points flagged bad. Required; each listed variable and its_QCcolumn must be present in the dataset.
Examples
Flag any profile that contains 10 or more bad pressure points (and, separately, 20 or more bad chlorophyll points):
- name: "Apply QC" parameters: qc_settings: flag full profile: check_vars: PRES: 10 CHLA: 20 diagnostics: true # plot each variable vs index, coloured by flag