GithubHelp home page GithubHelp logo

Comments (3)

artessen avatar artessen commented on June 1, 2024 1

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.

mvremec avatar mvremec commented on June 1, 2024

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.

mvremec avatar mvremec commented on June 1, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.