feat(step9): 新增浓度反演模块及 GUI 面板

This commit is contained in:
DXC
2026-06-09 17:55:25 +08:00
parent 4ca90b0e79
commit c3cc2ef77e
6 changed files with 1098 additions and 92 deletions

View File

@ -325,9 +325,11 @@ class WorkerThread(QThread):
'step3': 'step3_remove_glint',
'step4': 'step4_process_csv',
'step5': 'step5_extract_training_spectra',
'step8': 'step8_water_quality_indices',
'step6': 'step6_water_quality_indices',
'step7': 'step7_ml_modeling',
'step8_non_empirical_modeling': 'step8_non_empirical_modeling',
'step8_qaa': 'step8_qaa_inversion',
'step9_concentration': 'step9_concentration_inversion',
'step9': 'step9_custom_regression',
'step10': 'step10_sampling',
'step11_ml': 'step11_ml_prediction',
@ -342,6 +344,19 @@ class WorkerThread(QThread):
method_name = step_method_map[step_name]
step_config = dict(config.get(step_name, {}))
# step8_qaa_inversion 内部使用 config.get('step8_qaa', {}) 读取内层,
# 必须透传完整 config dict(含外层 step_name key)
if step_name == 'step8_qaa':
method = getattr(self.pipeline, method_name)
result = method(**config)
return result
# step9_concentration_inversion 同理,必须透传完整 config dict
if step_name == 'step9_concentration':
method = getattr(self.pipeline, method_name)
result = method(**config)
return result
# 透传面板顶层传入的外部预训练模型(GUI step11_prediction_panel 通过 config['_external_model'] 传入)
# 非空才覆盖(遵循 feedback_never_overwrite_with_empty 原则)
for key in ('_external_model', '_external_model_path',
@ -449,12 +464,12 @@ class WorkerThread(QThread):
" → 请确认「流程步骤-阶段五」中已填写有效的边界 shp 路径。"
)
# ── 步骤8(水质指数):训练光谱 CSV ──
step8_cfg = config.get('step8', {})
training_csv = step8_cfg.get('training_csv_path')
# ── 步骤6(水质光谱指数):训练光谱 CSV ──
step6_cfg = config.get('step6', {})
training_csv = step6_cfg.get('training_csv_path')
if training_csv and not os.path.isfile(training_csv):
errors.append(
f"步骤 8(水质指数):训练光谱文件不存在:\n {training_csv}\n"
f"步骤 6(水质光谱指数):训练光谱文件不存在:\n {training_csv}\n"
" → 请确认步骤 5 已成功运行并生成了训练光谱。"
)