Skip to content

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

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
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.ReferenceFrame.MCI, bh.ReferenceFrame.MCMF, epc)

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.

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.ReferenceFrame.MCI, bh.ReferenceFrame.MCMF, epc)

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.

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.ReferenceFrame.MCI, bh.ReferenceFrame.MCMF, epc)

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.

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.ReferenceFrame.MCI, bh.ReferenceFrame.MCMF, epc)

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.

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.ReferenceFrame.MCI, bh.ReferenceFrame.MCMF, epc)

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.

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.ReferenceFrame.MCI, bh.ReferenceFrame.MCMF, epc)

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.

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.ReferenceFrame.MCI, bh.ReferenceFrame.MCMF, epc)

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.

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.ReferenceFrame.MCI, bh.ReferenceFrame.MCMF, epc)

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.

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.ReferenceFrame.MCI, bh.ReferenceFrame.MCMF, epc)

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.

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.ReferenceFrame.MCI, bh.ReferenceFrame.MCMF, epc)

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.

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.ReferenceFrame.MCI, bh.ReferenceFrame.MCMF, epc)

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.

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.ReferenceFrame.MCI, bh.ReferenceFrame.MCMF, epc)

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.

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.ReferenceFrame.MCI, bh.ReferenceFrame.MCMF, epc)

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.

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.ReferenceFrame.MCI, bh.ReferenceFrame.MCMF, epc)

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.

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.ReferenceFrame.MCI, bh.ReferenceFrame.MCMF, epc)

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.

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.ReferenceFrame.MCI, bh.ReferenceFrame.MCMF, epc)

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 naif_id

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

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

required

Returns:

Name Type Description
ReferenceFrame ReferenceFrame

IAU/WGCCRE body-fixed frame of naif_id

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

required

Returns:

Name Type Description
ReferenceFrame ReferenceFrame

Body-fixed frame for frame_id, centered on center

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

Example
1
2
3
import brahe as bh

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

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 from_frame -> to_frame

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.ReferenceFrame.MCI, bh.ReferenceFrame.MCMF, epc)

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 from_frame axes/center (m), shape (3,)

required

Returns:

Type Description
ndarray

numpy.ndarray: Cartesian position in to_frame axes/center (m), shape (3,)

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 = [bh.R_EARTH + 500e3, 0.0, 0.0]
x_itrf = bh.position_frame_to_frame(bh.ReferenceFrame.GCRF, bh.ReferenceFrame.ITRF, epc, x_gcrf)

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 from_frame axes/center [position (m), velocity (m/s)], shape (6,)

required

Returns:

Type Description
ndarray

numpy.ndarray: Cartesian state in to_frame axes/center [position (m), velocity (m/s)], shape (6,)

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.ReferenceFrame.GCRF, bh.ReferenceFrame.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: 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

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