跑道观测推送时间修正为AMSC/AMOS观测时间,显示HH:MM格式
This commit is contained in:
@@ -66,6 +66,9 @@ function buildFallbackCityDetail(name: string, depth: string, summary: Record<st
|
|||||||
sunshine_hours: null,
|
sunshine_hours: null,
|
||||||
},
|
},
|
||||||
multi_model: {},
|
multi_model: {},
|
||||||
|
multi_model_daily: {},
|
||||||
|
source_forecasts: {},
|
||||||
|
hourly: { times: [], temps: [], radiation: [] },
|
||||||
probabilities: {
|
probabilities: {
|
||||||
mu: null,
|
mu: null,
|
||||||
distribution: [],
|
distribution: [],
|
||||||
|
|||||||
@@ -98,9 +98,9 @@ export function DetailMiniTemperatureChart({ detail }: { detail: CityDetail }) {
|
|||||||
x: {
|
x: {
|
||||||
grid: { color: "rgba(255,255,255,0.03)" },
|
grid: { color: "rgba(255,255,255,0.03)" },
|
||||||
ticks: {
|
ticks: {
|
||||||
callback: (_value, index) =>
|
callback: (value, index) =>
|
||||||
typeof index === "number" && index % 4 === 0
|
typeof index === "number" && index % 4 === 0
|
||||||
? chartData.times[index]
|
? String(value)
|
||||||
: "",
|
: "",
|
||||||
color: "#6B7A90",
|
color: "#6B7A90",
|
||||||
font: { size: 10 },
|
font: { size: 10 },
|
||||||
|
|||||||
@@ -174,9 +174,9 @@ export const AiCityTemperatureChart = memo(function AiCityTemperatureChart({ det
|
|||||||
x: {
|
x: {
|
||||||
grid: { color: "rgba(159, 178, 199, 0.08)" },
|
grid: { color: "rgba(159, 178, 199, 0.08)" },
|
||||||
ticks: {
|
ticks: {
|
||||||
callback: (_value, index) =>
|
callback: (value, index) =>
|
||||||
typeof index === "number" && index % 3 === 0
|
typeof index === "number" && index % 3 === 0
|
||||||
? chartData.times[index]
|
? String(value)
|
||||||
: "",
|
: "",
|
||||||
color: "#6B7A90",
|
color: "#6B7A90",
|
||||||
font: { size: 10 },
|
font: { size: 10 },
|
||||||
|
|||||||
@@ -370,13 +370,16 @@ export function getTemperatureChartData(
|
|||||||
const hourly = detail.hourly || {};
|
const hourly = detail.hourly || {};
|
||||||
const rawTimes = Array.isArray(hourly.times) ? hourly.times : [];
|
const rawTimes = Array.isArray(hourly.times) ? hourly.times : [];
|
||||||
const rawTemps = Array.isArray(hourly.temps) ? hourly.temps : [];
|
const rawTemps = Array.isArray(hourly.temps) ? hourly.temps : [];
|
||||||
const times = rawTimes
|
const validEntries = rawTimes
|
||||||
.map((time) => String(time || "").trim())
|
.map((time, index) => ({
|
||||||
.filter(Boolean);
|
tail: String(time || "").trim(),
|
||||||
const temps = times.map((_, index) => {
|
value: Number(rawTemps[index]),
|
||||||
const value = Number(rawTemps[index]);
|
}))
|
||||||
return Number.isFinite(value) ? value : null;
|
.filter((entry) => entry.tail !== "");
|
||||||
});
|
const times = validEntries.map((entry) => entry.tail);
|
||||||
|
const temps = validEntries.map((entry) =>
|
||||||
|
Number.isFinite(entry.value) ? entry.value : null,
|
||||||
|
);
|
||||||
const suppressAnkaraMgmObservation = isTurkishMgmCity(detail);
|
const suppressAnkaraMgmObservation = isTurkishMgmCity(detail);
|
||||||
|
|
||||||
if (!times.length) return null;
|
if (!times.length) return null;
|
||||||
|
|||||||
@@ -990,7 +990,10 @@ def _run_high_freq_airport_cycle(
|
|||||||
|
|
||||||
# 用观测数据时间而非当前本地时间
|
# 用观测数据时间而非当前本地时间
|
||||||
airport_cur = city_weather.get("airport_current") or {}
|
airport_cur = city_weather.get("airport_current") or {}
|
||||||
obs_local = airport_cur.get("obs_time") or city_weather.get("local_time") or ""
|
amos_obs = (city_weather.get("amos") or {}).get("observation_time_local") or ""
|
||||||
|
if amos_obs and len(str(amos_obs)) >= 16:
|
||||||
|
amos_obs = str(amos_obs)[11:16] # "2026-05-15 17:32:00" → "17:32"
|
||||||
|
obs_local = amos_obs or airport_cur.get("obs_time") or city_weather.get("local_time") or ""
|
||||||
message = _build_airport_status_message(city, city_weather, deb_pred, obs_local)
|
message = _build_airport_status_message(city, city_weather, deb_pred, obs_local)
|
||||||
|
|
||||||
sent = False
|
sent = False
|
||||||
|
|||||||
Reference in New Issue
Block a user