Skip to content

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

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
1
2
3
4
import brahe as bh

epc = bh.Epoch.from_datetime(2024, 3, 1, 0, 0, 0.0, 0.0, bh.UTC)
r = bh.rotation_frame_to_frame(bh.CelestialFrame.MCI, bh.CelestialFrame.MCMF, epc)

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.

Example
1
2
3
4
import brahe as bh

epc = bh.Epoch.from_datetime(2024, 3, 1, 0, 0, 0.0, 0.0, bh.UTC)
r = bh.rotation_frame_to_frame(bh.CelestialFrame.MCI, bh.CelestialFrame.MCMF, epc)

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.

Example
1
2
3
4
import brahe as bh

epc = bh.Epoch.from_datetime(2024, 3, 1, 0, 0, 0.0, 0.0, bh.UTC)
r = bh.rotation_frame_to_frame(bh.CelestialFrame.MCI, bh.CelestialFrame.MCMF, epc)

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.

Example
1
2
3
4
import brahe as bh

epc = bh.Epoch.from_datetime(2024, 3, 1, 0, 0, 0.0, 0.0, bh.UTC)
r = bh.rotation_frame_to_frame(bh.CelestialFrame.MCI, bh.CelestialFrame.MCMF, epc)

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.

Example
1
2
3
4
import brahe as bh

epc = bh.Epoch.from_datetime(2024, 3, 1, 0, 0, 0.0, 0.0, bh.UTC)
r = bh.rotation_frame_to_frame(bh.CelestialFrame.MCI, bh.CelestialFrame.MCMF, epc)

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.

Example
1
2
3
4
import brahe as bh

epc = bh.Epoch.from_datetime(2024, 3, 1, 0, 0, 0.0, 0.0, bh.UTC)
r = bh.rotation_frame_to_frame(bh.CelestialFrame.MCI, bh.CelestialFrame.MCMF, epc)

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.

Example
1
2
3
4
import brahe as bh

epc = bh.Epoch.from_datetime(2024, 3, 1, 0, 0, 0.0, 0.0, bh.UTC)
r = bh.rotation_frame_to_frame(bh.CelestialFrame.MCI, bh.CelestialFrame.MCMF, epc)

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.

Example
1
2
3
4
import brahe as bh

epc = bh.Epoch.from_datetime(2024, 3, 1, 0, 0, 0.0, 0.0, bh.UTC)
r = bh.rotation_frame_to_frame(bh.CelestialFrame.MCI, bh.CelestialFrame.MCMF, epc)

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.

Example
1
2
3
4
import brahe as bh

epc = bh.Epoch.from_datetime(2024, 3, 1, 0, 0, 0.0, 0.0, bh.UTC)
r = bh.rotation_frame_to_frame(bh.CelestialFrame.MCI, bh.CelestialFrame.MCMF, epc)

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.

Example
1
2
3
4
import brahe as bh

epc = bh.Epoch.from_datetime(2024, 3, 1, 0, 0, 0.0, 0.0, bh.UTC)
r = bh.rotation_frame_to_frame(bh.CelestialFrame.MCI, bh.CelestialFrame.MCMF, epc)

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.

Example
1
2
3
4
import brahe as bh

epc = bh.Epoch.from_datetime(2024, 3, 1, 0, 0, 0.0, 0.0, bh.UTC)
r = bh.rotation_frame_to_frame(bh.CelestialFrame.MCI, bh.CelestialFrame.MCMF, epc)

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.

Example
1
2
3
4
import brahe as bh

epc = bh.Epoch.from_datetime(2024, 3, 1, 0, 0, 0.0, 0.0, bh.UTC)
r = bh.rotation_frame_to_frame(bh.CelestialFrame.MCI, bh.CelestialFrame.MCMF, epc)

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.

Example
1
2
3
4
import brahe as bh

epc = bh.Epoch.from_datetime(2024, 3, 1, 0, 0, 0.0, 0.0, bh.UTC)
r = bh.rotation_frame_to_frame(bh.CelestialFrame.MCI, bh.CelestialFrame.MCMF, epc)

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.

Example
1
2
3
4
import brahe as bh

epc = bh.Epoch.from_datetime(2024, 3, 1, 0, 0, 0.0, 0.0, bh.UTC)
r = bh.rotation_frame_to_frame(bh.CelestialFrame.MCI, bh.CelestialFrame.MCMF, epc)

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.

Example
1
2
3
4
import brahe as bh

epc = bh.Epoch.from_datetime(2024, 3, 1, 0, 0, 0.0, 0.0, bh.UTC)
r = bh.rotation_frame_to_frame(bh.CelestialFrame.MCI, bh.CelestialFrame.MCMF, epc)

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.

Example
1
2
3
4
import brahe as bh

epc = bh.Epoch.from_datetime(2024, 3, 1, 0, 0, 0.0, 0.0, bh.UTC)
r = bh.rotation_frame_to_frame(bh.CelestialFrame.MCI, bh.CelestialFrame.MCMF, epc)

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.

Example
1
2
3
4
import brahe as bh

epc = bh.Epoch.from_datetime(2024, 3, 1, 0, 0, 0.0, 0.0, bh.UTC)
r = bh.rotation_frame_to_frame(bh.CelestialFrame.MCI, bh.CelestialFrame.MCMF, epc)

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.

Example
1
2
3
4
import brahe as bh

epc = bh.Epoch.from_datetime(2024, 3, 1, 0, 0, 0.0, 0.0, bh.UTC)
r = bh.rotation_frame_to_frame(bh.CelestialFrame.MCI, bh.CelestialFrame.MCMF, epc)

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 None for non-synodic frames

synodic_primary property

synodic_primary: Optional[int]

NAIF ID of the synodic primary (Synodic, EMR, SER, GSE, and a centered frame with synodic axes).

Returns:

Type Description
Optional[int]

Optional[int]: NAIF ID of the primary body, or None for non-synodic frames

synodic_secondary property

synodic_secondary: Optional[int]

NAIF ID of the synodic secondary (Synodic, EMR, SER, GSE, and a centered frame with synodic axes).

Returns:

Type Description
Optional[int]

Optional[int]: NAIF ID of the secondary body, or None for non-synodic frames

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 naif_id

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 key, centered on center

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 iau_rotation_model_ids for the supported set)

required

Returns:

Name Type Description
CelestialFrame CelestialFrame

IAU/WGCCRE body-fixed frame of naif_id

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 MOON_PA_DE440)

required

Returns:

Name Type Description
CelestialFrame CelestialFrame

Body-fixed frame for frame_id, centered on center

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 center is not a FrameCenter, a NAIFId, or an integer

Example
1
2
3
4
import brahe as bh

mars_eme2000 = bh.CelestialFrame.Centered(bh.NAIFId.MARS, bh.FrameAxes.EME2000)
assert mars_eme2000.center_naif_id == 499

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 s is not a recognized reference frame name

Example
1
2
3
import brahe as bh

assert bh.CelestialFrame.from_string("ECI") == bh.CelestialFrame.GCRF

FrameCenter

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
1
2
3
4
5
import brahe as bh

assert bh.CelestialFrame.MCI.center == bh.NAIFId.MARS
assert bh.CelestialFrame.MCI.center.name == "MARS"
assert bh.CelestialFrame.SER.center.name == "BARYCENTER(SUN, EARTH)"

Initialize instance.

body property

body: Any

The single body at this origin, when there is one.

Returns:

Type Description
Any

NAIFId | int | None: The NAIFId member for a catalogued body, the plain integer for any other ID, or None for a two-body barycenter

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(primary, secondary) for a two-body barycenter

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 s names no known body and is not a valid integer ID

Example
1
2
3
import brahe as bh

assert bh.FrameCenter.from_string("mars") == bh.NAIFId.MARS

FrameAxes

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
1
2
3
4
import brahe as bh

mars_eme2000 = bh.CelestialFrame.Centered(bh.NAIFId.MARS, bh.FrameAxes.EME2000)
assert mars_eme2000.axes == bh.FrameAxes.EME2000

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.

Example
1
2
3
4
import brahe as bh

mars_eme2000 = bh.CelestialFrame.Centered(bh.NAIFId.MARS, bh.FrameAxes.EME2000)
assert mars_eme2000.axes == bh.FrameAxes.EME2000

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.

Example
1
2
3
4
import brahe as bh

mars_eme2000 = bh.CelestialFrame.Centered(bh.NAIFId.MARS, bh.FrameAxes.EME2000)
assert mars_eme2000.axes == bh.FrameAxes.EME2000

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.

Example
1
2
3
4
import brahe as bh

mars_eme2000 = bh.CelestialFrame.Centered(bh.NAIFId.MARS, bh.FrameAxes.EME2000)
assert mars_eme2000.axes == bh.FrameAxes.EME2000

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.

Example
1
2
3
4
import brahe as bh

mars_eme2000 = bh.CelestialFrame.Centered(bh.NAIFId.MARS, bh.FrameAxes.EME2000)
assert mars_eme2000.axes == bh.FrameAxes.EME2000

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.

Example
1
2
3
4
import brahe as bh

mars_eme2000 = bh.CelestialFrame.Centered(bh.NAIFId.MARS, bh.FrameAxes.EME2000)
assert mars_eme2000.axes == bh.FrameAxes.EME2000

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.

Example
1
2
3
4
import brahe as bh

mars_eme2000 = bh.CelestialFrame.Centered(bh.NAIFId.MARS, bh.FrameAxes.EME2000)
assert mars_eme2000.axes == bh.FrameAxes.EME2000

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.

Example
1
2
3
4
import brahe as bh

mars_eme2000 = bh.CelestialFrame.Centered(bh.NAIFId.MARS, bh.FrameAxes.EME2000)
assert mars_eme2000.axes == bh.FrameAxes.EME2000

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.

Example
1
2
3
4
import brahe as bh

mars_eme2000 = bh.CelestialFrame.Centered(bh.NAIFId.MARS, bh.FrameAxes.EME2000)
assert mars_eme2000.axes == bh.FrameAxes.EME2000

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.

Example
1
2
3
4
import brahe as bh

mars_eme2000 = bh.CelestialFrame.Centered(bh.NAIFId.MARS, bh.FrameAxes.EME2000)
assert mars_eme2000.axes == bh.FrameAxes.EME2000

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.

Example
1
2
3
4
import brahe as bh

mars_eme2000 = bh.CelestialFrame.Centered(bh.NAIFId.MARS, bh.FrameAxes.EME2000)
assert mars_eme2000.axes == bh.FrameAxes.EME2000

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.

Example
1
2
3
4
import brahe as bh

mars_eme2000 = bh.CelestialFrame.Centered(bh.NAIFId.MARS, bh.FrameAxes.EME2000)
assert mars_eme2000.axes == bh.FrameAxes.EME2000

BodyFixedCustom staticmethod

BodyFixedCustom(key: int) -> FrameAxes

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 key

BodyFixedIAU staticmethod

BodyFixedIAU(naif_id: int) -> FrameAxes

IAU/WGCCRE body-fixed axes of the given NAIF ID.

Parameters:

Name Type Description Default
naif_id int

NAIF ID of the body (see iau_rotation_model_ids for the supported set)

required

Returns:

Name Type Description
FrameAxes FrameAxes

IAU/WGCCRE body-fixed axes of naif_id

BodyFixedPCK staticmethod

BodyFixedPCK(frame_id: int) -> FrameAxes

Body-fixed axes evaluated from a loaded binary PCK's frame class ID.

Parameters:

Name Type Description Default
frame_id int

NAIF binary PCK frame class ID (e.g. 31008 for MOON_PA_DE440)

required

Returns:

Name Type Description
FrameAxes FrameAxes

Body-fixed axes for frame_id

Synodic staticmethod

Synodic(primary: int, secondary: int) -> FrameAxes

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

from_string(s: str) -> FrameAxes

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 s is not a recognized axes name

Example
1
2
3
import brahe as bh

assert bh.FrameAxes.from_string("tod") == bh.FrameAxes.TOD

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 from_frame -> to_frame, shape (3, 3) for a single epoch or (n, 3, 3) for a sequence of n epochs.

