mostlyright.weather.qc.rules_nwp
mostlyright.weather.qc.rules_nwp
Section titled “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_totalrule (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 > 50likely outside domain).
Worst-case: suspect > flagged > clean.
Functions
Section titled “Functions”apply_rules(rules, row) | Apply rules to row and return the worst-case status. |
|---|
Classes
Section titled “Classes”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.
- Parameters:
Stable identifier for telemetry / rule-fired counters.
column
Section titled “column”Canonical column the rule reads (for documentation).
predicate
Section titled “predicate”row -> "clean" | "flagged" | "suspect".
rationale
Section titled “rationale”Human-readable why-this-rule-exists.
column : str
Section titled “column : str”predicate : Callable[[dict[str, Any]], Literal['clean', 'flagged', 'suspect']]
Section titled “predicate : Callable[[dict[str, Any]], Literal['clean', 'flagged', 'suspect']]”rationale : str
Section titled “rationale : str”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.