fix: use multi-model peak window for gaussian probability

This commit is contained in:
2569718930@qq.com
2026-05-28 10:03:29 +08:00
parent fb4a9d7e09
commit be549daf50
4 changed files with 148 additions and 18 deletions
+2 -7
View File
@@ -30,6 +30,7 @@ from src.analysis.deb_hourly_correction import (
get_cached_hourly_peak_corrector,
)
from src.analysis.settlement_rounding import apply_city_settlement
from src.analysis.trend_engine import _resolve_peak_hours
from src.data_collection.country_networks import build_country_network_snapshot
from src.data_collection.city_registry import ALIASES, CITY_REGISTRY
from src.data_collection.city_time import get_city_utc_offset_seconds
@@ -1187,13 +1188,7 @@ def _analyze(
h_lifted_index = [None for _ in parsed_obs]
h_boundary_layer_height = [None for _ in parsed_obs]
peak_hours = []
if h_times and h_temps and om_today is not None:
for ts, tmp in zip(h_times, h_temps):
if ts.startswith(local_date_str) and abs(tmp - om_today) <= 0.2:
hr = int(ts.split("T")[1][:2])
if 8 <= hr <= 19:
peak_hours.append(ts.split("T")[1][:5])
peak_hours = _resolve_peak_hours(raw, local_date_str, h_times, h_temps, om_today)
first_peak_h = int(peak_hours[0].split(":")[0]) if peak_hours else 13
last_peak_h = int(peak_hours[-1].split(":")[0]) if peak_hours else 15