Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions pytides/astro.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,14 @@ def d_polynomial(coefficients, argument):

# Meeus formula 11.1
def T(t):
"""Return the Julian Century of a datetime.
Per Meeus's Astronomical Algorithms, formula 11.1"""
return (JD(t) - 2451545.0)/36525

# Meeus formula 7.1
def JD(t):
"""Return the Julian Date of a datetime.
Per Meeus's Astronomical Algorithms, formula 7.1"""
Y, M = t.year, t.month
D = (
t.day
Expand Down Expand Up @@ -155,6 +159,8 @@ def _nupp(N, i, omega):
AstronomicalParameter = namedtuple('AstronomicalParameter', ['value', 'speed'])

def astro(t):
"""Return the astronomical parameters of a datetime.
"""
a = {}
# We can use polynomial fits from Meeus to obtain good approximations to
# some astronomical values (and therefore speeds).
Expand Down