Raises:

Type Description
RuntimeError

If either frame's orientation cannot be evaluated at epc

Example
1
2
3
4
import brahe as bh

epc = bh.Epoch.from_datetime(2024, 3, 1, 0, 0, 0.0, 0.0, bh.UTC)
r = bh.rotation_frame_to_frame(bh.CelestialFrame.MCI, bh.CelestialFrame.MCMF, epc)

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 from_frame axes/center (m), shape (3,), or a batch of vectors with the 3 components along axis (for example shape (n, 3)).

required
axis int

The axis of x along which the 3 components of a single vector lie; the remaining axes enumerate the batch. For a batch of shape (n, 3) the components lie along the last axis, so the default -1 applies; a (3, n) column layout uses axis=0.

-1

Returns:

Type Description
ndarray

numpy.ndarray: Cartesian position in to_frame axes/center (m), shape (3,) for a single input, or the batch layout of x (shape (n, 3) for a single vector with a sequence of n epochs).

Raises:

Type Description
RuntimeError

If either frame's orientation cannot be evaluated at epc, or if the two frames have different centers and no ephemeris path exists between them

Example
1
2
3
4
5
6
7
import brahe as bh

bh.initialize_eop()

epc = bh.Epoch.from_datetime(2024, 3, 1, 0, 0, 0.0, 0.0, bh.UTC)
x_gcrf = [bh.R_EARTH + 500e3, 0.0, 0.0]
x_itrf = bh.position_frame_to_frame(bh.CelestialFrame.GCRF, bh.CelestialFrame.ITRF, epc, x_gcrf)

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 from_frame axes/center [position (m), velocity (m/s)], shape (6,), or a batch of vectors with the 6 components along axis (for example shape (n, 6)).

required
axis int

The axis of x along which the 6 components of a single vector lie; the remaining axes enumerate the batch. For a batch of shape (n, 6) the components lie along the last axis, so the default -1 applies; a (6, n) column layout uses axis=0.

-1

Returns:

Type Description
ndarray

numpy.ndarray: Cartesian state in to_frame axes/center [position (m), velocity (m/s)], shape (6,) for a single input, or the batch layout of x (shape (n, 6) for a single vector with a sequence of n epochs).

Raises:

Type Description
RuntimeError

If either frame's orientation cannot be evaluated at epc, or if the two frames have different centers and no ephemeris path exists between them

Example
1
2
3
4
5
import brahe as bh

epc = bh.Epoch.from_datetime(2024, 3, 1, 0, 0, 0.0, 0.0, bh.UTC)
x_gcrf = [1e8, -2e8, 5e7, 1.0e3, -2.0e3, 0.5e3]
x_lfpa = bh.state_frame_to_frame(bh.CelestialFrame.GCRF, bh.CelestialFrame.LFPA, epc, x_gcrf)

Generic IAU/WGCCRE Body-Fixed Rotations

rotation_icrf_to_body_fixed_iau builtin

rotation_icrf_to_body_fixed_iau(naif_id: int, epc: Union[Epoch, Sequence[Epoch]]) -> ndarray

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 iau_rotation_model_ids for the supported set)

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 (3, 3) for a single epoch or (n, 3, 3) for a sequence of n epochs.

Raises:

Type Description
RuntimeError

If no IAU/WGCCRE rotation model is embedded for naif_id

Example
1
2
3
4
import brahe as bh

epc = bh.Epoch.from_datetime(2024, 3, 1, 0, 0, 0.0, 0.0, bh.UTC)
r = bh.rotation_icrf_to_body_fixed_iau(499, epc)  # Mars

iau_rotation_model_ids builtin

iau_rotation_model_ids() -> list[int]

Sorted list of NAIF IDs with an embedded IAU/WGCCRE rotation model.

Returns:

Type Description
list[int]

list[int]: Sorted NAIF IDs supported by rotation_icrf_to_body_fixed_iau

Example
1
2
3
4
import brahe as bh

ids = bh.iau_rotation_model_ids()
assert 499 in ids  # Mars

See Also