Comments (2)
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.
@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)
- Support Solar Noon (High Noon / Midday)
- Support Solar Midnight
- Create method to return magnetic direction for Sunrise and Sunset
- Provide center/edge toggle when getting Sunrise/Sunset information
- Add method to return day length
- Introduce BMNT and EENT getters
- Introduce isAviationNight() method
- Add support for 'one hour after sunset to one hour before sunrise'
- Add getSunBehindDawnHorizonDuration() and getSunBehindDuskHorizonDuration()
- Add package.html files to support Javadoc
- Alternate algorithms
- null result from calculations HOT 2
- broken link
- When computing Sunset, date does not increment correctly for UTC HOT 1
- Incorrect sunset date when it is after calculator timezone midnight
- Add support for OSGi HOT 1
- Getting wrong values for sunrise, sunset after midnight , started getting this wrong value after midnignt of 2020-05-18**sunrise time for 2020-05-19 - 23:59**
- Link to Algorithm Broken
- 989166615393 HOT 1
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 sunrisesunsetlib-java.