Reference Frame Router¶
CelestialFrame and the generic rotation_frame_to_frame/position_frame_to_frame/state_frame_to_frame functions convert between any two supported reference frames, including generic NAIF-ID variants for bodies without a dedicated named frame.
Note
For conceptual explanations and the full frame/kernel-requirement tables, see Reference Frame Router in the Learn section. For central-body propagation defaults, see Cislunar and Lunar Propagation and Propagation Around Other Central Bodies.
CelestialFrame¶
CelestialFrame ¶
A reference frame supported by the centralized frame router (rotation_frame_to_frame, position_frame_to_frame, state_frame_to_frame).
Includes every named frame defined elsewhere in this module (GCRF, ITRF, EME2000, the lunar frames LFPA/LFME, and the Mars frame MCMF, plus the corresponding inertial frames LCI/MCI), the Earth-Moon and Solar System barycentric inertial frames (EMBI, SSBI), and three generic constructors for bodies without a dedicated named frame: BodyCenteredICRF(naif_id), BodyFixedIAU(naif_id), and BodyFixedPCK(center, frame_id).
Frame centers (NAIF ID): GCRF/ITRF/EME2000 -> Earth (399); LCI/LFPA/LFME -> Moon (301); MCI/MCMF -> Mars (499); EMBI -> 3; SSBI -> 0; BodyCenteredICRF(id)/BodyFixedIAU(id) -> id; BodyFixedPCK -> its center.
Example
Initialize instance.
ECEF class-attribute ¶
ECEF: Any = CelestialFrame.ITRF
A reference frame supported by the centralized frame router (rotation_frame_to_frame, position_frame_to_frame, state_frame_to_frame).
Includes every named frame defined elsewhere in this module (GCRF, ITRF, EME2000, the lunar frames LFPA/LFME, and the Mars frame MCMF, plus the corresponding inertial frames LCI/MCI), the Earth-Moon and Solar System barycentric inertial frames (EMBI, SSBI), and three generic constructors for bodies without a dedicated named frame: BodyCenteredICRF(naif_id), BodyFixedIAU(naif_id), and BodyFixedPCK(center, frame_id).
Frame centers (NAIF ID): GCRF/ITRF/EME2000 -> Earth (399); LCI/LFPA/LFME -> Moon (301); MCI/MCMF -> Mars (499); EMBI -> 3; SSBI -> 0; BodyCenteredICRF(id)/BodyFixedIAU(id) -> id; BodyFixedPCK -> its center.
ECI class-attribute ¶
ECI: Any = CelestialFrame.GCRF
A reference frame supported by the centralized frame router (rotation_frame_to_frame, position_frame_to_frame, state_frame_to_frame).
Includes every named frame defined elsewhere in this module (GCRF, ITRF, EME2000, the lunar frames LFPA/LFME, and the Mars frame MCMF, plus the corresponding inertial frames LCI/MCI), the Earth-Moon and Solar System barycentric inertial frames (EMBI, SSBI), and three generic constructors for bodies without a dedicated named frame: BodyCenteredICRF(naif_id), BodyFixedIAU(naif_id), and BodyFixedPCK(center, frame_id).
Frame centers (NAIF ID): GCRF/ITRF/EME2000 -> Earth (399); LCI/LFPA/LFME -> Moon (301); MCI/MCMF -> Mars (499); EMBI -> 3; SSBI -> 0; BodyCenteredICRF(id)/BodyFixedIAU(id) -> id; BodyFixedPCK -> its center.
EMBI class-attribute ¶
EMBI: Any = CelestialFrame.EMBI
A reference frame supported by the centralized frame router (rotation_frame_to_frame, position_frame_to_frame, state_frame_to_frame).
Includes every named frame defined elsewhere in this module (GCRF, ITRF, EME2000, the lunar frames LFPA/LFME, and the Mars frame MCMF, plus the corresponding inertial frames LCI/MCI), the Earth-Moon and Solar System barycentric inertial frames (EMBI, SSBI), and three generic constructors for bodies without a dedicated named frame: BodyCenteredICRF(naif_id), BodyFixedIAU(naif_id), and BodyFixedPCK(center, frame_id).
Frame centers (NAIF ID): GCRF/ITRF/EME2000 -> Earth (399); LCI/LFPA/LFME -> Moon (301); MCI/MCMF -> Mars (499); EMBI -> 3; SSBI -> 0; BodyCenteredICRF(id)/BodyFixedIAU(id) -> id; BodyFixedPCK -> its center.
EME2000 class-attribute ¶
EME2000: Any = CelestialFrame.EME2000
A reference frame supported by the centralized frame router (rotation_frame_to_frame, position_frame_to_frame, state_frame_to_frame).
Includes every named frame defined elsewhere in this module (GCRF, ITRF, EME2000, the lunar frames LFPA/LFME, and the Mars frame MCMF, plus the corresponding inertial frames LCI/MCI), the Earth-Moon and Solar System barycentric inertial frames (EMBI, SSBI), and three generic constructors for bodies without a dedicated named frame: BodyCenteredICRF(naif_id), BodyFixedIAU(naif_id), and BodyFixedPCK(center, frame_id).
Frame centers (NAIF ID): GCRF/ITRF/EME2000 -> Earth (399); LCI/LFPA/LFME -> Moon (301); MCI/MCMF -> Mars (499); EMBI -> 3; SSBI -> 0; BodyCenteredICRF(id)/BodyFixedIAU(id) -> id; BodyFixedPCK -> its center.
EMR class-attribute ¶
EMR: Any = CelestialFrame.EMR
A reference frame supported by the centralized frame router (rotation_frame_to_frame, position_frame_to_frame, state_frame_to_frame).
Includes every named frame defined elsewhere in this module (GCRF, ITRF, EME2000, the lunar frames LFPA/LFME, and the Mars frame MCMF, plus the corresponding inertial frames LCI/MCI), the Earth-Moon and Solar System barycentric inertial frames (EMBI, SSBI), and three generic constructors for bodies without a dedicated named frame: BodyCenteredICRF(naif_id), BodyFixedIAU(naif_id), and BodyFixedPCK(center, frame_id).
Frame centers (NAIF ID): GCRF/ITRF/EME2000 -> Earth (399); LCI/LFPA/LFME -> Moon (301); MCI/MCMF -> Mars (499); EMBI -> 3; SSBI -> 0; BodyCenteredICRF(id)/BodyFixedIAU(id) -> id; BodyFixedPCK -> its center.
GCRF class-attribute ¶
GCRF: Any = CelestialFrame.GCRF
A reference frame supported by the centralized frame router (rotation_frame_to_frame, position_frame_to_frame, state_frame_to_frame).
Includes every named frame defined elsewhere in this module (GCRF, ITRF, EME2000, the lunar frames LFPA/LFME, and the Mars frame MCMF, plus the corresponding inertial frames LCI/MCI), the Earth-Moon and Solar System barycentric inertial frames (EMBI, SSBI), and three generic constructors for bodies without a dedicated named frame: BodyCenteredICRF(naif_id), BodyFixedIAU(naif_id), and BodyFixedPCK(center, frame_id).
Frame centers (NAIF ID): GCRF/ITRF/EME2000 -> Earth (399); LCI/LFPA/LFME -> Moon (301); MCI/MCMF -> Mars (499); EMBI -> 3; SSBI -> 0; BodyCenteredICRF(id)/BodyFixedIAU(id) -> id; BodyFixedPCK -> its center.
GSE class-attribute ¶
GSE: Any = CelestialFrame.GSE
A reference frame supported by the centralized frame router (rotation_frame_to_frame, position_frame_to_frame, state_frame_to_frame).
Includes every named frame defined elsewhere in this module (GCRF, ITRF, EME2000, the lunar frames LFPA/LFME, and the Mars frame MCMF, plus the corresponding inertial frames LCI/MCI), the Earth-Moon and Solar System barycentric inertial frames (EMBI, SSBI), and three generic constructors for bodies without a dedicated named frame: BodyCenteredICRF(naif_id), BodyFixedIAU(naif_id), and BodyFixedPCK(center, frame_id).
Frame centers (NAIF ID): GCRF/ITRF/EME2000 -> Earth (399); LCI/LFPA/LFME -> Moon (301); MCI/MCMF -> Mars (499); EMBI -> 3; SSBI -> 0; BodyCenteredICRF(id)/BodyFixedIAU(id) -> id; BodyFixedPCK -> its center.
ITRF class-attribute ¶
ITRF: Any = CelestialFrame.ITRF
A reference frame supported by the centralized frame router (rotation_frame_to_frame, position_frame_to_frame, state_frame_to_frame).
Includes every named frame defined elsewhere in this module (GCRF, ITRF, EME2000, the lunar frames LFPA/LFME, and the Mars frame MCMF, plus the corresponding inertial frames LCI/MCI), the Earth-Moon and Solar System barycentric inertial frames (EMBI, SSBI), and three generic constructors for bodies without a dedicated named frame: BodyCenteredICRF(naif_id), BodyFixedIAU(naif_id), and BodyFixedPCK(center, frame_id).
Frame centers (NAIF ID): GCRF/ITRF/EME2000 -> Earth (399); LCI/LFPA/LFME -> Moon (301); MCI/MCMF -> Mars (499); EMBI -> 3; SSBI -> 0; BodyCenteredICRF(id)/BodyFixedIAU(id) -> id; BodyFixedPCK -> its center.
LCI class-attribute ¶
LCI: Any = CelestialFrame.LCI
A reference frame supported by the centralized frame router (rotation_frame_to_frame, position_frame_to_frame, state_frame_to_frame).
Includes every named frame defined elsewhere in this module (GCRF, ITRF, EME2000, the lunar frames LFPA/LFME, and the Mars frame MCMF, plus the corresponding inertial frames LCI/MCI), the Earth-Moon and Solar System barycentric inertial frames (EMBI, SSBI), and three generic constructors for bodies without a dedicated named frame: BodyCenteredICRF(naif_id), BodyFixedIAU(naif_id), and BodyFixedPCK(center, frame_id).
Frame centers (NAIF ID): GCRF/ITRF/EME2000 -> Earth (399); LCI/LFPA/LFME -> Moon (301); MCI/MCMF -> Mars (499); EMBI -> 3; SSBI -> 0; BodyCenteredICRF(id)/BodyFixedIAU(id) -> id; BodyFixedPCK -> its center.
LFME class-attribute ¶
LFME: Any = CelestialFrame.LFME
A reference frame supported by the centralized frame router (rotation_frame_to_frame, position_frame_to_frame, state_frame_to_frame).
Includes every named frame defined elsewhere in this module (GCRF, ITRF, EME2000, the lunar frames LFPA/LFME, and the Mars frame MCMF, plus the corresponding inertial frames LCI/MCI), the Earth-Moon and Solar System barycentric inertial frames (EMBI, SSBI), and three generic constructors for bodies without a dedicated named frame: BodyCenteredICRF(naif_id), BodyFixedIAU(naif_id), and BodyFixedPCK(center, frame_id).
Frame centers (NAIF ID): GCRF/ITRF/EME2000 -> Earth (399); LCI/LFPA/LFME -> Moon (301); MCI/MCMF -> Mars (499); EMBI -> 3; SSBI -> 0; BodyCenteredICRF(id)/BodyFixedIAU(id) -> id; BodyFixedPCK -> its center.
LFPA class-attribute ¶
LFPA: Any = CelestialFrame.LFPA
A reference frame supported by the centralized frame router (rotation_frame_to_frame, position_frame_to_frame, state_frame_to_frame).
Includes every named frame defined elsewhere in this module (GCRF, ITRF, EME2000, the lunar frames LFPA/LFME, and the Mars frame MCMF, plus the corresponding inertial frames LCI/MCI), the Earth-Moon and Solar System barycentric inertial frames (EMBI, SSBI), and three generic constructors for bodies without a dedicated named frame: BodyCenteredICRF(naif_id), BodyFixedIAU(naif_id), and BodyFixedPCK(center, frame_id).
Frame centers (NAIF ID): GCRF/ITRF/EME2000 -> Earth (399); LCI/LFPA/LFME -> Moon (301); MCI/MCMF -> Mars (499); EMBI -> 3; SSBI -> 0; BodyCenteredICRF(id)/BodyFixedIAU(id) -> id; BodyFixedPCK -> its center.
MCI class-attribute ¶
MCI: Any = CelestialFrame.MCI
A reference frame supported by the centralized frame router (rotation_frame_to_frame, position_frame_to_frame, state_frame_to_frame).
Includes every named frame defined elsewhere in this module (GCRF, ITRF, EME2000, the lunar frames LFPA/LFME, and the Mars frame MCMF, plus the corresponding inertial frames LCI/MCI), the Earth-Moon and Solar System barycentric inertial frames (EMBI, SSBI), and three generic constructors for bodies without a dedicated named frame: BodyCenteredICRF(naif_id), BodyFixedIAU(naif_id), and BodyFixedPCK(center, frame_id).
Frame centers (NAIF ID): GCRF/ITRF/EME2000 -> Earth (399); LCI/LFPA/LFME -> Moon (301); MCI/MCMF -> Mars (499); EMBI -> 3; SSBI -> 0; BodyCenteredICRF(id)/BodyFixedIAU(id) -> id; BodyFixedPCK -> its center.
MCMF class-attribute ¶
MCMF: Any = CelestialFrame.MCMF
A reference frame supported by the centralized frame router (rotation_frame_to_frame, position_frame_to_frame, state_frame_to_frame).
Includes every named frame defined elsewhere in this module (GCRF, ITRF, EME2000, the lunar frames LFPA/LFME, and the Mars frame MCMF, plus the corresponding inertial frames LCI/MCI), the Earth-Moon and Solar System barycentric inertial frames (EMBI, SSBI), and three generic constructors for bodies without a dedicated named frame: BodyCenteredICRF(naif_id), BodyFixedIAU(naif_id), and BodyFixedPCK(center, frame_id).
Frame centers (NAIF ID): GCRF/ITRF/EME2000 -> Earth (399); LCI/LFPA/LFME -> Moon (301); MCI/MCMF -> Mars (499); EMBI -> 3; SSBI -> 0; BodyCenteredICRF(id)/BodyFixedIAU(id) -> id; BodyFixedPCK -> its center.
MOD class-attribute ¶
MOD: Any = CelestialFrame.MOD
A reference frame supported by the centralized frame router (rotation_frame_to_frame, position_frame_to_frame, state_frame_to_frame).
Includes every named frame defined elsewhere in this module (GCRF, ITRF, EME2000, the lunar frames LFPA/LFME, and the Mars frame MCMF, plus the corresponding inertial frames LCI/MCI), the Earth-Moon and Solar System barycentric inertial frames (EMBI, SSBI), and three generic constructors for bodies without a dedicated named frame: BodyCenteredICRF(naif_id), BodyFixedIAU(naif_id), and BodyFixedPCK(center, frame_id).
Frame centers (NAIF ID): GCRF/ITRF/EME2000 -> Earth (399); LCI/LFPA/LFME -> Moon (301); MCI/MCMF -> Mars (499); EMBI -> 3; SSBI -> 0; BodyCenteredICRF(id)/BodyFixedIAU(id) -> id; BodyFixedPCK -> its center.
SER class-attribute ¶
SER: Any = CelestialFrame.SER
A reference frame supported by the centralized frame router (rotation_frame_to_frame, position_frame_to_frame, state_frame_to_frame).
Includes every named frame defined elsewhere in this module (GCRF, ITRF, EME2000, the lunar frames LFPA/LFME, and the Mars frame MCMF, plus the corresponding inertial frames LCI/MCI), the Earth-Moon and Solar System barycentric inertial frames (EMBI, SSBI), and three generic constructors for bodies without a dedicated named frame: BodyCenteredICRF(naif_id), BodyFixedIAU(naif_id), and BodyFixedPCK(center, frame_id).
Frame centers (NAIF ID): GCRF/ITRF/EME2000 -> Earth (399); LCI/LFPA/LFME -> Moon (301); MCI/MCMF -> Mars (499); EMBI -> 3; SSBI -> 0; BodyCenteredICRF(id)/BodyFixedIAU(id) -> id; BodyFixedPCK -> its center.
SSBI class-attribute ¶
SSBI: Any = CelestialFrame.SSBI
A reference frame supported by the centralized frame router (rotation_frame_to_frame, position_frame_to_frame, state_frame_to_frame).
Includes every named frame defined elsewhere in this module (GCRF, ITRF, EME2000, the lunar frames LFPA/LFME, and the Mars frame MCMF, plus the corresponding inertial frames LCI/MCI), the Earth-Moon and Solar System barycentric inertial frames (EMBI, SSBI), and three generic constructors for bodies without a dedicated named frame: BodyCenteredICRF(naif_id), BodyFixedIAU(naif_id), and BodyFixedPCK(center, frame_id).
Frame centers (NAIF ID): GCRF/ITRF/EME2000 -> Earth (399); LCI/LFPA/LFME -> Moon (301); MCI/MCMF -> Mars (499); EMBI -> 3; SSBI -> 0; BodyCenteredICRF(id)/BodyFixedIAU(id) -> id; BodyFixedPCK -> its center.
TOD class-attribute ¶
TOD: Any = CelestialFrame.TOD
A reference frame supported by the centralized frame router (rotation_frame_to_frame, position_frame_to_frame, state_frame_to_frame).
Includes every named frame defined elsewhere in this module (GCRF, ITRF, EME2000, the lunar frames LFPA/LFME, and the Mars frame MCMF, plus the corresponding inertial frames LCI/MCI), the Earth-Moon and Solar System barycentric inertial frames (EMBI, SSBI), and three generic constructors for bodies without a dedicated named frame: BodyCenteredICRF(naif_id), BodyFixedIAU(naif_id), and BodyFixedPCK(center, frame_id).
Frame centers (NAIF ID): GCRF/ITRF/EME2000 -> Earth (399); LCI/LFPA/LFME -> Moon (301); MCI/MCMF -> Mars (499); EMBI -> 3; SSBI -> 0; BodyCenteredICRF(id)/BodyFixedIAU(id) -> id; BodyFixedPCK -> its center.
axes property ¶
axes: FrameAxes
Orientation of this frame's axes, independent of its origin.
Returns:
| Name | Type | Description |
|---|---|---|
FrameAxes | FrameAxes | The frame's axes |
center property ¶
center: FrameCenter
Body or barycenter at this frame's origin.
The semantic form of center_naif_id: a FrameCenter naming either a single body (catalogued or a self-assigned raw ID) or the GM-weighted barycenter of a two-body pair. It compares equal to a NAIFId or a plain integer with the same NAIF ID.
Returns:
| Name | Type | Description |
|---|---|---|
FrameCenter | FrameCenter | The frame's origin |
center_naif_id property ¶
center_naif_id: int
NAIF ID of the body or barycenter at this frame's origin.
Returns:
| Name | Type | Description |
|---|---|---|
int | int | NAIF ID of the frame's origin |
synodic_origin property ¶
synodic_origin: Optional[SynodicOrigin]
Origin choice of a synodic frame (Synodic, EMR, SER, GSE).
A centered frame carrying synodic axes has no origin choice: its center is stored directly, so this returns None while synodic_primary and synodic_secondary still report the pair.
Returns:
| Type | Description |
|---|---|
Optional[SynodicOrigin] | Optional[SynodicOrigin]: Origin choice, or |
synodic_primary property ¶
synodic_secondary property ¶
BodyCenteredICRF staticmethod ¶
BodyCenteredICRF(naif_id: int) -> CelestialFrame
ICRF-aligned axes centered on the given NAIF ID.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
naif_id | int | NAIF ID of the frame's center | required |
Returns:
| Name | Type | Description |
|---|---|---|
CelestialFrame | CelestialFrame | ICRF-aligned frame centered on |
BodyFixedCustom staticmethod ¶
BodyFixedCustom(center: int, key: int) -> CelestialFrame
Body-fixed frame evaluated from a user-registered rotation callback (see register_custom_frame), centered on center.
For a body without a catalogued NAIF ID, self-assign a unique negative center (mirroring NAIF's convention for non-catalogued objects): rotation-only queries never consult the center, and translations will raise unless an ephemeris covering that ID is loaded.
Center IDs at or below -1_000_000_000 are reserved for synthetic synodic barycenter centers (see Synodic); self-assigning one to a custom body is unlikely to collide with an actual synodic pair's encoded ID, but is not rejected, since real user-defined bodies and loaded kernels may legitimately need any negative ID.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
center | int | NAIF ID of the frame's center (may be self-assigned negative) | required |
key | int | Registry key the frame's callbacks were registered under | required |
Returns:
| Name | Type | Description |
|---|---|---|
CelestialFrame | CelestialFrame | Custom body-fixed frame for |
BodyFixedIAU staticmethod ¶
BodyFixedIAU(naif_id: int) -> CelestialFrame
IAU/WGCCRE body-fixed frame of the given NAIF ID, centered on that same NAIF ID.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
naif_id | int | NAIF ID of the body (see | required |
Returns:
| Name | Type | Description |
|---|---|---|
CelestialFrame | CelestialFrame | IAU/WGCCRE body-fixed frame of |
BodyFixedPCK staticmethod ¶
BodyFixedPCK(center: int, frame_id: int) -> CelestialFrame
Body-fixed frame evaluated from a loaded binary PCK's frame_id, centered on center.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
center | int | NAIF ID of the frame's center | required |
frame_id | int | NAIF binary PCK frame class ID (e.g. 31008 for | required |
Returns:
| Name | Type | Description |
|---|---|---|
CelestialFrame | CelestialFrame | Body-fixed frame for |
Centered staticmethod ¶
Centered(center: FrameCenter | NAIFId | int, axes: FrameAxes) -> CelestialFrame
Frame centered on center with the given axes.
Returns the named shorthand whenever the pair has one (so Centered(399, FrameAxes.EME2000) is CelestialFrame.EME2000 and Centered(301, FrameAxes.ICRF) is CelestialFrame.LCI), and a generic centered frame otherwise. CelestialFrame.Centered(f.center, f.axes) == f holds for every canonical frame value. Where a named frame and a generic frame describe the same pair, the named form is returned: CelestialFrame.Synodic(SynodicOrigin.Barycenter, 10, 399) round trips to CelestialFrame.SER and CelestialFrame.Synodic(SynodicOrigin.Primary, 399, 10) to CelestialFrame.GSE, and CelestialFrame.BodyCenteredICRF at 399, 301, 499, 3 or 0 round trips to CelestialFrame.GCRF, CelestialFrame.LCI, CelestialFrame.MCI, CelestialFrame.EMBI or CelestialFrame.SSBI.
The origin is canonicalized on FrameCenter.naif_id, so FrameCenter.Barycenter(primary, secondary) and the equivalent raw synthetic ID select the same named frame. When no named form exists, the origin is stored as given, so those two spellings produce distinct (but identically translating) frames.
FrameAxes.EMR, FrameAxes.SER and FrameAxes.GSE are the same orientations as their generic synodic pairs, so they are accepted at any center: Centered(3, FrameAxes.EMR) is CelestialFrame.EMR and Centered(399, FrameAxes.EMR) is the Earth-centered frame with those same axes.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
center | FrameCenter | NAIFId | int | The frame's origin | required |
axes | FrameAxes | Orientation of the frame's axes | required |
Returns:
| Name | Type | Description |
|---|---|---|
CelestialFrame | CelestialFrame | The frame with that center and those axes |
Raises:
| Type | Description |
|---|---|
TypeError | If |
Synodic staticmethod ¶
Synodic(origin: SynodicOrigin, primary: int, secondary: int) -> CelestialFrame
Generic two-body synodic (rotating) frame: x̂ from primary toward secondary, ẑ along the secondary's orbital angular momentum relative to the primary, centered per origin. The named frames are specific configurations: EMR == Synodic(Barycenter, 399, 301), SER == Synodic(Barycenter, 10, 399), GSE == Synodic(Primary, 399, 10).
Any NAIF ID is accepted for primary and secondary. For a Barycenter origin, the pair is encoded into a synthetic negative center ID; this encoding is collision-free when both IDs are in 0..=999, and both bodies must have packaged GM constants. IDs outside 0..=999 still construct successfully but produce a different encoding that no longer maps back to a synthetic center — this surfaces as an SPK/GM lookup error at transform time rather than a silent collision.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
origin | SynodicOrigin | Origin choice (primary, secondary, or barycenter) | required |
primary | int | NAIF ID of the primary body | required |
secondary | int | NAIF ID of the secondary body | required |
Returns:
| Name | Type | Description |
|---|---|---|
CelestialFrame | CelestialFrame | Generic synodic frame for the pair |
from_string staticmethod ¶
from_string(s: str) -> CelestialFrame
Parses a CelestialFrame from its string representation (named variants only, case-insensitive), plus the common aliases "ECI" (-> GCRF) and "ECEF" (-> ITRF).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
s | str | String representation of the reference frame | required |
Returns:
| Name | Type | Description |
|---|---|---|
CelestialFrame | CelestialFrame | Parsed reference frame |
Raises:
| Type | Description |
|---|---|
ValueError | If |
FrameCenter¶
FrameCenter ¶
Origin of a celestial frame, independent of its axes.
FrameCenter.Body(naif_id) names a NAIF-catalogued body or system barycenter, or any raw integer ID such as a self-assigned negative center. FrameCenter.Barycenter(primary, secondary) names the GM-weighted barycenter of a two-body pair, the origin the synodic frames compute analytically rather than reading from an ephemeris; it is a different point from a catalogued system barycenter such as NAIFId.EARTH_MOON_BARYCENTER, which is a body.
naif_id is the identity the frame router uses: two centers with the same naif_id translate identically, and CelestialFrame.Centered canonicalizes on it. Equality against another FrameCenter, a NAIFId, or a plain integer likewise compares naif_id.
Example
Initialize instance.
body property ¶
body: Any
The single body at this origin, when there is one.
Returns:
| Type | Description |
|---|---|
Any | NAIFId | int | None: The |
naif_id property ¶
naif_id: int
NAIF ID of this origin.
Returns:
| Name | Type | Description |
|---|---|---|
int | int | NAIF ID of the origin, synthetic and negative for a two-body barycenter |
name property ¶
name: str
Name of this origin.
Returns:
| Name | Type | Description |
|---|---|---|
str | str | NAIF body name (or the raw integer ID for an uncatalogued body), or |
Barycenter staticmethod ¶
Barycenter(primary: int | NAIFId, secondary: int | NAIFId) -> FrameCenter
GM-weighted barycenter of a two-body pair, as used by the synodic frames.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
primary | int | NAIFId | NAIF ID of the primary body | required |
secondary | int | NAIFId | NAIF ID of the secondary body | required |
Returns:
| Name | Type | Description |
|---|---|---|
FrameCenter | FrameCenter | The two-body barycentric origin |
Body staticmethod ¶
Body(naif_id: int | NAIFId) -> FrameCenter
A NAIF-catalogued body or system barycenter, or any raw integer ID.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
naif_id | int | NAIFId | NAIF ID of the body or system barycenter | required |
Returns:
| Name | Type | Description |
|---|---|---|
FrameCenter | FrameCenter | The body-centered origin |
from_string staticmethod ¶
from_string(s: str) -> FrameCenter
Parses a NAIF body name, accepted alias, or integer ID string into a body-centered origin.
The BARYCENTER(primary, secondary) form name prints for a two-body barycenter is not parsed; build that with Barycenter.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
s | str | A NAIF body name (e.g. "MARS BARYCENTER"), an accepted alias (e.g. "SSB"), or an integer NAIF ID string | required |
Returns:
| Name | Type | Description |
|---|---|---|
FrameCenter | FrameCenter | Parsed origin |
Raises:
| Type | Description |
|---|---|
ValueError | If |
FrameAxes¶
FrameAxes ¶
Orientation of a celestial frame, independent of its origin.
A CelestialFrame is the pair of one FrameCenter value and one FrameAxes value; CelestialFrame.Centered(center, axes) builds that pair and CelestialFrame.center / CelestialFrame.axes read it back.
The argument-free orientations are class attributes (ICRF, EME2000, MOD, TOD, ITRF, LunarPA, LunarME, MarsFixed, EMR, SER, GSE); the parameterized ones are built with BodyFixedIAU(naif_id), BodyFixedPCK(frame_id), BodyFixedCustom(key) and Synodic(primary, secondary).
Rotating axes (ITRF, the body-fixed families, and the synodic families) carry transport-velocity terms that depend only on the axes' angular velocity, so they apply unchanged to a frame centered on a body other than the orientation's usual center.
Example
Initialize instance.
EME2000 class-attribute ¶
EME2000: Any = FrameAxes.EME2000
Orientation of a celestial frame, independent of its origin.
A CelestialFrame is the pair of one FrameCenter value and one FrameAxes value; CelestialFrame.Centered(center, axes) builds that pair and CelestialFrame.center / CelestialFrame.axes read it back.
The argument-free orientations are class attributes (ICRF, EME2000, MOD, TOD, ITRF, LunarPA, LunarME, MarsFixed, EMR, SER, GSE); the parameterized ones are built with BodyFixedIAU(naif_id), BodyFixedPCK(frame_id), BodyFixedCustom(key) and Synodic(primary, secondary).
Rotating axes (ITRF, the body-fixed families, and the synodic families) carry transport-velocity terms that depend only on the axes' angular velocity, so they apply unchanged to a frame centered on a body other than the orientation's usual center.
EMR class-attribute ¶
EMR: Any = FrameAxes.EMR
Orientation of a celestial frame, independent of its origin.
A CelestialFrame is the pair of one FrameCenter value and one FrameAxes value; CelestialFrame.Centered(center, axes) builds that pair and CelestialFrame.center / CelestialFrame.axes read it back.
The argument-free orientations are class attributes (ICRF, EME2000, MOD, TOD, ITRF, LunarPA, LunarME, MarsFixed, EMR, SER, GSE); the parameterized ones are built with BodyFixedIAU(naif_id), BodyFixedPCK(frame_id), BodyFixedCustom(key) and Synodic(primary, secondary).
Rotating axes (ITRF, the body-fixed families, and the synodic families) carry transport-velocity terms that depend only on the axes' angular velocity, so they apply unchanged to a frame centered on a body other than the orientation's usual center.
GSE class-attribute ¶
GSE: Any = FrameAxes.GSE
Orientation of a celestial frame, independent of its origin.
A CelestialFrame is the pair of one FrameCenter value and one FrameAxes value; CelestialFrame.Centered(center, axes) builds that pair and CelestialFrame.center / CelestialFrame.axes read it back.
The argument-free orientations are class attributes (ICRF, EME2000, MOD, TOD, ITRF, LunarPA, LunarME, MarsFixed, EMR, SER, GSE); the parameterized ones are built with BodyFixedIAU(naif_id), BodyFixedPCK(frame_id), BodyFixedCustom(key) and Synodic(primary, secondary).
Rotating axes (ITRF, the body-fixed families, and the synodic families) carry transport-velocity terms that depend only on the axes' angular velocity, so they apply unchanged to a frame centered on a body other than the orientation's usual center.
ICRF class-attribute ¶
ICRF: Any = FrameAxes.ICRF
Orientation of a celestial frame, independent of its origin.
A CelestialFrame is the pair of one FrameCenter value and one FrameAxes value; CelestialFrame.Centered(center, axes) builds that pair and CelestialFrame.center / CelestialFrame.axes read it back.
The argument-free orientations are class attributes (ICRF, EME2000, MOD, TOD, ITRF, LunarPA, LunarME, MarsFixed, EMR, SER, GSE); the parameterized ones are built with BodyFixedIAU(naif_id), BodyFixedPCK(frame_id), BodyFixedCustom(key) and Synodic(primary, secondary).
Rotating axes (ITRF, the body-fixed families, and the synodic families) carry transport-velocity terms that depend only on the axes' angular velocity, so they apply unchanged to a frame centered on a body other than the orientation's usual center.
ITRF class-attribute ¶
ITRF: Any = FrameAxes.ITRF
Orientation of a celestial frame, independent of its origin.
A CelestialFrame is the pair of one FrameCenter value and one FrameAxes value; CelestialFrame.Centered(center, axes) builds that pair and CelestialFrame.center / CelestialFrame.axes read it back.
The argument-free orientations are class attributes (ICRF, EME2000, MOD, TOD, ITRF, LunarPA, LunarME, MarsFixed, EMR, SER, GSE); the parameterized ones are built with BodyFixedIAU(naif_id), BodyFixedPCK(frame_id), BodyFixedCustom(key) and Synodic(primary, secondary).
Rotating axes (ITRF, the body-fixed families, and the synodic families) carry transport-velocity terms that depend only on the axes' angular velocity, so they apply unchanged to a frame centered on a body other than the orientation's usual center.
LunarME class-attribute ¶
LunarME: Any = FrameAxes.LunarME
Orientation of a celestial frame, independent of its origin.
A CelestialFrame is the pair of one FrameCenter value and one FrameAxes value; CelestialFrame.Centered(center, axes) builds that pair and CelestialFrame.center / CelestialFrame.axes read it back.
The argument-free orientations are class attributes (ICRF, EME2000, MOD, TOD, ITRF, LunarPA, LunarME, MarsFixed, EMR, SER, GSE); the parameterized ones are built with BodyFixedIAU(naif_id), BodyFixedPCK(frame_id), BodyFixedCustom(key) and Synodic(primary, secondary).
Rotating axes (ITRF, the body-fixed families, and the synodic families) carry transport-velocity terms that depend only on the axes' angular velocity, so they apply unchanged to a frame centered on a body other than the orientation's usual center.
LunarPA class-attribute ¶
LunarPA: Any = FrameAxes.LunarPA
Orientation of a celestial frame, independent of its origin.
A CelestialFrame is the pair of one FrameCenter value and one FrameAxes value; CelestialFrame.Centered(center, axes) builds that pair and CelestialFrame.center / CelestialFrame.axes read it back.
The argument-free orientations are class attributes (ICRF, EME2000, MOD, TOD, ITRF, LunarPA, LunarME, MarsFixed, EMR, SER, GSE); the parameterized ones are built with BodyFixedIAU(naif_id), BodyFixedPCK(frame_id), BodyFixedCustom(key) and Synodic(primary, secondary).
Rotating axes (ITRF, the body-fixed families, and the synodic families) carry transport-velocity terms that depend only on the axes' angular velocity, so they apply unchanged to a frame centered on a body other than the orientation's usual center.
MOD class-attribute ¶
MOD: Any = FrameAxes.MOD
Orientation of a celestial frame, independent of its origin.
A CelestialFrame is the pair of one FrameCenter value and one FrameAxes value; CelestialFrame.Centered(center, axes) builds that pair and CelestialFrame.center / CelestialFrame.axes read it back.
The argument-free orientations are class attributes (ICRF, EME2000, MOD, TOD, ITRF, LunarPA, LunarME, MarsFixed, EMR, SER, GSE); the parameterized ones are built with BodyFixedIAU(naif_id), BodyFixedPCK(frame_id), BodyFixedCustom(key) and Synodic(primary, secondary).
Rotating axes (ITRF, the body-fixed families, and the synodic families) carry transport-velocity terms that depend only on the axes' angular velocity, so they apply unchanged to a frame centered on a body other than the orientation's usual center.
MarsFixed class-attribute ¶
MarsFixed: Any = FrameAxes.MarsFixed
Orientation of a celestial frame, independent of its origin.
A CelestialFrame is the pair of one FrameCenter value and one FrameAxes value; CelestialFrame.Centered(center, axes) builds that pair and CelestialFrame.center / CelestialFrame.axes read it back.
The argument-free orientations are class attributes (ICRF, EME2000, MOD, TOD, ITRF, LunarPA, LunarME, MarsFixed, EMR, SER, GSE); the parameterized ones are built with BodyFixedIAU(naif_id), BodyFixedPCK(frame_id), BodyFixedCustom(key) and Synodic(primary, secondary).
Rotating axes (ITRF, the body-fixed families, and the synodic families) carry transport-velocity terms that depend only on the axes' angular velocity, so they apply unchanged to a frame centered on a body other than the orientation's usual center.
SER class-attribute ¶
SER: Any = FrameAxes.SER
Orientation of a celestial frame, independent of its origin.
A CelestialFrame is the pair of one FrameCenter value and one FrameAxes value; CelestialFrame.Centered(center, axes) builds that pair and CelestialFrame.center / CelestialFrame.axes read it back.
The argument-free orientations are class attributes (ICRF, EME2000, MOD, TOD, ITRF, LunarPA, LunarME, MarsFixed, EMR, SER, GSE); the parameterized ones are built with BodyFixedIAU(naif_id), BodyFixedPCK(frame_id), BodyFixedCustom(key) and Synodic(primary, secondary).
Rotating axes (ITRF, the body-fixed families, and the synodic families) carry transport-velocity terms that depend only on the axes' angular velocity, so they apply unchanged to a frame centered on a body other than the orientation's usual center.
TOD class-attribute ¶
TOD: Any = FrameAxes.TOD
Orientation of a celestial frame, independent of its origin.
A CelestialFrame is the pair of one FrameCenter value and one FrameAxes value; CelestialFrame.Centered(center, axes) builds that pair and CelestialFrame.center / CelestialFrame.axes read it back.
The argument-free orientations are class attributes (ICRF, EME2000, MOD, TOD, ITRF, LunarPA, LunarME, MarsFixed, EMR, SER, GSE); the parameterized ones are built with BodyFixedIAU(naif_id), BodyFixedPCK(frame_id), BodyFixedCustom(key) and Synodic(primary, secondary).
Rotating axes (ITRF, the body-fixed families, and the synodic families) carry transport-velocity terms that depend only on the axes' angular velocity, so they apply unchanged to a frame centered on a body other than the orientation's usual center.
BodyFixedCustom staticmethod ¶
Body-fixed axes from a user-registered rotation callback (see register_custom_frame), keyed by its registry key.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key | int | Registry key the frame's callbacks were registered under | required |
Returns:
| Name | Type | Description |
|---|---|---|
FrameAxes | FrameAxes | Custom body-fixed axes for |
BodyFixedIAU staticmethod ¶
BodyFixedPCK staticmethod ¶
Synodic staticmethod ¶
Generic two-body synodic (rotating) axes: x̂ from primary toward secondary, ẑ along the secondary's orbital angular momentum relative to the primary.
EMR, SER and GSE name the same orientations as the pairs Synodic(399, 301), Synodic(10, 399) and Synodic(399, 10).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
primary | int | NAIF ID of the primary body | required |
secondary | int | NAIF ID of the secondary body | required |
Returns:
| Name | Type | Description |
|---|---|---|
FrameAxes | FrameAxes | Synodic axes for the pair |
from_string staticmethod ¶
Parses FrameAxes from its string representation (the eleven argument-free names, case-insensitively).
The parameterized variants are not parseable from a string; construct them with BodyFixedIAU, BodyFixedPCK, BodyFixedCustom or Synodic.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
s | str | String representation of the axes | required |
Returns:
| Name | Type | Description |
|---|---|---|
FrameAxes | FrameAxes | Parsed axes |
Raises:
| Type | Description |
|---|---|
ValueError | If |
Router Functions¶
rotation_frame_to_frame builtin ¶
rotation_frame_to_frame(from_frame: CelestialFrame | ReferenceFrame, to_frame: CelestialFrame | ReferenceFrame, epc: Union[Epoch, Sequence[Epoch]]) -> ndarray
Computes the rotation matrix transforming from_frame axes into to_frame axes at epc.
Purely an orientation query: does not depend on, and does not query, either frame's center. This does not mean SPK is never touched: EMR, SER, and GSE orientations are themselves derived from SPK state/acceleration (auto-loading de440s), so a query involving one of those frames still queries SPK.
from_frame/to_frame accept a CelestialFrame or a ReferenceFrame: a registered body/sensor frame, or a bound orbit-relative frame (e.g. ReferenceFrame.RTN("SC")), resolved by walking the frame registry.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
from_frame | CelestialFrame | ReferenceFrame | Source reference frame | required |
to_frame | CelestialFrame | ReferenceFrame | Target reference frame | required |
epc | Epoch or Sequence[Epoch] | Epoch instant for computation of the transformation. A sequence evaluates one matrix per epoch. | required |
Returns:
| Type | Description |
|---|---|
ndarray | numpy.ndarray: 3x3 rotation matrix transforming |
Raises:
| Type | Description |
|---|---|
RuntimeError | If either frame's orientation cannot be evaluated at |
position_frame_to_frame builtin ¶
position_frame_to_frame(from_frame: CelestialFrame | ReferenceFrame, to_frame: CelestialFrame | ReferenceFrame, epc: Union[Epoch, Sequence[Epoch]], x: Union[ndarray, Sequence], axis: int = -1) -> ndarray
Transforms a Cartesian position from from_frame to to_frame at epc.
Same hub-and-spoke design as state_frame_to_frame, without the velocity transport terms. Same-center conversions skip the translation lookup, but EMR/SER/GSE orientation still queries SPK ephemerides (auto-loading de440s), so a same-center conversion involving one of those frames is not SPK-free.
from_frame/to_frame accept a CelestialFrame or a ReferenceFrame: a registered body/sensor frame, or a bound orbit-relative frame (e.g. ReferenceFrame.RTN("SC")), resolved by walking the frame registry. A non-celestial frame's origin is the origin of the object it is bound to.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
from_frame | CelestialFrame | ReferenceFrame | Source reference frame | required |
to_frame | CelestialFrame | ReferenceFrame | Target reference frame | required |
epc | Epoch or Sequence[Epoch] | Epoch instant for computation of the transformation. A sequence evaluates one epoch per vector (or broadcasts a single vector across all epochs). | required |
x | ndarray or list | Cartesian position in | required |
axis | int | The axis of | -1 |
Returns:
| Type | Description |
|---|---|
ndarray | numpy.ndarray: Cartesian position in |
Raises:
| Type | Description |
|---|---|
RuntimeError | If either frame's orientation cannot be evaluated at |
state_frame_to_frame builtin ¶
state_frame_to_frame(from_frame: CelestialFrame | ReferenceFrame, to_frame: CelestialFrame | ReferenceFrame, epc: Union[Epoch, Sequence[Epoch]], x: Union[ndarray, Sequence], axis: int = -1) -> ndarray
Transforms a Cartesian state (position and velocity) from from_frame to to_frame at epc.
Uses a hub-and-spoke design: the state is first rotated from from_frame axes into ICRF axes (an exact orientation + velocity-transport transform, still centered on from_frame's origin), then re-centered onto to_frame's origin if the two frames have different centers, then rotated into to_frame axes. Same-center conversions (e.g. GCRF <-> ITRF) skip the re-centering step, so that step never touches SPK; EMR/SER/GSE orientation still queries SPK ephemerides (auto-loading de440s) even for a same-center conversion like GCRF <-> GSE.
from_frame/to_frame accept a CelestialFrame or a ReferenceFrame: a registered body/sensor frame, or a bound orbit-relative frame (e.g. ReferenceFrame.RTN("SC")), resolved by walking the frame registry. Every link in a non-celestial frame's orientation chain must supply an angular velocity, since the velocity transport term is otherwise undefined.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
from_frame | CelestialFrame | ReferenceFrame | Source reference frame | required |
to_frame | CelestialFrame | ReferenceFrame | Target reference frame | required |
epc | Epoch or Sequence[Epoch] | Epoch instant for computation of the transformation. A sequence evaluates one epoch per vector (or broadcasts a single vector across all epochs). | required |
x | ndarray or list | Cartesian state in | required |
axis | int | The axis of | -1 |
Returns:
| Type | Description |
|---|---|
ndarray | numpy.ndarray: Cartesian state in |
Raises:
| Type | Description |
|---|---|
RuntimeError | If either frame's orientation cannot be evaluated at |
Generic IAU/WGCCRE Body-Fixed Rotations¶
rotation_icrf_to_body_fixed_iau builtin ¶
Computes the rotation matrix from the ICRF to the IAU/WGCCRE body-fixed frame of naif_id at epc.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
naif_id | int | NAIF ID of the body (see | required |
epc | Epoch or Sequence[Epoch] | Epoch instant for computation of the transformation matrix. A sequence evaluates one matrix per epoch. | required |
Returns:
| Type | Description |
|---|---|
ndarray | numpy.ndarray: 3x3 rotation matrix transforming ICRF -> body-fixed, shape |
Raises:
| Type | Description |
|---|---|
RuntimeError | If no IAU/WGCCRE rotation model is embedded for |
iau_rotation_model_ids builtin ¶
See Also¶
- Reference Frame Router (Learn) - Conceptual explanation and kernel requirements
- Lunar Frames - Moon-centered frame transformations
- Mars Frames - Mars-centered frame transformations
- CentralBody / ForceModelConfig - Multibody propagation configuration
- Reference Frames Module - Complete API reference for frames module