未分類

    def draw_anal_visual_metagram(self, station_combo):
model_name = "ANAL"
ui = self.tab_ui[model_name]
elem_name = ui['list'].currentItem().text()

stat_name = station_combo.currentText()
stat_lat, stat_lon = station_combo.currentData()

combo = ui['init_combo']
count = min(6, combo.count())

# --- 修正箇所:初期値(None)の判定を追加 ---
if count == 0 or combo.itemData(0) is None:
QMessageBox.warning(self, "エラー", "データが存在しません。")
return

times = []
vals = []
u_vals = []
v_vals = []

for i in range(count - 1, -1, -1):
it_str = combo.itemData(i)

# --- 修正箇所:it_strがNoneの場合はスキップしてエラーを回避 ---
if not it_str:
continue

dt_utc = datetime.strptime(it_str, "%Y%m%d%H%M%S")
dt_jst = dt_utc + timedelta(hours=9)
times.append(dt_jst)
# -------------------------------------------------------------

target_file = os.path.join(self.cache_dir, f"ANAL_{it_str}_FT00.npz")