-
-
Notifications
You must be signed in to change notification settings - Fork 213
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
Dawn/Dusk #225
Comments
Twilight calculations would be a nice new feature, so I'll keep this issue open until there's a chance to add them. In the meantime, you could make your own copy of sunrise_sunset: python-skyfield/skyfield/almanac.py Line 178 in e83d751
but instead of the value -0.8333, you would use an even deeper angle — here are the angles used by the Naval Observatory: |
@brandon-rhodes Would you consider it overkill to use your library in place of |
I think that Skyfield times for twilight would more precisely agree with the official numbers from the USNO than would numbers from PyEphem, which might if you measured them be sometimes one minute different because of small differences in its estimation of where the Sun and Earth are. But my guess is that either library would be well within the precision you need, given that dusk and dawn never proceed exactly according to plan anyway because of humidity and air layers and clouds. What precision does your application need? That's the first question. |
Since skyfield uses SPICE kernel files, it should agree to the minute with USNO, assuming it uses an elliptical Earth model (which I'm sure it does). It wouldn't be hard to test against USNO's data. This isn't exactly helpful, but my https://github.com/barrycarter/bcapps/tree/master/ASTRO/testdata/ contains a bunch of sun/moon rise/set data I collected from USNO ages ago. It does not include twilight data, but confirming sun (and especially moon) rise/set to the nearest minute would probably be useful. Additionally, if you need more tests cases for twilight, let me know, and I can generate these as well (my https://github.com/barrycarter/bcapps/tree/master/bclib.pl has a |
In the olden days of PyEphem, to calculate dawn/dusk, I used this for inspiration.
For Skyfield, I have looked at the Topos object (both API and under a debugger) but I don't see a field for horizon (horizon should be set to say -6 degrees for civil twilight).
Is it possible to calculate dawn/dusk in Skyfield (and if so, how)?
The text was updated successfully, but these errors were encountered: