{# QC-flag legend + per-variable flag-count table with inline bar charts. The `qc` panel payload (kind="html"). The `.qc-bar`/`.qc-legend` style block moved to mooring.html page_styles. #}
good (1) prob. good (2) suspect (3) bad (4) interp. (8) missing (9)
{% set has_qc = instruments | selectattr("qc_summary") | list %} {% if has_qc %} {% set ns = namespace(idx=0) %} {% for instr in instruments %} {% if instr.qc_summary %} {% set ns.idx = ns.idx + 1 %} {% for row in instr.qc_summary %} {% set good = row.flags | selectattr("flag", "eq", 1) | first %} {% set susp = row.flags | selectattr("flag", "eq", 3) | first %} {% set bad = row.flags | selectattr("flag", "eq", 4) | first %} {% set interp = row.flags | selectattr("flag", "eq", 8) | first %} {% set miss = row.flags | selectattr("flag", "eq", 9) | first %} {% endfor %} {% endif %} {% endfor %}
# Type S/N Variable N Good % Suspect % Bad % Interp. % Missing % Distribution
{% if loop.index0 == 0 %}{{ ns.idx }}{% endif %} {% if loop.index0 == 0 %}{{ instr.instr_type }}{% endif %} {% if loop.index0 == 0 %}{{ instr.serial }}{% endif %} {{ row.var }} {{ "{:,}".format(row.total) }} {{ good.pct }} {% if susp.pct > 0 %}{{ susp.pct }}{% else %}–{% endif %} {% if bad.pct > 0 %}{{ bad.pct }}{% else %}–{% endif %} {% if interp.pct > 0 %}{{ interp.pct }}{% else %}–{% endif %} {% if miss.pct > 0 %}{{ miss.pct }}{% else %}–{% endif %}
{% for f in row.flags %} {% if f.pct > 0 %}
{% endif %} {% endfor %}
{% else %}

No stage 3 QC files found — run oceanarray stage3 first.

{% endif %}