Skip to content

Lunar Frames

Transformations between Lunar-Centered Inertial (LCI), Lunar-Fixed Principal Axis (LFPA), Lunar-Fixed Mean-Earth/polar-axis (LFME), and Earth-Centered Inertial (ECI).

Note

For conceptual explanations and examples, see Lunar Reference Frames in the Learn section.

LCI ↔ LFPA

rotation_lci_to_lfpa builtin

rotation_lci_to_lfpa(epc: Union[Epoch, Sequence[Epoch]]) -> ndarray

Computes the rotation matrix from Lunar-Centered Inertial (LCI) to Lunar-Fixed Principal Axis (LFPA), using the DE440 lunar principal-axis binary PCK (moon_pa_de440).

Auto-loads the moon_pa_de440 PCK (downloading it to ~/.cache/brahe/naif if needed).

Parameters:

Name Type Description Default
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 LCI -> LFPA, shape (3, 3) for a single epoch or (n, 3, 3) for a sequence of n epochs.

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_lci_to_lfpa(epc)

rotation_lfpa_to_lci builtin

rotation_lfpa_to_lci(epc: Union[Epoch, Sequence[Epoch]]) -> ndarray

Computes the rotation matrix from Lunar-Fixed Principal Axis (LFPA) to Lunar-Centered Inertial (LCI). Inverse of rotation_lci_to_lfpa.

Parameters:

Name Type Description Default
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 LFPA -> LCI, shape (3, 3) for a single epoch or (n, 3, 3) for a sequence of n epochs.

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_lfpa_to_lci(epc)

position_lci_to_lfpa builtin

position_lci_to_lfpa(epc: Union[Epoch, Sequence[Epoch]], x_lci: Union[ndarray, Sequence], axis: int = -1) -> ndarray

Transforms a Cartesian Lunar-inertial (LCI) position into the equivalent Cartesian Lunar-Fixed Principal Axis (LFPA) position.

Parameters:

Name Type Description Default
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_lci ndarray or list

Cartesian LCI position (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_lci 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 LFPA position (m), shape (3,) for a single input, or the batch layout of x_lci (shape (n, 3) for a single vector with a sequence of n epochs).

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)
x_lfpa = bh.position_lci_to_lfpa(epc, [bh.R_MOON + 100e3, 0.0, 0.0])

position_lfpa_to_lci builtin

position_lfpa_to_lci(epc: Union[Epoch, Sequence[Epoch]], x_lfpa: Union[ndarray, Sequence], axis: int = -1) -> ndarray

Transforms a Cartesian Lunar-Fixed Principal Axis (LFPA) position into the equivalent Cartesian Lunar-inertial (LCI) position.

Parameters:

Name Type Description Default
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_lfpa ndarray or list

Cartesian LFPA position (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_lfpa 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 LCI position (m), shape (3,) for a single input, or the batch layout of x_lfpa (shape (n, 3) for a single vector with a sequence of n epochs).

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)
x_lci = bh.position_lfpa_to_lci(epc, [bh.R_MOON, 0.0, 0.0])

state_lci_to_lfpa builtin

state_lci_to_lfpa(epc: Union[Epoch, Sequence[Epoch]], x_lci: Union[ndarray, Sequence], axis: int = -1) -> ndarray

Transforms a Cartesian Lunar-inertial (LCI) state (position and velocity) into the equivalent Cartesian Lunar-Fixed Principal Axis (LFPA) state.

The velocity transformation accounts for the transport term induced by the Moon's rotation.

Parameters:

Name Type Description Default
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_lci ndarray or list

Cartesian LCI state [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_lci 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 LFPA state [position (m), velocity (m/s)], shape (6,) for a single input, or the batch layout of x_lci (shape (n, 6) for a single vector with a sequence of n epochs).

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_lci = [bh.R_MOON + 100e3, 0.0, 0.0, 0.0, 1.6e3, 0.0]
x_lfpa = bh.state_lci_to_lfpa(epc, x_lci)

state_lfpa_to_lci builtin

state_lfpa_to_lci(epc: Union[Epoch, Sequence[Epoch]], x_lfpa: Union[ndarray, Sequence], axis: int = -1) -> ndarray

Transforms a Cartesian Lunar-Fixed Principal Axis (LFPA) state (position and velocity) into the equivalent Cartesian Lunar-inertial (LCI) state. Inverse of state_lci_to_lfpa.

Parameters:

Name Type Description Default
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_lfpa ndarray or list

Cartesian LFPA state [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_lfpa 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 LCI state [position (m), velocity (m/s)], shape (6,) for a single input, or the batch layout of x_lfpa (shape (n, 6) for a single vector with a sequence of n epochs).

Example
1
2
3
4
5
6
import brahe as bh

epc = bh.Epoch.from_datetime(2024, 3, 1, 0, 0, 0.0, 0.0, bh.UTC)
x_lci = [bh.R_MOON + 100e3, 0.0, 0.0, 0.0, 1.6e3, 0.0]
x_lfpa = bh.state_lci_to_lfpa(epc, x_lci)
x_lci2 = bh.state_lfpa_to_lci(epc, x_lfpa)

LCI ↔ LFME

rotation_lci_to_lfme builtin

rotation_lci_to_lfme(epc: Union[Epoch, Sequence[Epoch]]) -> ndarray

Computes the rotation matrix from Lunar-Centered Inertial (LCI) to Lunar-Fixed Mean Earth/polar-axis (LFME).

Auto-loads the moon_pa_de440 PCK (downloading it to ~/.cache/brahe/naif if needed).

Parameters:

Name Type Description Default
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 LCI -> LFME, shape (3, 3) for a single epoch or (n, 3, 3) for a sequence of n epochs.

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_lci_to_lfme(epc)

rotation_lfme_to_lci builtin

rotation_lfme_to_lci(epc: Union[Epoch, Sequence[Epoch]]) -> ndarray

Computes the rotation matrix from Lunar-Fixed Mean Earth/polar-axis (LFME) to Lunar-Centered Inertial (LCI). Inverse of rotation_lci_to_lfme.

Parameters:

Name Type Description Default
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 LFME -> LCI, shape (3, 3) for a single epoch or (n, 3, 3) for a sequence of n epochs.

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_lfme_to_lci(epc)

position_lci_to_lfme builtin

position_lci_to_lfme(epc: Union[Epoch, Sequence[Epoch]], x_lci: Union[ndarray, Sequence], axis: int = -1) -> ndarray

Transforms a Cartesian Lunar-inertial (LCI) position into the equivalent Cartesian Lunar-Fixed Mean Earth/polar-axis (LFME) position.

Parameters:

Name Type Description Default
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_lci ndarray or list

Cartesian LCI position (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_lci 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 LFME position (m), shape (3,) for a single input, or the batch layout of x_lci (shape (n, 3) for a single vector with a sequence of n epochs).

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)
x_lfme = bh.position_lci_to_lfme(epc, [bh.R_MOON + 100e3, 0.0, 0.0])

position_lfme_to_lci builtin

position_lfme_to_lci(epc: Union[Epoch, Sequence[Epoch]], x_lfme: Union[ndarray, Sequence], axis: int = -1) -> ndarray

Transforms a Cartesian Lunar-Fixed Mean Earth/polar-axis (LFME) position into the equivalent Cartesian Lunar-inertial (LCI) position.

Parameters:

Name Type Description Default
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_lfme ndarray or list

Cartesian LFME position (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_lfme 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 LCI position (m), shape (3,) for a single input, or the batch layout of x_lfme (shape (n, 3) for a single vector with a sequence of n epochs).

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)
x_lci = bh.position_lfme_to_lci(epc, [bh.R_MOON, 0.0, 0.0])

state_lci_to_lfme builtin

state_lci_to_lfme(epc: Union[Epoch, Sequence[Epoch]], x_lci: Union[ndarray, Sequence], axis: int = -1) -> ndarray

Transforms a Cartesian Lunar-inertial (LCI) state (position and velocity) into the equivalent Cartesian Lunar-Fixed Mean Earth/polar-axis (LFME) state.

Parameters:

Name Type Description Default
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_lci ndarray or list

Cartesian LCI state [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_lci 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 LFME state [position (m), velocity (m/s)], shape (6,) for a single input, or the batch layout of x_lci (shape (n, 6) for a single vector with a sequence of n epochs).

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_lci = [bh.R_MOON + 100e3, 0.0, 0.0, 0.0, 1.6e3, 0.0]
x_lfme = bh.state_lci_to_lfme(epc, x_lci)

state_lfme_to_lci builtin

state_lfme_to_lci(epc: Union[Epoch, Sequence[Epoch]], x_lfme: Union[ndarray, Sequence], axis: int = -1) -> ndarray

Transforms a Cartesian Lunar-Fixed Mean Earth/polar-axis (LFME) state (position and velocity) into the equivalent Cartesian Lunar-inertial (LCI) state. Inverse of state_lci_to_lfme.

Parameters:

Name Type Description Default
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_lfme ndarray or list

Cartesian LFME state [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_lfme 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 LCI state [position (m), velocity (m/s)], shape (6,) for a single input, or the batch layout of x_lfme (shape (n, 6) for a single vector with a sequence of n epochs).

Example
1
2
3
4
5
6
import brahe as bh

epc = bh.Epoch.from_datetime(2024, 3, 1, 0, 0, 0.0, 0.0, bh.UTC)
x_lci = [bh.R_MOON + 100e3, 0.0, 0.0, 0.0, 1.6e3, 0.0]
x_lfme = bh.state_lci_to_lfme(epc, x_lci)
x_lci2 = bh.state_lfme_to_lci(epc, x_lfme)

LFPA ↔ LFME (Constant Rotation)

rotation_lfpa_to_lfme builtin

rotation_lfpa_to_lfme() -> ndarray

Computes the constant rotation matrix from Lunar-Fixed Principal Axis (LFPA) to Lunar-Fixed Mean Earth/polar-axis (LFME). Inverse of rotation_lfme_to_lfpa.

Returns:

Type Description
ndarray

numpy.ndarray: 3x3 rotation matrix transforming LFPA -> LFME

Example
1
2
3
import brahe as bh

r = bh.rotation_lfpa_to_lfme()

rotation_lfme_to_lfpa builtin

rotation_lfme_to_lfpa() -> ndarray

Computes the constant rotation matrix from Lunar-Fixed Mean Earth/polar-axis (LFME) to Lunar-Fixed Principal Axis (LFPA).

Returns:

Type Description
ndarray

numpy.ndarray: 3x3 rotation matrix transforming LFME -> LFPA

Example
1
2
3
import brahe as bh

r = bh.rotation_lfme_to_lfpa()

ECI ↔ LCI

position_eci_to_lci builtin

position_eci_to_lci(epc: Union[Epoch, Sequence[Epoch]], x_eci: Union[ndarray, Sequence], axis: int = -1) -> ndarray

Transforms a Cartesian Earth-inertial (ECI) position into the equivalent Cartesian Lunar-inertial (LCI) position.

The LCI origin is the Moon's body center (NAIF ID 301). Auto-initializes the default de440s ephemeris if no SPK kernel is loaded.

Parameters:

Name Type Description Default
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_eci ndarray or list

Cartesian ECI position (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_eci 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 LCI position (m), shape (3,) for a single input, or the batch layout of x_eci (shape (n, 3) for a single vector with a sequence of n epochs).

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)
x_lci = bh.position_eci_to_lci(epc, [1e7, 2e7, 3e7])

position_lci_to_eci builtin

position_lci_to_eci(epc: Union[Epoch, Sequence[Epoch]], x_lci: Union[ndarray, Sequence], axis: int = -1) -> ndarray

Transforms a Cartesian Lunar-inertial (LCI) position into the equivalent Cartesian Earth-inertial (ECI) position.

Auto-initializes the default de440s ephemeris if no SPK kernel is loaded.

Parameters:

Name Type Description Default
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_lci ndarray or list

Cartesian LCI position (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_lci 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 ECI position (m), shape (3,) for a single input, or the batch layout of x_lci (shape (n, 3) for a single vector with a sequence of n epochs).

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)
x_eci = bh.position_lci_to_eci(epc, [1e7, 2e7, 3e7])

state_eci_to_lci builtin

state_eci_to_lci(epc: Union[Epoch, Sequence[Epoch]], x_eci: Union[ndarray, Sequence], axis: int = -1) -> ndarray

Transforms a Cartesian Earth-inertial (ECI) state (position and velocity) into the equivalent Cartesian Lunar-inertial (LCI) state.

The LCI origin is the Moon's body center (NAIF ID 301). Auto-initializes the default de440s ephemeris if no SPK kernel is loaded.

Parameters:

Name Type Description Default
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_eci ndarray or list

Cartesian ECI state [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_eci 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 LCI state [position (m), velocity (m/s)], shape (6,) for a single input, or the batch layout of x_eci (shape (n, 6) for a single vector with a sequence of n epochs).

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)
x_lci = bh.state_eci_to_lci(epc, [1e7, 2e7, 3e7, 1.0, 2.0, 3.0])

state_lci_to_eci builtin

state_lci_to_eci(epc: Union[Epoch, Sequence[Epoch]], x_lci: Union[ndarray, Sequence], axis: int = -1) -> ndarray

Transforms a Cartesian Lunar-inertial (LCI) state (position and velocity) into the equivalent Cartesian Earth-inertial (ECI) state.

Auto-initializes the default de440s ephemeris if no SPK kernel is loaded.

Parameters:

Name Type Description Default
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_lci ndarray or list

Cartesian LCI state [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_lci 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 ECI state [position (m), velocity (m/s)], shape (6,) for a single input, or the batch layout of x_lci (shape (n, 6) for a single vector with a sequence of n epochs).

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)
x_eci = bh.state_lci_to_eci(epc, [1e7, 2e7, 3e7, 1.0, 2.0, 3.0])

See Also