Skip to content

mostlyright.weather.qc.rules_nwp

Per-model NWP QC physics-bounds rule registry (Phase 17 PLAN-10, FORECAST-19).

Replaces the Phase 3.2 inline _qc_status_for_row (HRRR/GFS/NBM uniform) with a per-model registry. Per-family inheritance:

  • RULES_NWP_NCEP — 7 baseline rules (temp / dewpoint / RH / gust / precip mm/h / surface pressure / MSLP).
  • RULES_NWP_ECMWF — NCEP base + precip_m_total rule (ECMWF tp is METERS, not mm — > 0.305 m/h flagged; < 0 suspect).
  • RULES_NWP_GEFS — NCEP base + ensemble-dispersion placeholder (full member-aware aggregation lands in v1.1).
  • RULES_NWP_HAFS — NCEP base + storm-basin-latitude sanity (HAFS basins are 0..60 N; outside is sensor error).
  • RULES_NWP_MSC_HRDPS — NCEP base + regional-grid bounds (HRDPS continental covers N. America; grid_dist_km > 50 likely outside domain).

Worst-case: suspect > flagged > clean.

apply_rules(rules, row)Apply rules to row and return the worst-case status.
QCRule(name, column, predicate, rationale)A single physics-bounds rule.

class mostlyright.weather.qc.rules_nwp.QCRule(name, column, predicate, rationale)

Section titled “class mostlyright.weather.qc.rules_nwp.QCRule(name, column, predicate, rationale)”

Bases: object

A single physics-bounds rule.

Stable identifier for telemetry / rule-fired counters.

Canonical column the rule reads (for documentation).

row -> "clean" | "flagged" | "suspect".

Human-readable why-this-rule-exists.

mostlyright.weather.qc.rules_nwp.apply_rules(rules, row)

Section titled “mostlyright.weather.qc.rules_nwp.apply_rules(rules, row)”

Apply rules to row and return the worst-case status.