Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Further updates to wdf correction #159

Merged
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]
### Changed
- Update wet day frequency correction again to raise the "low" value used to the threshold value / 10 (PR #159, @dgergel)
- Update wet day frequency correction to include small negative values in correction and to limit the correction range to the threshold * 10 ^ -2. (PR #158, @dgergel)
- Update package setup, README, HISTORY/CHANGELOG to new system. (PR #154, @brews)

Expand Down
6 changes: 3 additions & 3 deletions dodola/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ def apply_wet_day_frequency_correction(ds, process):
threshold = 0.05 # mm/day
# adjusted "low" value from the original epsilon in Cannon et al 2015 to
# avoid having some values get extremely large
low = threshold * pow(10, -2)
low = threshold / 10.0

if process == "pre":
# includes very small values that are negative in CMIP6 output
Expand Down Expand Up @@ -774,8 +774,8 @@ def _test_maximum_precip(ds, var):
Tests that max precip is reasonable
"""
threshold = 2000 # in mm, max observed is 1.825m --> maximum occurs between 0.5-0.8
max_precip = ds[var].max()
num_precip_values_over_threshold = ds[var].where(ds[var] > threshold).count()
max_precip = ds[var].max().values
num_precip_values_over_threshold = ds[var].where(ds[var] > threshold).count().values
assert (
num_precip_values_over_threshold == 0
), "maximum precip is {} mm and there are {} values over 2000mm".format(
Expand Down