Skip to content

Topocentric Coordinates

Functions for working with local topocentric coordinate frames including East-North-Up (ENZ), South-East-Zenith (SEZ), and Azimuth-Elevation-Range.

ENZ (East-North-Up) Frame

Rotation Matrices

rotation_ellipsoid_to_enz builtin

rotation_ellipsoid_to_enz(x_ellipsoid: ndarray, angle_format: AngleFormat) -> Any

Compute rotation matrix from ellipsoidal coordinates to East-North-Up (ENZ) frame.

Calculates the rotation matrix that transforms vectors from an ellipsoidal coordinate frame (geocentric or geodetic) to the local East-North-Up (ENZ) topocentric frame at the specified location.

Parameters:

Name Type Description Default
x_ellipsoid ndarray

Ellipsoidal position [latitude, longitude, altitude/radius] where latitude is in radians or degrees, longitude is in radians or degrees.

required
angle_format AngleFormat

Angle format for input angular coordinates (RADIANS or DEGREES).

required

Returns:

Type Description
ndarray

3x3 rotation matrix from ellipsoidal frame to ENZ frame.

rotation_enz_to_ellipsoid builtin

rotation_enz_to_ellipsoid(x_ellipsoid: ndarray, angle_format: AngleFormat) -> Any

Compute rotation matrix from East-North-Up (ENZ) frame to ellipsoidal coordinates.

Calculates the rotation matrix that transforms vectors from the local East-North-Up (ENZ) topocentric frame to an ellipsoidal coordinate frame (geocentric or geodetic) at the specified location.

Parameters:

Name Type Description Default
x_ellipsoid ndarray

Ellipsoidal position [latitude, longitude, altitude/radius] where latitude is in radians or degrees, longitude is in radians or degrees.

required
angle_format AngleFormat

Angle format for input angular coordinates (RADIANS or DEGREES).

required

Returns:

Type Description
ndarray

3x3 rotation matrix from ENZ frame to ellipsoidal frame.

Position Conversions

relative_position_ecef_to_enz builtin

relative_position_ecef_to_enz(location_ecef: ndarray, r_ecef: ndarray, conversion_type: EllipsoidalConversionType) -> Any

Convert relative position from ECEF to East-North-Up (ENZ) frame.

Transforms a relative position vector from Earth-Centered Earth-Fixed (ECEF) coordinates to the local East-North-Up (ENZ) topocentric frame at the specified location.

Parameters:

Name Type Description Default
location_ecef ndarray

Reference location in ECEF coordinates [x, y, z] in meters.

required
r_ecef ndarray

Position vector in ECEF coordinates [x, y, z] in meters.

required
conversion_type EllipsoidalConversionType

Type of ellipsoidal conversion (GEOCENTRIC or GEODETIC).

required

Returns:

Type Description
ndarray

Relative position in ENZ frame [east, north, up] in meters.

Example
import brahe as bh
import numpy as np

# Ground station and satellite positions
station_ecef = np.array([4000000.0, 3000000.0, 4000000.0])
sat_ecef = np.array([4100000.0, 3100000.0, 4100000.0])
enz = bh.relative_position_ecef_to_enz(station_ecef, sat_ecef, bh.EllipsoidalConversionType.GEODETIC)
print(f"ENZ: East={enz[0]/1000:.1f}km, North={enz[1]/1000:.1f}km, Up={enz[2]/1000:.1f}km")

relative_position_enz_to_ecef builtin

relative_position_enz_to_ecef(location_ecef: ndarray, r_enz: ndarray, conversion_type: EllipsoidalConversionType) -> Any

Convert relative position from East-North-Up (ENZ) frame to ECEF.

Transforms a relative position vector from the local East-North-Up (ENZ) topocentric frame to Earth-Centered Earth-Fixed (ECEF) coordinates at the specified location.

Parameters:

Name Type Description Default
location_ecef ndarray

Reference location in ECEF coordinates [x, y, z] in meters.

required
r_enz ndarray

Relative position in ENZ frame [east, north, up] in meters.

required
conversion_type EllipsoidalConversionType

Type of ellipsoidal conversion (GEOCENTRIC or GEODETIC).

