get_body_heliographic_stonyhurst

sunpy.coordinates.ephemeris.get_body_heliographic_stonyhurst(body, time='now', observer=None, *, include_velocity=False)[source]

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
Keyword Arguments

include_velocity (bool) – If True, include the body’s velocity in the output coordinate. Defaults to False.

Returns

out (HeliographicStonyhurst) – Location of the solar-system body in the HeliographicStonyhurst 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.

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): (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): (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): (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.007552, 0.00037353, -28.43105538)>

Transform that same location and velocity of Mars to a different frame using SkyCoord.

>>> from astropy.coordinates import SkyCoord
>>> from sunpy.coordinates import Helioprojective
>>> SkyCoord(mars).transform_to(Helioprojective(observer=earth))
<SkyCoord (Helioprojective: obstime=2001-02-03T00:00:00.000, rsun=695700.0 km, observer=<HeliographicStonyhurst Coordinate (obstime=2012-06-06T04:07:29.000): (lon, lat, radius) in (deg, deg, AU)
    (7.835757e-15, -0.00766698, 1.01475668)>): (Tx, Ty, distance) in (arcsec, arcsec, AU)
    (-298029.94625805, -21753.50941181, 1.40010091)
 (d_Tx, d_Ty, d_distance) in (arcsec / s, arcsec / s, km / s)
    (-0.02787759, -0.00312481, -58.67123579)>