Skip to content

Review Julian date/day algorithms #83

@astrojuanlu

Description

@astrojuanlu

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions