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(