Heliocentric Earth Ecliptic coordinates in sunpy

Hi all,

I am having some trouble with the Heliocentric Earth Ecliptic coordinates in sunpy. All other missions I have found so far, Solar Orbiter and PROBA2/SWAP among them, seem to give these coordinates in the FITS header (HEEX/Y/Z keywords) in meters. When I use the HeliocentricEarthEcliptic class in sunpy, all I can get from it seems to be (lon, lat, distance) in (degrees, degrees, m or AU). Example code would be (with sc_locx/y/z being ECI coordinates):

gcrs_coord = GCRS(CartesianRepresentation(x=sc_locx, y=sc_locy, z=sc_locz, unit=u.m), obstime=obstime)
hee_coord = gcrs_coord.transform_to(HeliocentricEarthEcliptic(obstime=obstime))

I have tried using representation_type='cartesian', but to no avail. I guess I have two questions:

  1. Is there a way to get the results from the above transformation in meters with HeliocentricEarthEcliptic?
  2. When I take the HEEX/Y/Z values in meters from a FITS header, from PROBA2/SWAP for example, how do I import these into HeliocentricEarthEcliptic? It only seems to accept (degrees, degrees, m or AU).

Thanks for your help!
-Chris

1 Like

First, it is recommended you use SkyCoord rather than the frames directly.

Second, for ECI coordinates, use sunpy’s GeocentricEarthEquatorial rather than Astropy’s GCRS. The latter includes stellar aberration – the apparent shift in distant objects due to observer motion – which is presumably not appropriate for spacecraft coordinates.

I have tried using representation_type='cartesian' , but to no avail.

You can set the representation type after the coordinate is created:

hee_coord.representation_type = 'cartesian'

But, if all you need are the components, you don’t need to modify the coordinate’s representation. You can just call (including converting the components from AU to m):

hee_coord.cartesian.xyz.to('m')

When I take the HEEX/Y/Z values in meters from a FITS header, from PROBA2/SWAP for example, how do I import these into HeliocentricEarthEcliptic?

You can instantiate it with a CartesianRepresentation, in the same fashion that you did for gcrs_coord. If you use SkyCoord (again, which is recommended), you can provide Cartesian components as part of the instantiation, e.g.:

SkyCoord(x=hee_x, y=hee_y, z=hee_z, unit=u.m, representation_type='cartesian',
         frame='heliocentricearthecliptic', obstime=obstime)

Hope that helps!

1 Like

Thanks Albert! I will give this a try!