You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I finding a hard time converting the below code to calculate the last full moon and full moon day. Any help is greatly appreciated. Thanks.
# New moon day: sun and moon have same longitude (0 degrees = 360 degrees difference)
# Full moon day: sun and moon are 180 deg apart
def new_moon(jd, tithi_, opt = -1):
"""Returns JDN, where
opt = -1: JDN < jd such that lunar_phase(JDN) = 360 degrees
opt = +1: JDN >= jd such that lunar_phase(JDN) = 360 degrees
"""
if opt == -1: start = jd - tithi_ # previous new moon
if opt == +1: start = jd + (30 - tithi_) # next new moon
# Search within a span of (start +- 2) days
x = [ -2 + offset/4 for offset in range(17) ]
y = [lunar_phase(start + i) for i in x]
y = unwrap_angles(y)
y0 = inverse_lagrange(x, y, 360)
return start + y0
The text was updated successfully, but these errors were encountered:
Firstly thanks for your quick response and sorry my question was different, I am struggling to calculate or find full moon day using the above code. The comment says Full moon day: sun and moon are 180 deg apart but tried this in a multiple-way, but fail to calculate last full moon and next full moon. I update the original question. @dhoomakethu
I finding a hard time converting the below code to calculate the last full moon and full moon day. Any help is greatly appreciated. Thanks.
The text was updated successfully, but these errors were encountered: