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

Moon phase and illumination #252

Open
dmoore19 opened this issue Jan 27, 2023 · 1 comment
Open

Moon phase and illumination #252

dmoore19 opened this issue Jan 27, 2023 · 1 comment

Comments

@dmoore19
Copy link

dmoore19 commented Jan 27, 2023

I'm trying to figure out the best way to calculate the phase of the moon, This is what I have:

if phase < 0.125:
            phase_name = "New Moon"
        elif phase < 0.25:
            phase_name = "Waxing Crescent"
        elif phase < 0.375:
            phase_name = "First Quarter"
        elif phase < 0.5:
            phase_name = "Waxing Gibbous"
        elif phase < 0.625:
            phase_name = "Full Moon"
        elif phase < 0.75:
            phase_name = "Waning Gibbous"
        elif phase < 0.875:
            phase_name = "Last Quarter"
        else:
            phase_name = "Waning Crescent"

But it is not matching up with trusted web sites with the same location and day.

Also trying to figure out how to get illumination percentage. Not sure. Thanks in advance.

@brandon-rhodes
Copy link
Owner

The first step that I would take would be computing the number with another library, and comparing those two numbers first. For example, this routine would return a number you could compare with your numbers from PyEphem:

https://rhodesmill.org/skyfield/almanac.html#phases-of-the-moon

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

2 participants