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

Add support for twilights #46

Open
Deuchnord opened this issue Jan 31, 2022 · 0 comments
Open

Add support for twilights #46

Deuchnord opened this issue Jan 31, 2022 · 0 comments
Labels
enhancement New feature or request
Milestone

Comments

@Deuchnord
Copy link
Member

Is your feature request related to a problem? Please describe.
When the sun sets, the sky is not immediately dark. Consequently, most of the objects are not visible until it is. The same happens when the sun is rising.

Describe the solution you'd like
A function that gives, for a date and a position, the end times of the three dawns and twilights of the day:

  • civil dawn/twilight (geometric center of the Sun passes 6° under the horizon): Venus and the Moon are the only visible objects
  • nautical dawn/twilight (geometric center of the Sun passes 12° under the horizon): the light of the Sun is still visible, but is not enough to hide the brightest stars.
  • astronomical dawn/twilight (geometric center of the Sun passes 18° under the horizon), or full night: all the objects are visible (depending on the ambient light pollution).

The function would look like this:

def get_dawns_twilights(position: Position, date: date = date.today) -> (DawnsInformation, TwilightsInformation)

The TwilightsInformation type would be a class that handles the datetimes of the three dawns and twilights.
The DawnsInformation type may be an alias of TwilightsInformation.

Additional context

  • Not sure for the name of the Dawns/TwilightInformation class. We might want a better name.
  • We might want to take profit of Slyfield's skyfield.almanac.dark_twilight_day() function for better performances.
  • Even though the function is named twilight, is should also take care about dawns the same way, as the logic is exactly the same.
@Deuchnord Deuchnord added the enhancement New feature or request label Jan 31, 2022
@Deuchnord Deuchnord added this to the v1.1 milestone Jan 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant