fix(forecast): no nightly gaps in the issued model forecasts
The P.1 chart's "24 h peak, as issued" line had a gap every night and a dip at 21:00. Two causes: - A run forecasts from the newest reading only. RID publishes 22:00..06:00 in one batch in the morning (and now and then one hour late), so those hours were never forecast from. After each run the collector now forecasts the hours of the last 48 h (two weeks on the first run after a start) that have a RID reading but no model forecast, each as a run at that hour would have: gauges, HII fill and dam state up to that hour. Rain is fetched once, so a late hour's rain_fc24 partly holds rain that has since fallen (as in training). Only missing (hour, station) pairs are written. `ping-collector catch-up-forecasts --hours N` goes further back. - Overnight each hourly run re-issues the 21:00 reading, after 6 h as the heuristic, which overwrote the 21:00 model row. A heuristic row no longer replaces a model row in forecast_history. The dashboard draws only model rows on the issued line. Checked on a local copy of 18 days of RID data: the catch-up of an hour matches `ping-collector forecast --now <hour>`; 288 hours took 20 s (debug build). Tests for both database rules.
This commit is contained in:
1 parent
cf10f2e4c8
commit
180d95c6bd
10 files changed
+311
-3
No files matched your search
@@ -139,6 +139,8 @@ def test_history_reaches_today():
|
||||
html = _html()
|
||||
assert "hours=${hours}&limit=100000" in html
|
||||
assert "/api/forecast/history/" in html
|
||||
# the issued line is the model's; a heuristic row (the level itself) dips
|
||||
assert "r.predicted_max_level != null && r.source === 'model'" in html
|
||||
|
||||
|
||||
def test_skill_loads_only_when_opened():
|
||||
|
||||
Reference in new issue
Block a user