get_body_heliographic_stonyhurst#
- sunpy.coordinates.get_body_heliographic_stonyhurst(
- body,
- time='now',
- observer=None,
- *,
- include_velocity=False,
- quiet=False,
Return a
HeliographicStonyhurst
frame for the location of a solar-system body at a specified time. The location can be corrected for light travel time to an observer.- Parameters:
body (
str
) – The solar-system body for which to calculate positionstime (
tuple
,list
,str
,pandas.Timestamp
,pandas.Series
,pandas.DatetimeIndex
,datetime.datetime
,datetime.date
,numpy.datetime64
,numpy.ndarray
,astropy.time.Time
) – Time to use in a parse_time-compatible formatobserver (
SkyCoord
) – If None, the returned coordinate is the instantaneous or “true” location. If not None, the returned coordinate is the astrometric location (i.e., accounts for light travel time to the specified observer)include_velocity (
bool
, optional) – If True, include the body’s velocity in the output coordinate. Defaults to False.quiet (
bool
, optional) – If True, the function will not emit logger output for light-travel-time corrections. Defaults to False.
- Returns:
out (
HeliographicStonyhurst
) – Location of the solar-system body in theHeliographicStonyhurst
frame
Notes
There is no correction for aberration due to observer motion. For a body close to the Sun in angular direction relative to the observer, the correction can be negligible because the apparent location of the body will shift in tandem with the Sun.
For planets other than Earth, Astropy’s built-in ephemeris is not as accurate as JPL ephemerides, so one can use
astropy.coordinates.solar_system_ephemeris
to switch to a JPL ephemeris. See Solar System Ephemerides for more information, and see Overplotting the position of the Venus transit for an example.Examples
>>> from sunpy.coordinates.ephemeris import get_body_heliographic_stonyhurst
Obtain the location of Venus
>>> get_body_heliographic_stonyhurst('venus', '2012-06-06 04:07:29') <HeliographicStonyhurst Coordinate (obstime=2012-06-06T04:07:29.000, rsun=695700.0 km): (lon, lat, radius) in (deg, deg, AU) (0.07349535, 0.05223575, 0.72605496)>
Obtain the location of Venus as seen from Earth when adjusted for light travel time
>>> earth = get_body_heliographic_stonyhurst('earth', '2012-06-06 04:07:29') >>> get_body_heliographic_stonyhurst('venus', '2012-06-06 04:07:29', observer=earth) INFO: Apparent body location accounts for 144.07 seconds of light travel time [sunpy.coordinates.ephemeris] <HeliographicStonyhurst Coordinate (obstime=2012-06-06T04:07:29.000, rsun=695700.0 km): (lon, lat, radius) in (deg, deg, AU) (0.07084926, 0.0520573, 0.72605477)>
Obtain the location and velocity of Mars
>>> mars = get_body_heliographic_stonyhurst('mars', '2001-02-03', include_velocity=True) >>> mars <HeliographicStonyhurst Coordinate (obstime=2001-02-03T00:00:00.000, rsun=695700.0 km): (lon, lat, radius) in (deg, deg, AU) (63.03105777, -5.20656151, 1.6251161) (d_lon, d_lat, d_radius) in (arcsec / s, arcsec / s, km / s) (-0.02323686, 0.00073376, -1.4798387)>