Getting the location of the planets#
How to get the position of planetary bodies im the solar system using astropy’s solar system ephemeris information and sunpy.
import matplotlib.pyplot as plt from astropy.time import Time from sunpy.coordinates import get_body_heliographic_stonyhurst
Lets grab the positions of each of the planets in Heliographic Stonyhurst coordinates.
Let’s plot the results. Remember the Sun is at the center of this coordinate system.
Total running time of the script: (0 minutes 0.223 seconds)