Skip to content

ENZ Frame

rotation_ecef_to_enz builtin

rotation_ecef_to_enz(x_ecef: Union[ndarray, Sequence], axis: int = -1) -> ndarray

Computes the rotation matrix transforming a vector in the Earth-Centered Earth-Fixed (ECEF) frame to the East, North, Zenith (ENZ) topocentric horizon frame of a site.

ENZ is not a SANA orbit-relative frame; it is brahe's coordinates topocentric vocabulary (see rotation_ellipsoid_to_enz), extended here to a rotating axis with an angular velocity. The local horizon is the fundamental plane, E points east, N points due north from the site, and Z points along the site's WGS84 geodetic vertical. ENZ is a signed permutation of SEZ: E = E_SEZ, N = -S_SEZ, Z = Z_SEZ. The site is the position part of x_ecef. The E and N axes, and the frame's rate, are undefined at the poles, where longitude itself is undefined; this is not special-cased.

Parameters:

Name Type Description Default
x_ecef ndarray or list

6D state vector of the site in the ECEF frame [x, y, z, vx, vy, vz] (m, m/s), shape (6,), or a batch of vectors with the 6 components along axis (for example shape (n, 6)); only the position is used

required
axis int

The axis 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: 3x3 rotation matrix transforming from ECEF to ENZ frame, shape (3, 3), or the batch dimensions followed by (3, 3) for batched input.

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

r_site = bh.position_geodetic_to_ecef(np.array([30.0, 45.0, 500.0]), bh.AngleFormat.DEGREES)
x_site = np.array([r_site[0], r_site[1], r_site[2], 0.0, 0.0, 0.0])

R = bh.rotation_ecef_to_enz(x_site)
print(f"ECEF to ENZ rotation matrix:\n{R}")

rotation_enz_to_ecef builtin

rotation_enz_to_ecef(x_ecef: Union[ndarray, Sequence], axis: int = -1) -> ndarray

Computes the rotation matrix transforming a vector in the East, North, Zenith (ENZ) topocentric horizon frame of a site to the Earth-Centered Earth-Fixed (ECEF) frame.

This is the transpose (inverse) of the ECEF-to-ENZ rotation matrix.

Parameters:

Name Type Description Default
x_ecef ndarray or list

6D state vector of the site in the ECEF frame [x, y, z, vx, vy, vz] (m, m/s), shape (6,), or a batch of vectors with the 6 components along axis (for example shape (n, 6)); only the position is used

required
axis int

The axis 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: 3x3 rotation matrix transforming from ENZ to ECEF frame, shape (3, 3), or the batch dimensions followed by (3, 3) for batched input.

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

r_site = bh.position_geodetic_to_ecef(np.array([30.0, 45.0, 500.0]), bh.AngleFormat.DEGREES)
x_site = np.array([r_site[0], r_site[1], r_site[2], 0.0, 0.0, 0.0])

R = bh.rotation_enz_to_ecef(x_site)
print(f"ENZ to ECEF rotation matrix:\n{R}")

omega_enz builtin

omega_enz(x_ecef: Union[ndarray, Sequence], axis: int = -1) -> ndarray

Computes the angular velocity of a site's ENZ frame with respect to the ECEF frame, expressed in ENZ axes.

The ENZ axes depend only on the site's longitude and geodetic latitude, so the frame turns relative to ECEF only when the site moves: about the polar axis at the longitude rate and about the east axis at the latitude rate. A stationary site has zero rate. The rate relative to an inertial frame is this vector plus Earth's rotation rate rotated into ENZ, which the frame graph composes. This is the same angular velocity as omega_sez expressed in ENZ axes instead of SEZ axes.

Parameters:

Name Type Description Default
x_ecef ndarray or list

6D state vector of the site in the ECEF frame [x, y, z, vx, vy, vz] (m, 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 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: Angular velocity of the ENZ frame relative to ECEF, expressed in ENZ axes (rad/s), shape (3,), or the batch dimensions with 3 components along axis for batched input.

Example
1
2
3
4
5
6
import brahe as bh
import numpy as np

r_site = bh.position_geodetic_to_ecef(np.array([30.0, 45.0, 500.0]), bh.AngleFormat.DEGREES)
x_site = np.array([r_site[0], r_site[1], r_site[2], 0.0, 0.0, 0.0])
omega = bh.omega_enz(x_site)

state_ecef_to_enz builtin

state_ecef_to_enz(x_site: Union[ndarray, Sequence], x_target: Union[ndarray, Sequence], axis: int = -1) -> ndarray

Transforms the absolute Earth-Centered Earth-Fixed (ECEF) states of a site and a target into the relative state of the target with respect to the site in the site's rotating ENZ frame.

Parameters:

Name Type Description Default
x_site ndarray or list

6D state vector of the site in the ECEF frame [x, y, z, vx, vy, vz] (m, m/s), shape (6,), or a batch of vectors with the 6 components along axis (for example shape (n, 6)).

required
x_target ndarray or list

6D state vector of the target in the ECEF frame [x, y, z, vx, vy, vz] (m, 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 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. A single vector in one argument is broadcast across a batch in the other.

-1

Returns:

Type Description
ndarray

numpy.ndarray: 6D relative state of the target with respect to the site in the ENZ frame [rho_E, rho_N, rho_Z, rho_dot_E, rho_dot_N, rho_dot_Z] (m, m/s), shape (6,), or the layout of the batched argument for batched input.

Example
1
2
3
4
5
6
7
8
9
import brahe as bh
import numpy as np

r_site = bh.position_geodetic_to_ecef(np.array([30.0, 45.0, 500.0]), bh.AngleFormat.DEGREES)
x_site = np.array([r_site[0], r_site[1], r_site[2], 0.0, 0.0, 0.0])
x_target = x_site + np.array([200e3, 300e3, 400e3, 0.0, 0.0, 0.0])

x_rel_enz = bh.state_ecef_to_enz(x_site, x_target)
print(f"Relative state in ENZ: {x_rel_enz}")

state_enz_to_ecef builtin

state_enz_to_ecef(x_site: Union[ndarray, Sequence], x_rel_enz: Union[ndarray, Sequence], axis: int = -1) -> ndarray

Transforms the relative state of a target with respect to a site from the site's rotating ENZ frame to the absolute state of the target in the Earth-Centered Earth-Fixed (ECEF) frame.

Parameters:

Name Type Description Default
x_site ndarray or list

6D state vector of the site in the ECEF frame [x, y, z, vx, vy, vz] (m, m/s), shape (6,), or a batch of vectors with the 6 components along axis (for example shape (n, 6)).

required
x_rel_enz ndarray or list

6D relative state of the target with respect to the site in the ENZ frame [rho_E, rho_N, rho_Z, rho_dot_E, rho_dot_N, rho_dot_Z] (m, 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 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. A single vector in one argument is broadcast across a batch in the other.

-1

Returns:

Type Description
ndarray

numpy.ndarray: 6D state vector of the target in the ECEF frame [x, y, z, vx, vy, vz] (m, m/s), shape (6,), or the layout of the batched argument for batched input.

Example
1
2
3
4
5
6
7
8
9
import brahe as bh
import numpy as np

r_site = bh.position_geodetic_to_ecef(np.array([30.0, 45.0, 500.0]), bh.AngleFormat.DEGREES)
x_site = np.array([r_site[0], r_site[1], r_site[2], 0.0, 0.0, 0.0])
x_rel_enz = np.array([1000.0, 500.0, -300.0, 0.0, 0.0, 0.0])

x_target = bh.state_enz_to_ecef(x_site, x_rel_enz)
print(f"Target state in ECEF: {x_target}")

See Also