From 6d6bb6e402c0b7492421e5edf9670073b4b08624 Mon Sep 17 00:00:00 2001 From: DXC Date: Sat, 9 May 2026 09:36:11 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DNumPy=E5=85=BC=E5=AE=B9?= =?UTF-8?q?=E6=80=A7=EF=BC=9Anp.percentile=E5=8F=82=E6=95=B0interpolation?= =?UTF-8?q?=E6=94=B9=E4=B8=BAmethod=EF=BC=88Kutser/Hedley/SUGAR=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/glint_removal/Hedley.py | 4 ++-- src/core/glint_removal/Kutser.py | 4 ++-- src/core/glint_removal/SUGAR.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/core/glint_removal/Hedley.py b/src/core/glint_removal/Hedley.py index a11506b..f2da2c3 100644 --- a/src/core/glint_removal/Hedley.py +++ b/src/core/glint_removal/Hedley.py @@ -36,9 +36,9 @@ class Hedley: # 如果存在水域掩膜,只在掩膜内计算R_min if self.water_mask is not None: nir_band_masked = self.im_aligned[:,:,self.NIR_band][self.water_mask.astype(bool)] - self.R_min = np.percentile(nir_band_masked, 5, interpolation='nearest') if nir_band_masked.size > 0 else 0 + self.R_min = np.percentile(nir_band_masked, 5, method='nearest') if nir_band_masked.size > 0 else 0 else: - self.R_min = np.percentile(self.im_aligned[:,:,self.NIR_band].ravel(), 5, interpolation='nearest') + self.R_min = np.percentile(self.im_aligned[:,:,self.NIR_band].ravel(), 5, method='nearest') def _read_shp_to_bbox(self, shp_path): """ diff --git a/src/core/glint_removal/Kutser.py b/src/core/glint_removal/Kutser.py index 7a659ac..4eb10a9 100644 --- a/src/core/glint_removal/Kutser.py +++ b/src/core/glint_removal/Kutser.py @@ -42,9 +42,9 @@ class Kutser: # 如果存在水域掩膜,只在掩膜内计算R_min if self.water_mask is not None: nir_band_masked = self.im_aligned[:,:,self.NIR_band][self.water_mask.astype(bool)] - self.R_min = np.percentile(nir_band_masked, 5, interpolation='nearest') if nir_band_masked.size > 0 else 0 + self.R_min = np.percentile(nir_band_masked, 5, method='nearest') if nir_band_masked.size > 0 else 0 else: - self.R_min = np.percentile(self.im_aligned[:,:,self.NIR_band].ravel(), 5, interpolation='nearest') + self.R_min = np.percentile(self.im_aligned[:,:,self.NIR_band].ravel(), 5, method='nearest') def _read_shp_to_bbox(self, shp_path): """ diff --git a/src/core/glint_removal/SUGAR.py b/src/core/glint_removal/SUGAR.py index 54eb88c..4655026 100644 --- a/src/core/glint_removal/SUGAR.py +++ b/src/core/glint_removal/SUGAR.py @@ -318,7 +318,7 @@ class SUGAR: est_background = self.get_est_background(self.im_aligned[:,:,i]) est_background_list.append(est_background) else: - est_background = np.percentile(self.im_aligned[:,:,i], 5, interpolation='nearest') + est_background = np.percentile(self.im_aligned[:,:,i], 5, method='nearest') est_background_list.append(est_background) bounds = self.bounds[i] b = self.optimise_correction_by_band(self.im_aligned[:,:,i],glint_mask,est_background,bounds)