I found, that moon phases are slightly off by several hours. I'm using astral to calculate moon phases, bus since astral gives inaccurate values, sometimes I get moon phase for a wrong date.
Here is my experiment:
import datetime
import ephem
import astral
import matplotlib.pyplot as plt
x = [datetime.datetime(2020, 5, 22) + datetime.timedelta(hours=i*6) for i in range(30*4*2)]
a = astral.Astral()
a = [a.moon_phase(date=d, rtype=float) for d in x]
a = [(28 - p if p > 14 else p) / 14 * 100 for p in a]
e = [ephem.Moon(ephem.Date(d)).phase for d in x]
fig, ax = plt.subplots()
ax.plot(x, a, label="Astral")
ax.plot(x, e, label="Ephem")
ax.legend()
plt.show()
I found, that moon phases are slightly off by several hours. I'm using astral to calculate moon phases, bus since astral gives inaccurate values, sometimes I get moon phase for a wrong date.
Here is my experiment:
And the result: