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

Review Julian date/day algorithms #83

Open
astrojuanlu opened this issue Feb 4, 2020 · 0 comments
Open

Review Julian date/day algorithms #83

astrojuanlu opened this issue Feb 4, 2020 · 0 comments

Comments

@astrojuanlu
Copy link
Contributor

Module orbit_predictor.predictors.accurate replaces the function jday from sgp4, which uses an algorithm similar to this one:

https://en.wikipedia.org/wiki/Julian_day#Converting_Julian_calendar_date_to_Julian_Day_Number

which in fact comes from Vallado:

https://github.com/brandon-rhodes/python-sgp4/blob/e4ede3c1dc31ba1673a2c3457c5f97dc892f28b2/sgp4/functions.py#L8-L23

And then orbit_predictor.utils contains this alternative, undocumented implementation:

def juliandate(utc_tuple):
year, month, day, hour, minute, sec = utc_tuple[:6]
if month <= 2:
year -= 1
month += 12
return (floor(365.25*(year + 4716.0)) + floor(30.6001*(month+1.0)) + 2.0 -
floor(year / 100.0) + floor(floor(year / 100.0) / 4.0) + day - 1524.5 +
(hour + minute / 60.0 + sec / 3600.0) / 24.0)

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

1 participant