From 3c3586967a32780c45bbd3f5b0f1f5376f4e826f Mon Sep 17 00:00:00 2001 From: Gui Castelao Date: Thu, 18 Apr 2024 10:02:30 -0600 Subject: [PATCH] feat: Missing opportunity at local_qdm_bc() to define threshold Before it would necessarily only use the default. --- sup3r/bias/bias_transforms.py | 4 +++- sup3r/preprocessing/data_handling/base.py | 5 +++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/sup3r/bias/bias_transforms.py b/sup3r/bias/bias_transforms.py index e7ee128c1..09c31d3d6 100644 --- a/sup3r/bias/bias_transforms.py +++ b/sup3r/bias/bias_transforms.py @@ -403,6 +403,7 @@ def local_qdm_bc(data: np.array, base_dset: str, feature_name: str, bias_fp, + threshold=0.1, relative=True, no_trend=False): """Bias correction using QDM @@ -482,7 +483,8 @@ def local_qdm_bc(data: np.array, base, bias, bias_fut, cfg = get_spatial_bc_quantiles(lat_lon, base_dset, feature_name, - bias_fp) + bias_fp, + threshold) if no_trend: mf = None diff --git a/sup3r/preprocessing/data_handling/base.py b/sup3r/preprocessing/data_handling/base.py index fce41141d..82d7961a3 100644 --- a/sup3r/preprocessing/data_handling/base.py +++ b/sup3r/preprocessing/data_handling/base.py @@ -1376,8 +1376,9 @@ def qdm_bc(self, self.lat_lon, reference_feature, feature, - fp, - relative) + bias_fp=fp, + threshold=threshold, + relative=relative) completed.append(feature)