diff --git a/src/core/glint_removal/Goodman.py b/src/core/glint_removal/Goodman.py index 2687947..6c2e9f4 100644 --- a/src/core/glint_removal/Goodman.py +++ b/src/core/glint_removal/Goodman.py @@ -266,6 +266,9 @@ class Goodman: + self.B * diff_640_750[rs, :][w]) np.maximum(Rs[w], 0, out=Rs[w]) del Rs + # 全局裁剪:确保非水体像素也不含负反射率 + # (大气校正在边缘波段可能过校正产生负值) + np.maximum(R, 0, out=R) else: R = current_band.ReadAsArray().astype(np.float32) if water is not None: @@ -273,6 +276,8 @@ class Goodman: R[water] = (R[water] - R_750[water] + self.A + self.B * diff_640_750[water]) np.maximum(R[water], 0, out=R[water]) + # 全局裁剪:确保非水体像素也不含负反射率 + np.maximum(R, 0, out=R) else: # ◆ 无掩膜:全图校正(最快 SIMD 路径) np.subtract(R, R_750, out=R)