transform_with_sun_center#

sunpy.coordinates.transform_with_sun_center()[source]#

Context manager for coordinate transformations to ignore the motion of the center of the Sun.

Normally, coordinates refer to a point in inertial space (relative to the barycenter of the solar system). Transforming to a different observation time does not move the point at all, but rather only updates the coordinate representation as needed for the origin and axis orientations at the new observation time. However, the center of the Sun moves over time. Thus, for example, a coordinate that lies on the surface of the Sun at one observation time will not continue to lie on the surface of the Sun at other observation times.

Under this context manager, transformations will instead move the coordinate over time to “follow” the translational motion of the center of Sun, thus maintaining the position of the coordinate relative to the center of the Sun.

Notes

This context manager accounts only for the motion of the center of the Sun, i.e., translational motion. The motion of solar features due to any rotation of the Sun about its rotational axis is not accounted for.

Due to the implementation approach, this context manager modifies transformations between only these five coordinate frames: HeliographicStonyhurst, HeliographicCarrington, HeliocentricInertial, Heliocentric, and Helioprojective.

Examples

>>> from astropy.coordinates import SkyCoord
>>> from sunpy.coordinates import HeliographicStonyhurst, transform_with_sun_center
>>> import astropy.units as u
>>> start_frame = HeliographicStonyhurst(obstime="2001-01-01")
>>> end_frame = HeliographicStonyhurst(obstime="2001-02-01")
>>> sun_center = SkyCoord(0*u.deg, 0*u.deg, 0*u.AU, frame=start_frame)
>>> sun_center
<SkyCoord (HeliographicStonyhurst: obstime=2001-01-01T00:00:00.000, rsun=695700.0 km): (lon, lat, radius) in (deg, deg, AU)
    (0., 0., 0.)>
>>> sun_center.transform_to(end_frame)  # transformations do not normally follow Sun center
<SkyCoord (HeliographicStonyhurst: obstime=2001-02-01T00:00:00.000, rsun=695700.0 km): (lon, lat, radius) in (deg, deg, AU)
    (23.33174233, -5.96399877, 0.00027959)>
>>> with transform_with_sun_center():
...     sun_center.transform_to(end_frame)  # now following Sun center
<SkyCoord (HeliographicStonyhurst: obstime=2001-02-01T00:00:00.000, rsun=695700.0 km): (lon, lat, radius) in (deg, deg, AU)
    (0., 0., 0.)>