Coordinates (sunpy.coordinates
)#
This sub-package contains:
A robust framework for working with solar-physics coordinate systems
Functions to obtain the locations of solar-system bodies (
sunpy.coordinates.ephemeris
)Functions to calculate Sun-specific coordinate information (
sunpy.coordinates.sun
)Bridge module to enable the use of the
SkyCoord
API to perform computations using SPICE kernels (sunpy.coordinates.spice
)
The SunPy coordinate framework extends the Astropy coordinates framework. The coordinates guide provides in depth discussion of the structure and concepts underlying the coordinates framework.
Supported Coordinate Systems#
Coordinate system |
Abbreviation |
SunPy/Astropy equivalent |
Notes |
---|---|---|---|
Heliocentric Aries Ecliptic (Mean) |
HAE (also HEC) |
Astropy’s |
|
Heliocentric Cartesian |
HCC |
||
Heliocentric Earth Ecliptic |
HEE |
||
Heliocentric Earth Equatorial |
HEEQ (also HEQ) |
Use a Cartesian representation |
|
Heliocentric Inertial |
HCI |
||
Heliocentric Radial |
HCR |
similar to |
Use a cylindrical representation, but with a 90-degree offset in |
Heliocentric/Heliographic Radial-Tangential-Normal |
HGRTN |
similar to |
The axes are permuted, with HCC X, Y, Z equivalent respectively to HGRTN Y, Z, X |
Heliographic Carrington |
HGC |
||
Heliographic Stonyhurst |
HGS |
||
Helioprojective Cartesian |
HPC |
||
Geocentric Earth Equatorial (Mean) |
GEI |
||
Geographic |
GEO |
Astropy’s |
The precise geographic definitions may differ |
Geocentric Solar Ecliptic |
GSE |
||
Geomagnetic |
MAG |
||
Solar Magnetic |
SM |
||
GeocentricSolarMagnetospheric |
GSM |
For a description of these coordinate systems, see Thompson (2006) and Franz & Harper (2002) (and corrected version).
Reference/API#
sunpy.coordinates Package#
This subpackage contains:
A robust framework for working with coordinate systems
Functions to obtain the locations of solar-system bodies (
sunpy.coordinates.ephemeris
)Functions to calculate Sun-specific coordinate information (
sunpy.coordinates.sun
)
The diagram below shows all of Sun-based and Earth-based coordinate systems
available through sunpy.coordinates
, as well as the transformations between
them. Each frame is labeled with the name of its class and its alias (useful
for converting other coordinates to them using attribute-style access).
The frames colored in cyan are implemented in astropy.coordinates
, and there
are other astronomical frames that can be transformed to that are not shown
below (see astropy.coordinates.builtin_frames
).
-
AffineTransform: ➝
-
FunctionTransform: ➝
-
FunctionTransformWithFiniteDifference: ➝
-
StaticMatrixTransform: ➝
-
DynamicMatrixTransform: ➝
Built-in Frame Classes#
A coordinate or frame in the ICRS system. |
|
A coordinate or frame in the Altitude-Azimuth system (Horizontal coordinates) with respect to the WGS84 ellipsoid. |
|
A coordinate or frame in the Geocentric Celestial Reference System (GCRS). |
|
A coordinate or frame in the Celestial Intermediate Reference System (CIRS). |
|
A coordinate or frame in the International Terrestrial Reference System (ITRS). |
|
A coordinate or frame in a Heliocentric system, with axes aligned to ICRS. |
|
A coordinate frame defined in a similar manner as GCRS, but precessed to a requested (mean) equinox. |
|
Geocentric mean ecliptic coordinates. |
|
Heliocentric mean ecliptic coordinates. |
|
Geocentric true ecliptic coordinates. |
|
Heliocentric true ecliptic coordinates. |
Functions#
|
Return a |
|
Return a |
|
Queries JPL HORIZONS and returns a |
|
Context manager for coordinate transformations to automatically apply solar differential rotation for any change in observation time. |
|
For a given frame, this function returns the corresponding WCS object. |
This function registers the coordinates frames to their FITS-WCS coordinate type values in the |
|
Context manager for coordinate transformations to ignore the motion of the center of the Sun. |
Classes#
|
Base class for HeliographicCarrington (HGC) and HeliographicStonyhurst (HGS) frames. |
|
Base class for frames that rely on the Earth's magnetic model (MAG, SM, and GSM). |
|
A coordinate or frame in the Geocentric Earth Equatorial (GEI) system. |
|
A coordinate or frame in the Geocentric Solar Ecliptic (GSE) system. |
|
A coordinate or frame in the GeocentricSolarMagnetospheric (GSM) system. |
|
A coordinate or frame in the Geomagnetic (MAG) system. |
|
A coordinate or frame in the Heliocentric system, which is observer-based. |
|
A coordinate or frame in the Heliocentric Earth Ecliptic (HEE) system. |
|
A coordinate or frame in the Heliocentric Inertial (HCI) system. |
|
A coordinate or frame in the Carrington Heliographic (HGC) system. |
|
A coordinate or frame in the Stonyhurst Heliographic (HGS) system. |
|
A coordinate or frame in the Helioprojective Cartesian (HPC) system, which is observer-based. |
|
A frame which is offset from another frame such that it shares the same origin, but has its "north pole" (i.e., the Z axis) in a different direction. |
|
Context manager to interpret 2D coordinates as being on the inside of a planar screen. |
|
A frame that applies solar rotation to a base coordinate frame. |
|
A coordinate or frame in the Solar Magnetic (SM) system. |
|
Context manager to interpret 2D coordinates as being on the inside of a spherical screen. |
|
Base class for sunpy coordinate frames. |
Class Inheritance Diagram#
sunpy.coordinates.ephemeris Module#
Ephemeris calculations using SunPy coordinate frames
Functions#
|
Return a |
|
Return a |
|
Queries JPL HORIZONS and returns a |
sunpy.coordinates.spice Module#
Bridge module to use the SkyCoord API for SPICE computations.
Note
This module requires the optional dependency spiceypy
to be
installed.
The SPICE observation geometry information
system is being increasingly used by space missions to describe the locations of
spacecraft and the time-varying orientations of reference frames.
While the spiceypy
package provides a Python interface for
performing SPICE computations, its API is very different from that of
SkyCoord
.
This module “wraps” spiceypy
functionality so that relevant SPICE
computations can be accessed using the SkyCoord
API.
When loading a set of kernels, a frame class and corresponding transformations
are created for each SPICE frame. One can also query the location of a body
as computed via SPICE or retrieve the field of view (FOV) of an instrument.
To facilitate the conversion of a SPICE-based coordinate to the built-in frames
in sunpy.coordinates
, every SPICE-based coordinate has the method
to_helioprojective()
.
This method returns a coordinate in the Helioprojective
frame with the observer
frame attribute appropriately set.
Be aware that when converting a SPICE-based coordinate to/from a built-in frame, there can be small inconsistencies due to differing planetary ephemerides and models for various orientations.
Notes
2D coordinates can be transformed only if the to/from frames have the same SPICE body ID as their centers.
Transformations of velocities are not yet supported.
SPICE frame names are rendered as uppercase, except for plus/minus characters, which are replaced with lowercase
'p'
/'n'
characters.
Examples
Coordinates computations using SPICE kernels
Functions#
|
Get the location of a body via SPICE. |
|
Get the field of view (FOV) for an instrument via SPICE. |
|
Load one more more SPICE kernels and create corresponding frame classes. |
|
Install a specified SPICE frame. |
|
Get the rotation matrix between the orientations of two SPICE frames. |
Classes#
|
Base class for all frames generated to represent SPICE frames. |
Class Inheritance Diagram#
sunpy.coordinates.sun Module#
Sun-specific coordinate calculations
Functions#
|
Return the angular radius of the Sun as viewed from Earth. |
|
Returns the apparent position of the Sun (right ascension and declination) on the celestial sphere using the equatorial coordinate system, referred to the true equinox of date (as default). |
Return the Carrington rotation number. |
|
|
Return the time of a given Carrington rotation. |
|
Returns the Sun's true geometric longitude, referred to the mean equinox of date. |
|
Returns the Sun's apparent longitude, referred to the true equinox of date. |
|
Returns the Sun's true geometric latitude, referred to the mean equinox of date. |
|
Returns the Sun's apparent latitude, referred to the true equinox of date. |
Returns the mean obliquity of the ecliptic, using the IAU 2006 definition. |
|
|
Returns the Sun's true geometric right ascension relative to Earth, referred to the mean equinox of date (as default). |
|
Returns the Sun's true geometric declination relative to Earth, referred to the mean equinox of date (as default). |
Returns the true obliquity of the ecliptic, using the IAU 2006 definition. |
|
|
Returns the Sun's apparent right ascension relative to Earth, referred to the true equinox of date (as default). |
|
Returns the Sun's apparent declination relative to Earth, referred to the true equinox of date (as default). |
|
Print out a summary of solar ephemeris. |
|
Return the B0 angle for the Sun at a specified time, which is the heliographic latitude of the of the center of the disk of the Sun as seen from Earth. |
|
Return the L0 angle for the Sun at a specified time, which is the apparent Carrington longitude of the Sun-disk center as seen from Earth. |
|
Return the position (P) angle for the Sun at a specified time, which is the angle between geocentric north and solar north as seen from Earth, measured eastward from geocentric north. |
|
Return the distance between the Sun and the Earth at a specified time. |
|
Return the orientation angle for the Sun from a specified Earth location and time. |
|
Return the percentage of the Sun that is eclipsed by the Moon. |
sunpy.coordinates.utils Module#
Miscellaneous utilities related to coordinates
Functions#
|
Specify a rectangular region of interest in longitude and latitude in a given coordinate frame. |
|
Return the equivalency to convert between a physical distance on the Sun and an angular separation as seen by a specified observer. |
|
Get coordinates for the solar limb as viewed by a specified observer. |
Classes#
|
Calculate the properties of a great arc at user-specified points between a start and end point on a sphere. |
Reference/API for supporting coordinates modules#
The parts of the following modules that are useful to a typical user are already imported into the sunpy.coordinates
namespace.
sunpy.coordinates.frames Module#
Common solar physics coordinate systems.
This submodule implements various solar physics coordinate frames for use with
the astropy.coordinates
module.
Classes#
|
Base class for sunpy coordinate frames. |
|
Base class for HeliographicCarrington (HGC) and HeliographicStonyhurst (HGS) frames. |
|
Base class for frames that rely on the Earth's magnetic model (MAG, SM, and GSM). |
|
A coordinate or frame in the Stonyhurst Heliographic (HGS) system. |
|
A coordinate or frame in the Carrington Heliographic (HGC) system. |
|
A coordinate or frame in the Heliocentric system, which is observer-based. |
|
A coordinate or frame in the Helioprojective Cartesian (HPC) system, which is observer-based. |
|
A coordinate or frame in the Heliocentric Earth Ecliptic (HEE) system. |
|
A coordinate or frame in the Geocentric Solar Ecliptic (GSE) system. |
|
A coordinate or frame in the Heliocentric Inertial (HCI) system. |
|
A coordinate or frame in the Geocentric Earth Equatorial (GEI) system. |
|
A coordinate or frame in the Geomagnetic (MAG) system. |
|
A coordinate or frame in the Solar Magnetic (SM) system. |
|
A coordinate or frame in the GeocentricSolarMagnetospheric (GSM) system. |
Class Inheritance Diagram#
sunpy.coordinates.screens Module#
Screen class definitions for making assumptions about off-disk emission
Classes#
|
|
|
Context manager to interpret 2D coordinates as being on the inside of a spherical screen. |
|
Context manager to interpret 2D coordinates as being on the inside of a planar screen. |
Class Inheritance Diagram#
sunpy.coordinates.metaframes Module#
Coordinate frames that are defined relative to other frames
Classes#
|
A frame which is offset from another frame such that it shares the same origin, but has its "north pole" (i.e., the Z axis) in a different direction. |
|
A frame that applies solar rotation to a base coordinate frame. |
Class Inheritance Diagram#
sunpy.coordinates.wcs_utils Module#
Functions#
This function registers the coordinates frames to their FITS-WCS coordinate type values in the |
|
|
For a given frame, this function returns the corresponding WCS object. |
Attribution#
Some of this documentation was adapted from Astropy under the terms of the BSD License.
This sub-package was initially developed by Pritish Chakraborty as part of GSOC 2014 and Stuart Mumford.