sffjunkie / astral

Python calculations for the position of the sun and moon.
Apache License 2.0
235 stars 47 forks source link

Missing sunsets for arctic circle locations #84

Open DaleShipp opened 1 year ago

DaleShipp commented 1 year ago

Hi, I'm trying to use this library for calculating sunrises and sunsets, but finding several missing data points when looking at Arctic locations. All times are in UTC

My test cases are Kap Morris Jessup, Greenland and Tromso, Norway.
location = LocationInfo('Kap Morris Jessup', 'Greenland', 'UTC', lat=83.6561, long=-33.3739 ) location = LocationInfo('Tromso', 'Norway', 'UTC', lat=69.6492,long=18.9553 )

Kap Morris Jessup: The data for 8th-12th September 2022 can be viewed at the USNO site https://aa.usno.navy.mil/calculated/rstt/year?ID=AA&year=2022&task=0&lat=83.6561&lon=-33.3739&label=Kap+Morris+Jessup&tz=0.00&tz_sign=-1&submit=Get+Data

Notably in this date range there is a sunset on the 9th and two sunsets on the 11th. yielding the following data : "sunsets": [ "2022-09-09T01:24:00Z", "2022-09-10T00:39:00Z", "2022-09-11T00:08:00Z", "2022-09-11T23:44:00Z", "2022-09-12T23:22:00Z" ]

However Astral is giving only the following sunsets (missing a sunset on the 9th and 11th): sunsets=[ '2022-09-10T00:34:00Z', '2022-09-11T23:41:00Z', '2022-09-12T23:19:00Z' ]

Same for Tromso 14-20 May 2020 with sunrises: sunrises=['2023-05-12T00:13:00Z', '2023-05-13T00:04:00Z', '2023-05-13T23:56:00Z', '2023-05-14T23:46:00Z', '2023-05-15T23:35:00Z', '2023-05-16T23:22:00Z' ] vs Astral sunrises=[ '2023-05-15T01:46:00Z', '2023-05-16T01:35:00Z', '2023-05-17T01:27:00Z' ]

Is sunrise / sunset not usable for arctic locations?

lwchkg commented 1 year ago

Looks the calculations in this package (https://gml.noaa.gov/grad/solcalc/calcdetails.html) is less accurate than the one used in the web site you quoted.

If you need the accuracy you'd should have better luck using NOVAS software in that web site. Beware of their special license conditions anyway: “free to DoD and civilian customers”, that is hideously easy to breach.

DaleShipp commented 1 year ago

'Use a different library' is not a helpful answer. I have reported an issue with this library.