-
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
Add potential evapotranspiration method based on Droogers and Allen (2002) #1723
Conversation
Welcome, new contributor! It appears that this is your first Pull Request. To give credit where it's due, we ask that you add your information to the
Please make sure you've read our contributing guide. We look forward to reviewing your Pull Request shortly ✨ |
for more information, see https://pre-commit.ci
Automatic corrections made by xclim
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR!
Please look at my commit to see if you agree. We try to avoid exact frequency matching in indices. Xclim's Indicators are the objects that may enforce strong rules about data frequency, but indices should let the user do what it wants.
So instead of deciding what to do according to the infer_freq
, I used the same idea as in the TW48 implementation : resample to monthly no matter what. If the data is already monthly, this will be a no-op. I also generalized the function to get a daily time coord from monthly data, as used by TW48 also.
One caveat of my technique is the chunksizes that are not easily inferable. I took a guess that passing the same chunks as monthly tasmin would be ok in most cases. Especially because we resample the radiation right away.
Would you be able to add a test case for this new method ? The test should be a method of class TestPotentialEvapotranspiration
, line 3159 of tests/test_indices.py
.
@aulemahal I think that I have the workflows configured to trigger on any comment. This might be why the builds often cancel during reviews. Will open an issue. |
for more information, see https://pre-commit.ci
Thank you for the proposed changes. It seems correct to resample everything to monthly and work at that resolution. Regarding the issue of chunksize when calculating solar radiation, it was causing problems for me, so I have removed it. On the other hand, I have modified the term lv=2.5 and included the constant 0.408 to align the Hargreaves (HG85) method with the new modified method (DA02). The result of applying 1/2.5 = 0.4 is very similar to multiplying by 0.408, but this way we use the original constant that appears in Hargreaves et al (2002). Finally, I have added the test for the new method, although when running all tests with |
@JavierDiezSierra This is looking good! Once the failing tests are addressed, we should be able to move forward with the merge in advance of the next release (v0.49.0). All the best! |
@JavierDiezSierra I think I fixed the tests in the last commit. This looks good to go. |
¡Many thanks for you help!. |
Thanks so much for your pull request! |
Pull Request Checklist:
1710
) and pull request (:pull:1723
) has been addedWhat kind of change does this PR introduce?
This change introduces a new method to calculate potential evapotranspiration based on Droogers and Allen (2002). The method incorporates precipitation as a proxy for humidity and is more appropriate for dry regions
Does this PR introduce a breaking change?
No
Other information: