Skip to content

Commit

Permalink
fix: Removing method zero_rate_threshold
Browse files Browse the repository at this point in the history
I missed this method from an early stage implementation. Thanks to
@grantbuster who noticed that!

Also defining default `zero_rate_threshold` to zero as requested by
Grant.
  • Loading branch information
castelao committed Jul 23, 2024
1 parent 7394427 commit 0b81c67
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions sup3r/bias/qdm.py
Original file line number Diff line number Diff line change
Expand Up @@ -692,8 +692,6 @@ class PresRat(ZeroRateMixin, QuantileDeltaMappingCorrection):
hydrological simulations of climate change. Journal of Hydrometeorology,
16(6), 2421-2442.
"""
zero_rate_threshold = None

def _init_out(self):
super()._init_out()

Expand Down Expand Up @@ -844,7 +842,7 @@ def run(
fill_extend=True,
smooth_extend=0,
smooth_interior=0,
zero_rate_threshold=0.01,
zero_rate_threshold=0.0,
):
"""Estimate the required information for PresRat correction
Expand All @@ -860,6 +858,24 @@ def run(
data. Can be None (no reduction, keep source time frequency), "avg"
(daily average), "max" (daily max), "min" (daily min),
"sum" (daily sum/total)
fill_extend : bool
Whether to fill data extending beyond the base meta data with
nearest neighbor values.
smooth_extend : float
Option to smooth the scalar/adder data outside of the spatial
domain set by the threshold input. This alleviates the weird seams
far from the domain of interest. This value is the standard
deviation for the gaussian_filter kernel
smooth_interior : float
Value to use to smooth the scalar/adder data inside of the spatial
domain set by the threshold input. This can reduce the effect of
extreme values within aggregations over large number of pixels.
This value is the standard deviation for the gaussian_filter
kernel.
zero_rate_threshold : float, default=0.0
Threshold value used to determine the zero rate in the observed
historical dataset. For instance, 0.01 means that anything less
than that will be considered negligible, hence equal to zero.
Returns
-------
Expand Down Expand Up @@ -986,7 +1002,6 @@ def run(
self.out, fill_extend, smooth_extend, smooth_interior
)

self.zero_rate_threshold = zero_rate_threshold
extra_attrs = {
'zero_rate_threshold': zero_rate_threshold,
'time_window_center': self.time_window_center,
Expand Down

0 comments on commit 0b81c67

Please sign in to comment.