required

Returns:

Type Description
ndarray

Position vector in ECEF coordinates [x, y, z] in meters.

Example
import brahe as bh
import numpy as np

# Convert ENZ offset back to ECEF
station_ecef = np.array([4000000.0, 3000000.0, 4000000.0])
enz_offset = np.array([50000.0, 30000.0, 100000.0])  # 50km east, 30km north, 100km up
target_ecef = bh.relative_position_enz_to_ecef(station_ecef, enz_offset, bh.EllipsoidalConversionType.GEODETIC)
print(f"Target ECEF: {target_ecef}")

position_enz_to_azel builtin

position_enz_to_azel(x_enz: ndarray, angle_format: AngleFormat) -> Any

Convert position from East-North-Up (ENZ) frame to azimuth-elevation-range.

Transforms a position from the local East-North-Up (ENZ) topocentric frame to azimuth-elevation-range spherical coordinates.

Parameters:

Name Type Description Default
x_enz ndarray

Position in ENZ frame [east, north, up] in meters.

required
angle_format AngleFormat

Angle format for output angular coordinates (RADIANS or DEGREES).

required

Returns:

Type Description
ndarray

Azimuth-elevation-range [azimuth, elevation, range] where azimuth and elevation are in radians or degrees, and range is in meters.

Example
import brahe as bh
import numpy as np

# Convert ENZ to azimuth-elevation for satellite tracking
enz = np.array([50000.0, 100000.0, 200000.0])  # East, North, Up (meters)
azel = bh.position_enz_to_azel(enz, bh.AngleFormat.DEGREES)
print(f"Az={azel[0]:.1f}°, El={azel[1]:.1f}°, Range={azel[2]/1000:.1f}km")

SEZ (South-East-Zenith) Frame

Rotation Matrices

rotation_ellipsoid_to_sez builtin

rotation_ellipsoid_to_sez(x_ellipsoid: ndarray, angle_format: AngleFormat) -> Any

Compute rotation matrix from ellipsoidal coordinates to South-East-Zenith (SEZ) frame.

Calculates the rotation matrix that transforms vectors from an ellipsoidal coordinate frame (geocentric or geodetic) to the local South-East-Zenith (SEZ) topocentric frame at the specified location.

Parameters:

Name Type Description Default
x_ellipsoid ndarray

Ellipsoidal position [latitude, longitude, altitude/radius] where latitude is in radians or degrees, longitude is in radians or degrees.

required
angle_format AngleFormat

Angle format for input angular coordinates (RADIANS or DEGREES).

required

Returns:

Type Description
ndarray

3x3 rotation matrix from ellipsoidal frame to SEZ frame.

Example
import brahe as bh
import numpy as np

# Get rotation matrix for ground station in SEZ frame
lat, lon, alt = 0.7, -1.5, 100.0  # radians, meters
x_geod = np.array([lat, lon, alt])
R_sez = bh.rotation_ellipsoid_to_sez(x_geod, bh.AngleFormat.RADIANS)
print(f"Rotation matrix shape: {R_sez.shape}")

rotation_sez_to_ellipsoid builtin

rotation_sez_to_ellipsoid(x_ellipsoid: ndarray, angle_format: AngleFormat) -> Any

Compute rotation matrix from South-East-Zenith (SEZ) frame to ellipsoidal coordinates.

Calculates the rotation matrix that transforms vectors from the local South-East-Zenith (SEZ) topocentric frame to an ellipsoidal coordinate frame (geocentric or geodetic) at the specified location.

Parameters:

Name Type Description Default
x_ellipsoid ndarray

Ellipsoidal position [latitude, longitude, altitude/radius] where latitude is in radians or degrees, longitude is in radians or degrees.

required
angle_format AngleFormat

Angle format for input angular coordinates (RADIANS or DEGREES).

required

Returns:

Type Description
ndarray

3x3 rotation matrix from SEZ frame to ellipsoidal frame.

Example
import brahe as bh
import numpy as np

