-
Notifications
You must be signed in to change notification settings - Fork 28
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
Excluding areas above/below certain latitude #45
Comments
Hi Jannis, This is a good point! Thank you for bringing this up! I will correct this in the new release. Thanks,
|
Dear Matevz, Thank you for your reply.
if isinstance(lat, DataArray):
lat = lat.expand_dims(dim={"time": sol_dec.index}, axis=0)
return arccos(clip(-tan(sol_dec.values) * tan(lat).T, -1, 1)).T
else:
return arccos(clip(-tan(sol_dec) * tan(lat), -1, 1))
from numpy import tan, cos, pi, sin, arccos, mod, exp, log, nanmax, isnan, \
where, clip This essentially sets the range of values to be between -1 and 1 for the arccos computation and avoid the NaN issue. |
Dear @artessen, Thank you very much for this suggestion, and apologies for the late response—I somehow missed this comment. Thank you again and all the best, |
For 'simple' methods like
Hamon
, the resulting PET estimates can exclude areas above and below a certain latitude (i.e. returns NaNs), even though the input data ranges between -90 and 90.The area excluded changes depending on the date of the input data.
So probably that has to do with sunlight hours derived from latitude at a given date? Not per se wrong, but maybe good to either return 0 instead of NaNs (if that makes sense) or throw a warning so the user knows why this happens.
Also, probably good to specify this behaviour in the documentation somewhere.
The text was updated successfully, but these errors were encountered: