Giter Site home page Giter Site logo

Comments (2)

klausbrunner avatar klausbrunner commented on August 15, 2024

As I've worked on this topic myself, let me chime in here: what do you consider "accurate"? All sunrise/sunset calculations are based on more or less elaborate models of the solar system, usually derived from historical observations - some quite complex, some very simple. Some may consider atmospheric refraction, others not. Some implementations of the same model may be better at dealing with accumulating errors than others. So...differences in the results are unavoidable, especially under unfavourable conditions (e.g. polar regions).

If the goal is to get exactly the same results as a certain reference source, this will only work by implementing exactly the same algorithm they use. Anything else may be legitimately off up to several minutes, which may not even matter for many real-world applications: perceived sunset/sunrise is greatly affected by local topography and weather conditions, for instance.

from sunrisesunsetlib-java.

MenoData avatar MenoData commented on August 15, 2024

@klausbrunner is absolute right. It depends on the algorithm and the underlying model. I have myself now released a new implementation where I support two algorithms:

  • algorithm of Ed Williams (used here in this library)
  • NOAA-algorithm

NOAA is more precise. Therefore I have made it the default in my library. My main motivation to support sunrise/sunset-calculations is the fact that some calendars like the islamic one let the day start on sunset (not at midnight). I have also tried to realize most of the issues you have opened here, see the API of Time4J.

I wonder if this library will still be developped when looking at the commit activities and the long silence in most open issues. Otherwise, for normal geographic locations, it is fine enough and yields satisfying precision about 1-2 minutes (but not for the polar regions).

from sunrisesunsetlib-java.

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.