A bug in fraction_illuminated() on Venus?
See original GitHub issueA bug in fraction_illuminated() on Venus?
It worked well in the skyfield for the moon using fraction_illuminated(). But when I tried to do it on Venus, the results were completely wrong and weird. I could not in any way use fraction_illuminated() on Venus and get a sensible result. (After all, it is known that Venus also has different appearances, and different illuminations, just like the moon has). I use Stellarium software. The illumination percentage of Venus for today September 24, 2022 is 99 percent. Whereas for the date August 11, 2023 the lighting percentage is 0.9. If I use skyfield according to the example given on the skyfield examples page (the example is for the moon, and I changed it for Venus) the result is that today, September 24, 2022, the illumination percentage of Venus is 0.4, while on August 11, 2023, the illumination percentage is 0.5. What is the problem? And how should it be solved? I didn’t check for Mercury, but it also has different illuminated, like the moon has. Thank you.
from skyfield.api import load
from skyfield.framelib import ecliptic_frame
ts = load.timescale()
t = ts.utc(2022, 9, 24, 15, 36)
eph = load('de440s.bsp')
sun, venus, earth = eph['sun'], eph['venus'], eph['earth']
e = earth.at(t)
s = e.observe(sun).apparent()
v = e.observe(venus).apparent()
percent = 100.0 * v.fraction_illuminated(sun)
print('Percent illuminated: {0:.1f}%'.format(percent))
Percent illuminated: 0.4%
Issue Analytics
- State:
- Created a year ago
- Comments:9 (3 by maintainers)
Top GitHub Comments
The sun is illuminated at 100 percent of its circumference. On the other hand, the moon is always lit only on 50 percent of its circumference: only on the side facing the sun. When the side of the moon that faces the earth, faces the sun, we see the entire illuminated part which is about 50 percent of the moon’s circumference, and we call it 100% illuminated.
So the sun has 200% illuminated. But we only see 100 of what is there, so 100 out of 200 is 50 percent.
So everyone is right, but the question is what will the user understand.
I’ve re-thought and rewritten the fraction-illuminated logic and this time have tested it against JPL HORIZONS results. See if installing the development version of Skyfield fixes things!
To install the development version of this project, run: