The role of rsun in coordinate transformations#

In the case of HeliographicCarrington, one can specify observer='self' to indicate that the coordinate itself should be used as the observer for defining the coordinate frame.

It is possible to convert from a Helioprojective frame with one observer location to another Helioprojective frame with a different observer location. The transformation requires the coordinate to be 3D, so if the initial coordinate is only 2D, the default assumption maps that 2D coordinate to the surface of the Sun, as defined by the rsun frame attribute. The conversion can be performed as follows:

>>> import astropy.units as u
>>> from astropy.coordinates import SkyCoord

>>> from sunpy.coordinates import frames
>>> import sunpy.coordinates

>>> hpc1 = SkyCoord(0*u.arcsec, 0*u.arcsec, observer="earth", obstime="2017-07-26", frame=frames.Helioprojective)
>>> hpc_out = sunpy.coordinates.Helioprojective(observer="venus", obstime="2017-07-26")
>>> hpc2 = hpc1.transform_to(hpc_out)

For example if you have two maps, named aia and stereo:

>>> hpc1 = SkyCoord(0*u.arcsec, 0*u.arcsec, frame=aia.coordinate_frame)  
>>> hpc2 = hpc1.transform_to(stereo.coordinate_frame)