Closed wojeda-mx closed 3 years ago
i'm helping @wojeda-mx here, do let us know if know if there was something wrong on our end.
happy to draft a PR if needed, and we're looking forward to keep contributing!
Hi @wojeda-mx, @itstemo, I have had this issue before and i always fixed it by clipping the the ET0 in the weather file to be at least 0.1mm/day. Not sure whether this has any scientific basis as it was just the minimum ET0 in the Champion Nebraska weather file. I'll ask Tim Foster (the developer of AquaCrop-OS for MATLAB) whether this clipping is sensible and then add it to the prepare_weather function so users dont have to worry about doing it themselves. My guess is that it would be rare for the ET0 in an area to actually be zero so i dont think it is crazy to add a lower limit.
Thanks for spotting the issue and please let me know if you have any other issues or feedback,
I have added the 0.1 lower limit on ET0 measurements in the latest release 0.1.4.
When running the brussels_climate.txt included dataset, there is a datapoint with ET=0 on 16/12/1980:
16 12 1980 1.7 6.9 0.2 0.0
.This raises a
ZeroDivisionError
when running model.step on biomass_accumulation. We believe it's because of the Et0 denominator on https://github.com/thomasdkelly/aquacrop/blob/f4c489dcb5073096047e09d60aac7658ec1f2bd0/aquacrop/solution.py#L3732-L3734 , and we could either try/catch, or use numpy to cast the floats and ensure we get NaN/Inf for such cases (https://stackoverflow.com/questions/10011707/how-to-get-nan-when-i-divide-by-zero).tested using the collab Notebook 1, only switching the dataset. stack trace from
%xmode Verbose