Comments (3)
Dear Matevz,
Thank you for your reply.
I believe the issue is still present in the current version, but in case you have not already fixed, here is a possible solution:
- Substitute lines 338-342 in pyet/meteo_utils.py with the following:
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))
- Substitute lines 5-6 in pyet/meteo_utils.py with the following:
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.
Hope it helps
Best
Arthur
from pyet.
Hi Jannis,
This is a good point! Thank you for bringing this up!
We currently use the FAO-56 method to estimate daylight hours based on latitude.
However, as you wrote, it turns out this method returns NaN values for the subpolar/polar belt for the polar night period.
I will correct this in the new release.
Thanks,
Matevz
- [ correct
daylight_hours
for subpolar/polar belt]
from pyet.
Dear @artessen,
Thank you very much for this suggestion, and apologies for the late response—I somehow missed this comment.
I have implemented your suggestion in the dev
branch, and it will be integrated into the v1.3 PyEt version.
Thank you again and all the best,
Matevz
from pyet.
Related Issues (20)
- Built check for lat values HOT 1
- Remove Travis CI and stick to GitHub CI HOT 1
- fix ReadTheDocs issues HOT 3
- get_rn method undocumented and in strange place HOT 1
- methods don't work with Pandas DataFrame HOT 2
- pm-fao56 method does not work for my Xarray.dataArray data HOT 3
- Speeding up calculations HOT 1
- Unrealistic negative/positive values for the Turch equation at sub-freezing temperatures HOT 1
- Hargreaves method is not calculating for some days in winter HOT 4
- pm_fao56 error HOT 2
- "Haude" method error in calculate_all HOT 1
- pyet.calc_rad_net attribute error with pandas.series HOT 4
- Start using pyproject.toml instead of setup.py HOT 1
- Start using Github Actions HOT 1
- Add recent publications using PyEt HOT 1
- Add Issue and PR templates HOT 1
- Remove 'shape' as argument from 'extraterrestrial_r' method in meter_utils.py HOT 1
- Specific humidity to relative humidity HOT 1
- The radiation input provided is greater than 100 MJ/m2d, which is not realistic. Please convert the radiation input to MJ/m2d HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyet.