Skip to content

Synodic Frames

Transformations between GCRF and the Earth-Moon Rotating (EMR), Sun-Earth Rotating (SER), and Geocentric Solar Ecliptic (GSE) frames.

Note

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

GCRF ↔ EMR

rotation_gcrf_to_emr builtin

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

Computes the rotation matrix from GCRF axes to Earth-Moon Rotating (EMR) frame axes (NASA TP-20220014814 §4.6.2): x̂ Earth→Moon, ẑ along the Moon's orbital angular momentum relative to Earth.

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 matrix per epoch.

required

Returns:

Type Description
ndarray

numpy.ndarray: 3x3 rotation matrix transforming GCRF -> EMR axes, shape (3, 3) for a single epoch or (n, 3, 3) for a sequence of n epochs.

Raises:

Type Description
RuntimeError

If the SPK lookup fails 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_gcrf_to_emr(epc)

rotation_emr_to_gcrf builtin

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

Computes the rotation matrix from Earth-Moon Rotating (EMR) frame axes to GCRF axes. Inverse of rotation_gcrf_to_emr.

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 matrix per epoch.

required

Returns:

Type Description
ndarray

numpy.ndarray: 3x3 rotation matrix transforming EMR -> GCRF axes, shape (3, 3) for a single epoch or (n, 3, 3) for a sequence of n epochs.

Raises:

Type Description
RuntimeError

If the SPK lookup fails 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_emr_to_gcrf(epc)

position_gcrf_to_emr builtin

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

Transforms a Cartesian GCRF position into the equivalent Earth-Moon Rotating (EMR) frame position. The EMR origin is the Earth-Moon barycenter.

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_gcrf ndarray or list

Cartesian GCRF 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_gcrf 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 EMR position (m), shape (3,) for a single input, or the batch layout of x_gcrf (shape (n, 3) for a single vector with a sequence of n epochs).

Raises:

Type Description
RuntimeError

If the SPK lookup fails 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)
x_emr = bh.position_gcrf_to_emr(epc, [1e8, -2e8, 5e7])

position_emr_to_gcrf builtin

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

Transforms a Cartesian Earth-Moon Rotating (EMR) frame position into the equivalent Cartesian GCRF position. Inverse of position_gcrf_to_emr.

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_emr ndarray or list

Cartesian EMR 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_emr 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 GCRF position (m), shape (3,) for a single input, or the batch layout of x_emr (shape (n, 3) for a single vector with a sequence of n epochs).

Raises:

Type Description
RuntimeError

If the SPK lookup fails 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)
x_gcrf = bh.position_emr_to_gcrf(epc, [3.8e8, 0.0, 0.0])

state_gcrf_to_emr builtin

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

Transforms a Cartesian GCRF state (position and velocity) into the equivalent Earth-Moon Rotating (EMR) frame state. The EMR origin is the Earth-Moon barycenter; the velocity transform uses the exact rotation- matrix time derivative (including dẑ/dt) evaluated from SPK acceleration.

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_gcrf ndarray or list

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

Raises:

Type Description
RuntimeError

If the SPK lookup fails 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)
x_emr = bh.state_gcrf_to_emr(epc, [1e8, -2e8, 5e7, 1.0e3, -2.0e3, 0.5e3])

state_emr_to_gcrf builtin

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

Transforms a Cartesian Earth-Moon Rotating (EMR) frame state (position and velocity) into the equivalent Cartesian GCRF state. Inverse of state_gcrf_to_emr.

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_emr ndarray or list

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

Raises:

Type Description
RuntimeError

If the SPK lookup fails at epc

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_emr = [3.8e8, 0.0, 0.0, 0.0, 1.0e3, 0.0]
x_gcrf = bh.state_emr_to_gcrf(epc, x_emr)

GCRF ↔ SER

rotation_gcrf_to_ser builtin

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

Computes the rotation matrix from GCRF axes to Sun-Earth Rotating (SER) frame axes (NASA TP-20220014814 §4.6.4): x̂ Sun→Earth, ẑ along Earth's orbital angular momentum relative to the Sun.

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 matrix per epoch.

required

Returns:

Type Description
ndarray

numpy.ndarray: 3x3 rotation matrix transforming GCRF -> SER axes, shape (3, 3) for a single epoch or (n, 3, 3) for a sequence of n epochs.

Raises:

Type Description
RuntimeError

If the SPK lookup fails 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_gcrf_to_ser(epc)

rotation_ser_to_gcrf builtin

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

Computes the rotation matrix from Sun-Earth Rotating (SER) frame axes to GCRF axes. Inverse of rotation_gcrf_to_ser.

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 matrix per epoch.

required

Returns:

Type Description
ndarray

numpy.ndarray: 3x3 rotation matrix transforming SER -> GCRF axes, shape (3, 3) for a single epoch or (n, 3, 3) for a sequence of n epochs.

Raises:

Type Description
RuntimeError

If the SPK lookup fails 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_ser_to_gcrf(epc)

position_gcrf_to_ser builtin

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

Transforms a Cartesian GCRF position into the equivalent Sun-Earth Rotating (SER) frame position. The SER origin is the (computed) Sun-Earth barycenter.

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_gcrf ndarray or list

Cartesian GCRF 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_gcrf 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 SER position (m), shape (3,) for a single input, or the batch layout of x_gcrf (shape (n, 3) for a single vector with a sequence of n epochs).

Raises:

Type Description
RuntimeError

If the SPK lookup fails 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)
x_ser = bh.position_gcrf_to_ser(epc, [1e8, -2e8, 5e7])

position_ser_to_gcrf builtin

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

Transforms a Cartesian Sun-Earth Rotating (SER) frame position into the equivalent Cartesian GCRF position. Inverse of position_gcrf_to_ser.

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_ser ndarray or list

Cartesian SER 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_ser 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 GCRF position (m), shape (3,) for a single input, or the batch layout of x_ser (shape (n, 3) for a single vector with a sequence of n epochs).

Raises:

Type Description
RuntimeError

If the SPK lookup fails 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)
x_gcrf = bh.position_ser_to_gcrf(epc, [1.5e11, 0.0, 0.0])

state_gcrf_to_ser builtin

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

Transforms a Cartesian GCRF state (position and velocity) into the equivalent Sun-Earth Rotating (SER) frame state. The SER origin is the (computed) Sun-Earth barycenter; the velocity transform uses the exact rotation-matrix time derivative (including dẑ/dt) evaluated from SPK acceleration.

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_gcrf ndarray or list

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

Raises:

Type Description
RuntimeError

If the SPK lookup fails 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)
x_ser = bh.state_gcrf_to_ser(epc, [1e8, -2e8, 5e7, 1.0e3, -2.0e3, 0.5e3])

state_ser_to_gcrf builtin

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

Transforms a Cartesian Sun-Earth Rotating (SER) frame state (position and velocity) into the equivalent Cartesian GCRF state. Inverse of state_gcrf_to_ser.

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_ser ndarray or list

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

Raises:

Type Description
RuntimeError

If the SPK lookup fails at epc

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_ser = [1.5e11, 0.0, 0.0, 0.0, 1.0e3, 0.0]
x_gcrf = bh.state_ser_to_gcrf(epc, x_ser)

GCRF ↔ GSE

rotation_gcrf_to_gse builtin

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

Computes the rotation matrix from GCRF axes to Geocentric Solar Ecliptic (GSE) frame axes (NASA TP-20220014814 §2.5.4/§4.6.5): x̂ Earth→Sun, ẑ normal to the instantaneous ecliptic plane.

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 matrix per epoch.

required

Returns:

Type Description
ndarray

numpy.ndarray: 3x3 rotation matrix transforming GCRF -> GSE axes, shape (3, 3) for a single epoch or (n, 3, 3) for a sequence of n epochs.

Raises:

Type Description
RuntimeError

If the SPK lookup fails 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_gcrf_to_gse(epc)

rotation_gse_to_gcrf builtin

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

Computes the rotation matrix from Geocentric Solar Ecliptic (GSE) frame axes to GCRF axes. Inverse of rotation_gcrf_to_gse.

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 matrix per epoch.

required

Returns:

Type Description
ndarray

numpy.ndarray: 3x3 rotation matrix transforming GSE -> GCRF axes, shape (3, 3) for a single epoch or (n, 3, 3) for a sequence of n epochs.

Raises:

Type Description
RuntimeError

If the SPK lookup fails 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_gse_to_gcrf(epc)

position_gcrf_to_gse builtin

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

Transforms a Cartesian GCRF position into the equivalent Geocentric Solar Ecliptic (GSE) frame position. GSE is Earth-centered.

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_gcrf ndarray or list

Cartesian GCRF 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_gcrf 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 GSE position (m), shape (3,) for a single input, or the batch layout of x_gcrf (shape (n, 3) for a single vector with a sequence of n epochs).

Raises:

Type Description
RuntimeError

If the SPK lookup fails 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)
x_gse = bh.position_gcrf_to_gse(epc, [1e8, -2e8, 5e7])

position_gse_to_gcrf builtin

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

Transforms a Cartesian Geocentric Solar Ecliptic (GSE) frame position into the equivalent Cartesian GCRF position. Inverse of position_gcrf_to_gse.

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_gse ndarray or list

Cartesian GSE 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_gse 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 GCRF position (m), shape (3,) for a single input, or the batch layout of x_gse (shape (n, 3) for a single vector with a sequence of n epochs).

Raises:

Type Description
RuntimeError

If the SPK lookup fails 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)
x_gcrf = bh.position_gse_to_gcrf(epc, [1.5e11, 0.0, 0.0])

state_gcrf_to_gse builtin

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

Transforms a Cartesian GCRF state (position and velocity) into the equivalent Geocentric Solar Ecliptic (GSE) frame state. GSE is Earth-centered; the velocity transform uses the exact rotation-matrix time derivative (including dẑ/dt) evaluated from SPK acceleration.

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_gcrf ndarray or list

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

Raises:

Type Description
RuntimeError

If the SPK lookup fails 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)
x_gse = bh.state_gcrf_to_gse(epc, [1e8, -2e8, 5e7, 1.0e3, -2.0e3, 0.5e3])

state_gse_to_gcrf builtin

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

Transforms a Cartesian Geocentric Solar Ecliptic (GSE) frame state (position and velocity) into the equivalent Cartesian GCRF state. Inverse of state_gcrf_to_gse.

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_gse ndarray or list

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

Raises:

Type Description
RuntimeError

If the SPK lookup fails at epc

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_gse = [1.5e11, 0.0, 0.0, 0.0, 1.0e3, 0.0]
x_gcrf = bh.state_gse_to_gcrf(epc, x_gse)

SynodicOrigin

Origin choice for the generic CelestialFrame.Synodic constructor.

SynodicOrigin

SynodicOrigin()

Origin choice for a generic synodic frame (CelestialFrame.Synodic): Primary, Secondary, or the GM-weighted two-body Barycenter.

Initialize instance.

Barycenter class-attribute

Barycenter: Any = SynodicOrigin.Barycenter

Origin choice for a generic synodic frame (CelestialFrame.Synodic): Primary, Secondary, or the GM-weighted two-body Barycenter.

Primary class-attribute

Primary: Any = SynodicOrigin.Primary

Origin choice for a generic synodic frame (CelestialFrame.Synodic): Primary, Secondary, or the GM-weighted two-body Barycenter.

Secondary class-attribute

Secondary: Any = SynodicOrigin.Secondary

Origin choice for a generic synodic frame (CelestialFrame.Synodic): Primary, Secondary, or the GM-weighted two-body Barycenter.

See Also