# Get inverse rotation matrix from SEZ to ellipsoidal
lat, lon, alt = 0.7, -1.5, 100.0  # radians, meters
x_geod = np.array([lat, lon, alt])
R_ellipsoid = bh.rotation_sez_to_ellipsoid(x_geod, bh.AngleFormat.RADIANS)
print(f"Rotation matrix shape: {R_ellipsoid.shape}")

Position Conversions

relative_position_ecef_to_sez builtin

relative_position_ecef_to_sez(location_ecef: ndarray, r_ecef: ndarray, conversion_type: EllipsoidalConversionType) -> Any

Convert relative position from ECEF to South-East-Zenith (SEZ) frame.

Transforms a relative position vector from Earth-Centered Earth-Fixed (ECEF) coordinates to the local South-East-Zenith (SEZ) topocentric frame at the specified location.

Parameters:

Name Type Description Default
location_ecef ndarray

Reference location in ECEF coordinates [x, y, z] in meters.

required
r_ecef ndarray

Position vector in ECEF coordinates [x, y, z] in meters.

required
conversion_type EllipsoidalConversionType

Type of ellipsoidal conversion (GEOCENTRIC or GEODETIC).

required

Returns:

Type Description
ndarray

Relative position in SEZ frame [south, east, zenith] in meters.

Example
import brahe as bh
import numpy as np

# Ground station and satellite positions
station_ecef = np.array([4000000.0, 3000000.0, 4000000.0])
sat_ecef = np.array([4100000.0, 3100000.0, 4100000.0])
sez = bh.relative_position_ecef_to_sez(station_ecef, sat_ecef, bh.EllipsoidalConversionType.GEODETIC)
print(f"SEZ: South={sez[0]/1000:.1f}km, East={sez[1]/1000:.1f}km, Zenith={sez[2]/1000:.1f}km")

relative_position_sez_to_ecef builtin

relative_position_sez_to_ecef(location_ecef: ndarray, x_sez: ndarray, conversion_type: EllipsoidalConversionType) -> Any

Convert relative position from South-East-Zenith (SEZ) frame to ECEF.

Transforms a relative position vector from the local South-East-Zenith (SEZ) topocentric frame to Earth-Centered Earth-Fixed (ECEF) coordinates at the specified location.

Parameters:

Name Type Description Default
location_ecef ndarray

Reference location in ECEF coordinates [x, y, z] in meters.

required
x_sez ndarray

Relative position in SEZ frame [south, east, zenith] in meters.

required
conversion_type EllipsoidalConversionType

Type of ellipsoidal conversion (GEOCENTRIC or GEODETIC).

required

Returns:

Type Description
ndarray

Position vector in ECEF coordinates [x, y, z] in meters.

Example
import brahe as bh
import numpy as np

# Convert SEZ offset back to ECEF
station_ecef = np.array([4000000.0, 3000000.0, 4000000.0])
sez_offset = np.array([30000.0, 50000.0, 100000.0])  # 30km south, 50km east, 100km up
target_ecef = bh.relative_position_sez_to_ecef(station_ecef, sez_offset, bh.EllipsoidalConversionType.GEODETIC)
print(f"Target ECEF: {target_ecef}")

position_sez_to_azel builtin

position_sez_to_azel(x_sez: ndarray, angle_format: AngleFormat) -> Any

Convert position from South-East-Zenith (SEZ) frame to azimuth-elevation-range.

Transforms a position from the local South-East-Zenith (SEZ) topocentric frame to azimuth-elevation-range spherical coordinates.

Parameters:

Name Type Description Default
x_sez ndarray

Position in SEZ frame [south, east, zenith] in meters.

required
angle_format AngleFormat

Angle format for output angular coordinates (RADIANS or DEGREES).

required

Returns:

Type Description
ndarray

Azimuth-elevation-range [azimuth, elevation, range] where azimuth and elevation are in radians or degrees, and range is in meters.

Example
import brahe as bh
import numpy as np

# Convert SEZ to azimuth-elevation for satellite tracking
sez = np.array([30000.0, 50000.0, 100000.0])  # South, East, Zenith (meters)
azel = bh.position_sez_to_azel(sez, bh.AngleFormat.DEGREES)
print(f"Az={azel[0]:.1f}°, El={azel[1]:.1f}°, Range={azel[2]/1000:.1f}km")