-
Notifications
You must be signed in to change notification settings - Fork 59
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
Degree day calculation unit handling errors #1789
Comments
This merits a patch release once the fix is merged. |
@aulemahal The problem seems to be only with fahrenheit. and I think the fix needs to possibly take place in The output gets assigned a cf units attr here Line 555 in a1a1a25
but from what I see the cf attrs are assigned directly without actually applying a conversion factor i,e, |
Indeed import xclim as xc
a = xc.core.units.str2pint('1 °F')
b = xc.core.units.str2pint('1 d')
a * b
# 255.92777777777778 <Unit('day * kelvin')> And this on pint 0.23, so not an issue of the latest version. I think the fix goes in EDIT: Actually that doesnt work at all. |
AH, I see the issue now. Summoning @coxipi with whom we discussed this thing before. To avoid treating the "delta temperature" issue we decided to ignore the magnitude difference of the integral. But Previously we did |
Would it help to use |
Yes it would! I am currently looking for a way to elegantly convert non-mult temperatures to deltas in |
Setup Information
Description
Calculation of growing degree days using different units does not yield the same results :
I believe that in
cumulative_difference
xclim/xclim/indices/generic.py
Line 862 in a1a1a25
doing this
threshold = convert_units_to(threshold, data)
means that output units should be set to'F days'
not 'K days
' that I am getting in my outputSteps To Reproduce
Additional context
No response
Contribution
Code of Conduct
The text was updated successfully, but these errors were encountered: