Coordinates (heliopy.coordinates)¶

heliopy.coordinates Package¶

Creating coordinate objects¶

Coordinate objects can be created using the coordinate frame classes in heliopy.coordinates.frames, for example, to create a coordinate in a GSE frame:

>>> from astropy.constants import au
>>> import heliopy.coordinates.frames as frames
>>> hee_coord = frames.HeliocentricEarthEcliptic(1 * au, 0 * au, 0 * au)
>>> hee_coord
<HeliocentricEarthEcliptic Coordinate (obstime=None): (x, y, z) in m
(1.49597871e+11, 0., 0.)>

Transforming between coordinate systems¶

To transform between coordinate frames, the transform_to() method can be called on a coordinate object:

>>> from datetime import datetime
>>> from astropy.constants import au
>>> import heliopy.coordinates.frames as frames
>>>
>>> hee_coord = frames.HeliocentricEarthEcliptic(1 * au, 0 * au, 0 * au,
...     obstime=datetime(1992, 12, 21))
>>> gse_coord = hee_coord.transform_to(frames.GeocentricSolarEcliptic)
>>> gse_coord
<GeocentricSolarEcliptic Coordinate (obstime=None): (x, y, z) in m
(-2.42947355e+09, 0., 0.)>

heliopy.coordinates.frames Module¶

This submodule contains various space physics coordinate frames for use with the astropy.coordinates module.

Warning

The functions in this submodule should never be called directly, transforming between coordinate frames should be done using transform_to() on coordinate frame objects. See above for an example.

Transformation graph¶

The diagram below shows all of the built in coordinate systems, their aliases (useful for converting other coordinates to them using attribute-style access) and the pre-defined transformations between them. The user is free to override any of these transformations by defining new transformations between these systems, but the pre-defined transformations should be sufficient for typical usage.

The color of an edge in the graph (i.e. the transformations between two frames) is set by the type of transformation; the legend box defines the mapping from transform class name to color. • AffineTransform:

• FunctionTransform:

• FunctionTransformWithFiniteDifference:

• StaticMatrixTransform:

• DynamicMatrixTransform:

Functions¶

 hee_to_gse(hee_coord, gse_frame) Convert from HEE to GSE coordinates.

Classes¶

 GeocentricSolarEcliptic(*args[, copy, …]) A coordinate frame in the Geocentric Solar Ecliptic (GSE) system. HeliocentricEarthEcliptic(*args[, copy, …]) A coordinate frame in the Heliocentric Earth Ecliptic (HEE) system.