Moonrise time 4 min deviation
Thanks for developing this :)
- I am getting around 4 to 5 min deviation, tested for all Indian Metro cities.
- The date object takes system timezone by default. Is there a way to test for another location? I assume for another timezone the date object will take respective local timezone?
@truespan I can confirm your observation, the moon rise times are about 4 to 5 minutes off the correct time (using Berlin Drachenberg http://aa.usno.navy.mil/cgi-bin/aa_rstablew.pl?ID=AA&year=2018&task=1&place=Berlin-Drachenberg&lon_sign=1&lon_deg=13.25&lat_sign=1&lat_deg=52.5 as reference) and when comparing to reality.
Example:
var moon=SunCalc.getMoonTimes( "2018-01-10 00:00:00", 52.5, 13.25 );
console.log(moon);
Object { rise: Date 2018-01-10T00:32:20.448Z, set: Date 2018-01-10T11:27:24.456Z }
aa.usno.navy.mil:
10 0037 1127
@mourner perhaps, can you have a look into it?
I believe SunCalc uses the formulas provided by Chapter 48 of "Astronomical Algorithms" 2nd edition by Jean Meeus (Willmann-Bell, Richmond) 1998.he
The USNO uses a combination of different lunar formulas to include Meeus. I believe the formula used is based on the date and location of the user request to ensure maximum accuracy is achieved.
SunCalc's advantage is its light weight, even if it comes with minor deviations. The deviations of the lunar formulas are acceptable for many applications, but if more precision is required, then a range of different formulas must be considered.
I found that this page http://www.computus.de/mondphase/mondphase.htm (using Javascript) gives also good results (moon rise and set).
I just used it at 39.9526° N, 75.1652° W (Philadelphia) and the Moonset returned 13:35(Z)? That is more then 30 minutes off. I also have terrible German, so I may be using the site wrong LOL. What am I doing wrong?
Nevermind...I am an idiot. It's still 1 Feb here, but 2 Feb in Germany, so the website was calculating tomorrows.
This looks like a dup of #74 and should thus be closed IMHO.