Reference Frame Router¶
ReferenceFrame 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.
ReferenceFrame¶
ReferenceFrame ¶
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 = ReferenceFrame.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 = ReferenceFrame.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 = ReferenceFrame.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 = ReferenceFrame.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 = ReferenceFrame.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 = ReferenceFrame.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 = ReferenceFrame.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 = ReferenceFrame.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 = ReferenceFrame.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 = ReferenceFrame.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 = ReferenceFrame.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 = ReferenceFrame.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 = ReferenceFrame.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.
SER class-attribute ¶
SER: Any = ReferenceFrame.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 = ReferenceFrame.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.
BodyCenteredICRF staticmethod ¶
BodyCenteredICRF(naif_id: int) -> ReferenceFrame
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 |
|---|---|---|
ReferenceFrame | ReferenceFrame | ICRF-aligned frame centered on |
BodyFixedCustom staticmethod ¶
BodyFixedCustom(center: int, key: int) -> ReferenceFrame
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.
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 |
|---|---|---|
ReferenceFrame | ReferenceFrame | Custom body-fixed frame for |
BodyFixedIAU staticmethod ¶
BodyFixedIAU(naif_id: int) -> ReferenceFrame
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 |
|---|---|---|
ReferenceFrame | ReferenceFrame | IAU/WGCCRE body-fixed frame of |
BodyFixedPCK staticmethod ¶
BodyFixedPCK(center: int, frame_id: int) -> ReferenceFrame
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 |
|---|---|---|
ReferenceFrame | ReferenceFrame | Body-fixed frame for |
from_string staticmethod ¶
from_string(s: str) -> ReferenceFrame
Parses a ReferenceFrame 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 |
|---|---|---|
ReferenceFrame | ReferenceFrame | Parsed reference frame |
Raises:
| Type | Description |
|---|---|
ValueError | If |
Router Functions¶
rotation_frame_to_frame builtin ¶
rotation_frame_to_frame(from_frame: ReferenceFrame, to_frame: ReferenceFrame, epc: 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.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
from_frame | ReferenceFrame | Source reference frame | required |
to_frame | ReferenceFrame | Target reference frame | required |
epc | Epoch | Epoch instant for computation of the transformation | 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: ReferenceFrame, to_frame: ReferenceFrame, epc: Epoch, x: Union[ndarray, List]) -> 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.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
from_frame | ReferenceFrame | Source reference frame | required |
to_frame | ReferenceFrame | Target reference frame | required |
epc | Epoch | Epoch instant for computation of the transformation | required |
x | ndarray or list | Cartesian position in | required |
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: ReferenceFrame, to_frame: ReferenceFrame, epc: Epoch, x: Union[ndarray, List]) -> 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.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
from_frame | ReferenceFrame | Source reference frame | required |
to_frame | ReferenceFrame | Target reference frame | required |
epc | Epoch | Epoch instant for computation of the transformation | required |
x | ndarray or list | Cartesian state in | required |
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 | Epoch instant for computation of the transformation matrix | required |
Returns:
| Type | Description |
|---|---|
ndarray | numpy.ndarray: 3x3 rotation matrix transforming ICRF -> body-fixed |
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