get_body#
- astropy.coordinates.get_body(body, time, location=None, ephemeris=None)[source]#
Get a
SkyCoord
for a solar system body as observed from a location on Earth in theGCRS
reference system.- Parameters:
- body
str
orlist
oftuple
The solar system body for which to calculate positions. Can also be a kernel specifier (list of 2-tuples) if the
ephemeris
is a JPL kernel.- time
Time
Time of observation.
- location
EarthLocation
, optional Location of observer on the Earth. If not given, will be taken from
time
(if not present, a geocentric observer will be assumed).- ephemeris
str
, optional Ephemeris to use. If not given, use the one set with
astropy.coordinates.solar_system_ephemeris.set
(which is set to ‘builtin’ by default).
- body
- Returns:
- skycoord
SkyCoord
GCRS Coordinate for the body
- skycoord
Notes
The coordinate returned is the apparent position, which is the position of the body at time t minus the light travel time from the body to the observing location.
You can either give an explicit ephemeris or use a default, which is normally a built-in ephemeris that does not require ephemeris files. To change the default to be the JPL ephemeris:
>>> from astropy.coordinates import solar_system_ephemeris >>> solar_system_ephemeris.set('jpl')
Use of any JPL ephemeris requires the jplephem package (https://pypi.org/project/jplephem/). If needed, the ephemeris file will be downloaded (and cached).
One can check which bodies are covered by a given ephemeris using:
>>> solar_system_ephemeris.bodies ('earth', 'sun', 'moon', 'mercury', 'venus', 'earth-moon-barycenter', 'mars', 'jupiter', 'saturn', 'uranus', 'neptune')