suncalc icon indicating copy to clipboard operation
suncalc copied to clipboard

Moonrise time 4 min deviation

Open truespan opened this issue 8 years ago • 7 comments

Thanks for developing this :)

  1. I am getting around 4 to 5 min deviation, tested for all Indian Metro cities.
  2. 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 avatar Oct 23 '17 05:10 truespan

@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

Wikinaut avatar Jan 04 '18 17:01 Wikinaut

@mourner perhaps, can you have a look into it?

Wikinaut avatar Jan 04 '18 17:01 Wikinaut

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.

Tronald avatar Feb 01 '18 17:02 Tronald

I found that this page http://www.computus.de/mondphase/mondphase.htm (using Javascript) gives also good results (moon rise and set).

Wikinaut avatar Feb 01 '18 21:02 Wikinaut

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?

Tronald avatar Feb 01 '18 23:02 Tronald

Nevermind...I am an idiot. It's still 1 Feb here, but 2 Feb in Germany, so the website was calculating tomorrows.

Tronald avatar Feb 01 '18 23:02 Tronald

This looks like a dup of #74 and should thus be closed IMHO.

marcelstoer avatar Jun 03 '18 17:06 marcelstoer