From 80e46c8476bf904d007cd37ac3b58254876d7592 Mon Sep 17 00:00:00 2001 From: duxin Date: Tue, 28 Jul 2026 17:25:41 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=8D=95=E6=AD=A5=E6=A8=A1=E5=BC=8F?= =?UTF-8?q?=E4=B8=8B=E8=87=AA=E5=8A=A8=E5=8F=91=E7=8E=B0=E8=80=80=E6=96=91?= =?UTF-8?q?=E6=8E=A9=E8=86=9C=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 单步运行时 PipelineContext 不保留 step2 的 glint_mask_path, 导致采样时无法剔除耀斑区域 - 新增自动发现:兜底扫描 2_Glint_Detection/severe_glint_area.dat - 补充缺失的 import os --- src/core/handlers/step4_sampling.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/core/handlers/step4_sampling.py b/src/core/handlers/step4_sampling.py index 9a3834c..4ea81aa 100644 --- a/src/core/handlers/step4_sampling.py +++ b/src/core/handlers/step4_sampling.py @@ -7,6 +7,7 @@ Step4 处理器:预测采样点生成 剥离为独立的 Step4SamplingHandler。 """ +import os import time from typing import Any, Dict @@ -35,6 +36,15 @@ class Step4SamplingHandler(BaseStepHandler): glint_mask_path = self._resolve_path( config.get('glint_mask_path'), context.glint_mask_path, 'glint_mask' ) + # ★ 自动发现:单步模式下 context 无缓存,兜底扫描标准目录 + if not glint_mask_path: + _glint_dir = context.glint_dir if context.glint_dir else os.path.join( + str(context.work_dir), '2_Glint_Detection') + _candidate = os.path.join(str(_glint_dir), 'severe_glint_area.dat') + if os.path.isfile(_candidate): + glint_mask_path = _candidate + context.notify('step4_sampling', 'info', + f'自动发现耀斑掩膜: {_candidate}') try: result = PredictionStep.generate_sampling_points(