巴黎推送标明数据源:AEROWEB 实况或 AROME HD 临近预报
This commit is contained in:
@@ -946,12 +946,14 @@ export function LiveTemperatureThresholdChart({
|
|||||||
const isHKO = cityKey === 'hong kong' || cityKey === 'lau fau shan' || cityKey.includes('hongkong') || cityKey.includes('laufau');
|
const isHKO = cityKey === 'hong kong' || cityKey === 'lau fau shan' || cityKey.includes('hongkong') || cityKey.includes('laufau');
|
||||||
const isTokyo = cityKey === 'tokyo';
|
const isTokyo = cityKey === 'tokyo';
|
||||||
const isSingapore = cityKey === 'singapore';
|
const isSingapore = cityKey === 'singapore';
|
||||||
|
const isParis = cityKey === 'paris';
|
||||||
const isWeatherStation = !runwaySensorCities.has(cityKey)
|
const isWeatherStation = !runwaySensorCities.has(cityKey)
|
||||||
&& !isHKO && !isTokyo && !isSingapore;
|
&& !isHKO && !isTokyo && !isSingapore && !isParis;
|
||||||
|
|
||||||
const runwayHeaderLabel = isHKO ? '参考站点 (1分钟)'
|
const runwayHeaderLabel = isHKO ? '参考站点 (1分钟)'
|
||||||
: isTokyo ? '机场气象站 (10分钟)'
|
: isTokyo ? '机场气象站 (10分钟)'
|
||||||
: isSingapore ? '航站楼温度'
|
: isSingapore ? '航站楼温度'
|
||||||
|
: isParis ? '官方机场观测 (15分钟)'
|
||||||
: isWeatherStation ? '气象站实测'
|
: isWeatherStation ? '气象站实测'
|
||||||
: '跑道实测 (1分钟)';
|
: '跑道实测 (1分钟)';
|
||||||
|
|
||||||
@@ -961,6 +963,7 @@ export function LiveTemperatureThresholdChart({
|
|||||||
const runwayHighLabel = isHKO ? '参考站点'
|
const runwayHighLabel = isHKO ? '参考站点'
|
||||||
: isTokyo ? '机场气象站'
|
: isTokyo ? '机场气象站'
|
||||||
: isSingapore ? '航站楼'
|
: isSingapore ? '航站楼'
|
||||||
|
: isParis ? '官方机场观测'
|
||||||
: isWeatherStation ? '气象站'
|
: isWeatherStation ? '气象站'
|
||||||
: '跑道实测';
|
: '跑道实测';
|
||||||
|
|
||||||
|
|||||||
@@ -947,6 +947,7 @@ def _build_airport_status_message(
|
|||||||
deb_pred: Optional[float],
|
deb_pred: Optional[float],
|
||||||
local_time: str = "",
|
local_time: str = "",
|
||||||
state: str = "",
|
state: str = "",
|
||||||
|
source_label: str = "",
|
||||||
) -> str:
|
) -> str:
|
||||||
_AIRPORT_EN = {"seoul": "Incheon", "singapore": "Changi", "busan": "Gimhae", "tokyo": "Haneda",
|
_AIRPORT_EN = {"seoul": "Incheon", "singapore": "Changi", "busan": "Gimhae", "tokyo": "Haneda",
|
||||||
"ankara": "Esenboğa", "helsinki": "Vantaa", "amsterdam": "Schiphol",
|
"ankara": "Esenboğa", "helsinki": "Vantaa", "amsterdam": "Schiphol",
|
||||||
@@ -1118,6 +1119,10 @@ def _build_airport_status_message(
|
|||||||
else:
|
else:
|
||||||
lines.append(f"DEB:{deb_pred:.1f}{temp_symbol}")
|
lines.append(f"DEB:{deb_pred:.1f}{temp_symbol}")
|
||||||
|
|
||||||
|
if source_label:
|
||||||
|
lines.append("")
|
||||||
|
lines.append(f"📡 {source_label}")
|
||||||
|
|
||||||
# Model summary (compact)
|
# Model summary (compact)
|
||||||
models = city_weather.get("multi_model") or {}
|
models = city_weather.get("multi_model") or {}
|
||||||
if isinstance(models, dict) and len(models) >= 2:
|
if isinstance(models, dict) and len(models) >= 2:
|
||||||
@@ -1299,14 +1304,17 @@ def _process_airport_city(
|
|||||||
current_temp = airport_primary.get("temp") or (city_weather.get("current") or {}).get("temp")
|
current_temp = airport_primary.get("temp") or (city_weather.get("current") or {}).get("temp")
|
||||||
if not current_obs_time:
|
if not current_obs_time:
|
||||||
current_obs_time = str(airport_primary.get("obs_time") or "")
|
current_obs_time = str(airport_primary.get("obs_time") or "")
|
||||||
|
source_label = "" # human-readable data source for Paris messages
|
||||||
if city == "paris":
|
if city == "paris":
|
||||||
# AEROWEB provides real observations; prefer over AROME model nowcast
|
|
||||||
airport_primary = city_weather.get("airport_primary") or {}
|
airport_primary = city_weather.get("airport_primary") or {}
|
||||||
if airport_primary.get("source_code") != "aeroweb":
|
if airport_primary.get("source_code") == "aeroweb":
|
||||||
|
source_label = "AEROWEB 机场实况 · Météo-France"
|
||||||
|
else:
|
||||||
arome_temp = _fetch_arome_temp()
|
arome_temp = _fetch_arome_temp()
|
||||||
if arome_temp is not None:
|
if arome_temp is not None:
|
||||||
current_temp = arome_temp
|
current_temp = arome_temp
|
||||||
city_weather.setdefault("current", {})["temp"] = arome_temp
|
city_weather.setdefault("current", {})["temp"] = arome_temp
|
||||||
|
source_label = "AROME HD 15分钟临近预报 · Météo-France"
|
||||||
if not current_obs_time:
|
if not current_obs_time:
|
||||||
current_obs_time = datetime.now(timezone.utc).strftime("%Y-%m-%dT%H:%M:%S")
|
current_obs_time = datetime.now(timezone.utc).strftime("%Y-%m-%dT%H:%M:%S")
|
||||||
if current_temp is None or deb_pred is None:
|
if current_temp is None or deb_pred is None:
|
||||||
@@ -1352,7 +1360,7 @@ def _process_airport_city(
|
|||||||
or city_weather.get("local_time")
|
or city_weather.get("local_time")
|
||||||
or ""
|
or ""
|
||||||
)
|
)
|
||||||
message = _build_airport_status_message(city, city_weather, deb_pred, obs_local, state="")
|
message = _build_airport_status_message(city, city_weather, deb_pred, obs_local, state="", source_label=source_label)
|
||||||
|
|
||||||
# Send to all target chats
|
# Send to all target chats
|
||||||
sent = False
|
sent = False
|
||||||
|
|||||||
Reference in New Issue
Block a user