新增 AEROWEB (Météo-France) 和 NCM (沙特) 实时气象数据源

AEROWEB: 接入 aviation.meteo.fr,LFPB METAR 2 分钟内可获取,
实测温度替代 AROME 模式预报作为 Paris 电报推送数据源。
登录流程: PHPSESSID + MD5 密码 → ajax/login_valid.php,
Session 20 分钟自动续期,XML 解析提取 tempe/td/dd/ff/qnh。

NCM: 沙特气象局 Meteomatics API 代码框架,待凭证激活。
Jeddah settlement_source 从废弃的 wunderground 迁移至 ncm。

同时清理: 日志文件 trading_system.log → polyweather.log,
删除 2026-02-07 的 1.2MB 废弃交易引擎日志。

Constraint: AEROWEB 需 AEROWEB_USERNAME/AEROWEB_PASSWORD 环境变量
Constraint: NCM 需 NCM_API_USERNAME/NCM_API_PASSWORD 环境变量
Confidence: high
Tested: AEROWEB 登录→取数→解析端到端验证通过
This commit is contained in:
2569718930@qq.com
2026-05-22 21:50:37 +08:00
parent 41d740d611
commit 891b4d2422
8 changed files with 568 additions and 14 deletions
+1 -1
View File
@@ -17,7 +17,7 @@ def setup_logger(level="DEBUG"):
# 文件输出
logger.add(
"data/logs/trading_system.log",
"data/logs/polyweather.log",
rotation="10 MB",
retention="10 days",
level=level,
+9 -6
View File
@@ -1236,12 +1236,15 @@ def _process_airport_city(
if not current_obs_time:
current_obs_time = str(airport_primary.get("obs_time") or "")
if city == "paris":
arome_temp = _fetch_arome_temp()
if arome_temp is not None:
current_temp = arome_temp
city_weather.setdefault("current", {})["temp"] = arome_temp
if not current_obs_time:
current_obs_time = datetime.now(timezone.utc).strftime("%Y-%m-%dT%H:%M:%S")
# AEROWEB provides real observations; prefer over AROME model nowcast
airport_primary = city_weather.get("airport_primary") or {}
if airport_primary.get("source_code") != "aeroweb":
arome_temp = _fetch_arome_temp()
if arome_temp is not None:
current_temp = arome_temp
city_weather.setdefault("current", {})["temp"] = arome_temp
if not current_obs_time:
current_obs_time = datetime.now(timezone.utc).strftime("%Y-%m-%dT%H:%M:%S")
if current_temp is None or deb_pred is None:
return None