修复Step3去耀斑模块三大问题:SUGAR分支变量名冲突、Kutser参数默认值错误、波段索引类型统一转为int
This commit is contained in:
@ -1887,16 +1887,16 @@ class WaterQualityInversionPipeline:
|
||||
|
||||
elif method == "sugar":
|
||||
# 强行转换暗号,兼容中文和各种格式
|
||||
raw_method = str(sugar_glint_mask_method).lower()
|
||||
if 'cdf' in raw_method or '累积' in raw_method:
|
||||
sugar_glint_mask_method = 'cdf'
|
||||
elif 'otsu' in raw_method or '大津' in raw_method:
|
||||
sugar_glint_mask_method = 'otsu'
|
||||
sugar_glint_mask_method_raw = str(sugar_glint_mask_method).lower()
|
||||
if 'cdf' in sugar_glint_mask_method_raw or '累积' in sugar_glint_mask_method:
|
||||
sugar_glint_mask_method_fixed = 'cdf'
|
||||
elif 'otsu' in sugar_glint_mask_method_raw or '大津' in sugar_glint_mask_method:
|
||||
sugar_glint_mask_method_fixed = 'otsu'
|
||||
else:
|
||||
# 默认回退到 cdf 确保不崩溃
|
||||
sugar_glint_mask_method = 'cdf'
|
||||
sugar_glint_mask_method_fixed = 'cdf'
|
||||
|
||||
print(f"使用方法: SUGAR (迭代次数={sugar_iter}, 掩膜方法={sugar_glint_mask_method})")
|
||||
print(f"使用方法: SUGAR (迭代次数={sugar_iter}, 掩膜方法={sugar_glint_mask_method_fixed})")
|
||||
|
||||
# 确定输出路径
|
||||
output_path = str(self.deglint_dir / "deglint_sugar.bsq")
|
||||
@ -1930,7 +1930,7 @@ class WaterQualityInversionPipeline:
|
||||
corrected_images = correction_iterative(
|
||||
image_array, iter=None, bounds=sugar_bounds,
|
||||
estimate_background=sugar_estimate_background,
|
||||
glint_mask_method=sugar_glint_mask_method,
|
||||
glint_mask_method=sugar_glint_mask_method_fixed,
|
||||
termination_thresh=sugar_termination_thresh,
|
||||
water_mask=mask_for_algorithm,
|
||||
output_path=None # 不传递output_path,使用pipeline保存
|
||||
@ -1940,7 +1940,7 @@ class WaterQualityInversionPipeline:
|
||||
corrected_images = correction_iterative(
|
||||
image_array, iter=sugar_iter, bounds=sugar_bounds,
|
||||
estimate_background=sugar_estimate_background,
|
||||
glint_mask_method=sugar_glint_mask_method,
|
||||
glint_mask_method=sugar_glint_mask_method_fixed,
|
||||
water_mask=mask_for_algorithm,
|
||||
output_path=None # 不传递output_path,使用pipeline保存
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user