Skip to content

Commit

Permalink
feat: Adding no_trend arg to BaseHandler.qdm_bc()
Browse files Browse the repository at this point in the history
As requested by @grantbuster, to qdm_bc() can pass along a 'no_trend'
option to QDM correction.
  • Loading branch information
castelao committed May 13, 2024
1 parent f418625 commit 2c3cced
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions sup3r/preprocessing/data_handling/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1331,7 +1331,8 @@ def qdm_bc(self,
bc_files,
reference_feature,
relative=True,
threshold=0.1):
threshold=0.1,
no_trend=False):
"""Bias Correction using Quantile Delta Mapping
Bias correct this DataHandler's data with Quantile Delta Mapping. The
Expand Down Expand Up @@ -1361,6 +1362,15 @@ def qdm_bc(self,
Nearest neighbor euclidean distance threshold. If the DataHandler
coordinates are more than this value away from the bias correction
lat/lon, an error is raised.
no_trend: bool, default=False
An option to ignore the trend component of the correction, thus
resulting in an ordinary Quantile Mapping, i.e. corrects the bias
by comparing the distributions of the biased dataset with a
reference datasets. See ``params_mf`` of
:class:`rex.utilities.bc_utils.QuantileDeltaMapping`.
Note that this assumes that "bias_{feature}_params"
(``params_mh``) is the data distribution representative for the
target data.
"""

if isinstance(bc_files, str):
Expand All @@ -1378,7 +1388,8 @@ def qdm_bc(self,
feature,
bias_fp=fp,
threshold=threshold,
relative=relative)
relative=relative,
no_trend=no_trend)
completed.append(feature)


Expand Down

0 comments on commit 2c3cced

Please sign in to comment.