Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SolarTime cannot be calculated for extreme north locations (i.e., Norway) #73

Closed
basememara opened this issue Jul 19, 2022 · 1 comment

Comments

@basememara
Copy link
Contributor

Prayer times cannot be calculated for Norway this time of year since SolarTime returns nil:

let coordinates = Coordinates(latitude: 70.5308, longitude: 23.5717)
let solarTime = SolarTime(date: date(year: 2022, month: 7, day: 19, hours: 0), coordinates: coordinates)
// solarTime == nil

The angles in Astronomical.correctedHourAngle are returning NaN for this scenario. Any idea on how to accommodate these extreme north scenarios?

@z3bi
Copy link
Contributor

z3bi commented Jul 19, 2022

This is currently expected as nil indicates that the location has no sunset/sunrise for that day which can happen inside the polar circle near the solstices (see https://en.wikipedia.org/wiki/Polar_circle). We have opened issue #45 to address this. This feature was added to the JS library, its turning out to be slightly more complicated in Swift due to the way some of the data structures are setup.

@z3bi z3bi closed this as completed Jan 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants