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.BaseQC

Flag 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 _QC column is counted per profile (grouped by PROFILE_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’ _QC columns 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>_QC has all of that variable’s points flagged bad. Required; each listed variable and its _QC column 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
return_qc()[source]#

Representative of QC processing, to be overridden by subclasses.

Returns:

flags – Output QC flags for the data specific to the test.

Return type:

array-like

plot_diagnostics()[source]#

Representative of diagnostic plotting (optional).