Skip to content

ITRF Coordinate

Positions in the International Terrestrial Reference Frame with conversion to and from geodetic coordinates on the WGS 84 ellipsoid (NGA 2014). The Cartesian → geodetic conversion is the iterative reduced-latitude method of Bowring (1976); geodesic distances and headings use the nested-equation solution of Vincenty (1975).

itrfcoord

Representation of a coordinate in the International Terrestrial Reference Frame (ITRF)

This coordinate object can be created from and also output to Geodetic coordinates (latitude, longitude, height above ellipsoid). Functions are also available to provide rotation quaternions to the East-North-Up frame and North-East-Down frame at this coordinate.

Example

Create ITRF coord from Cartesian:

coord = satkit.itrfcoord([ 1523128.63570828, -4461395.28873207,  4281865.94218203 ])

Create ITRF coord from Geodetic:

coord = satkit.itrfcoord(latitude_deg=42.44, longitude_deg=-71.15, altitude=100)

latitude_deg property

Latitude in degrees

longitude_deg property

Longitude in degrees

latitude_rad property

Latitude in radians

longitude_rad property

Longitude in radians

altitude property

Altitude above ellipsoid, in meters

height property

Height above ellipsoid, in meters (alias of altitude)

geodetic property

Geodetic coordinates as a named struct

Returns:

Type Description
geodetic

Geodetic struct with latitude_rad, longitude_rad, height_m fields and latitude_deg, longitude_deg computed properties

vector property

Cartesian ITRF coord as numpy array

Returns:

Type Description
NDArray[float64]

3-element numpy array representing the ITRF Cartesian coordinate in meters

qned2itrf property

Quaternion representing rotation from North-East-Down (NED) to ITRF at this location

Returns:

Type Description
quaternion

Quaternion representiong rotation from North-East-Down (NED) to ITRF at this location

qenu2itrf property

Quaternion representiong rotation from East-North-Up (ENU) to ITRF at this location

Returns:

Type Description
quaternion

Quaternion representiong rotation from East-North-Up (ENU) to ITRF at this location

from_vector(vec) staticmethod

Create an ITRF coordinate from a Cartesian position

The named-constructor form of itrfcoord(vec); the inverse of the vector property.

Parameters:

Name Type Description Default
vec ArrayLike

ITRF Cartesian position in meters: any real numeric 3-element array-like (numpy array, list or tuple)

required

Returns:

Type Description
itrfcoord

New ITRF coordinate

Raises:

Type Description
TypeError

vec is not a real numeric array-like

ValueError

vec does not have 3 elements, or holds a NaN or infinity

Example
coord = satkit.itrfcoord.from_vector([1523128.63570828, -4461395.28873207, 4281865.94218203])
print(coord.vector)

to_enu(origin)

East-North-Up (ENU) vector from origin to self, in origin's local-tangent frame.

The ENU triad has its origin at origin; self is the point being located. The Up component is positive when self is above origin along origin's local normal (further from Earth's center) — i.e. "what direction is self from where I'm standing at origin?"

Parameters:

Name Type Description Default
origin itrfcoord

ITRF coordinate at which the ENU frame is anchored (the observer / station / base of the local tangent plane).

required

Returns:

Type Description
NDArray[float64]

3-element [E, N, U] vector from origin to self, in meters.

Notes
  • This is equivalent to calling: origin.qenu2itrf.conj() * (self - origin)
Example
station   = satkit.itrfcoord(latitude_deg=42.466, longitude_deg=-71.1516, altitude=0)
satellite = satkit.itrfcoord(latitude_deg=42.466, longitude_deg=-71.1516, altitude=400_000)
enu = satellite.to_enu(station)  # satellite is overhead → Up ≈ +400_000 m
print(f"East: {enu[0]:.1f} m, North: {enu[1]:.1f} m, Up: {enu[2]:.1f} m")

to_ned(origin)

North-East-Down (NED) vector from origin to self, in origin's local-tangent frame.

The NED triad has its origin at origin; self is the point being located. The Down component is positive when self is below origin along origin's local normal (closer to Earth's center).

Parameters:

Name Type Description Default
origin itrfcoord

ITRF coordinate at which the NED frame is anchored (the observer / station / base of the local tangent plane).

required

Returns:

Type Description
NDArray[float64]

3-element [N, E, D] vector from origin to self, in meters.

Notes
  • This is equivalent to calling: origin.qned2itrf.conj() * (self - origin)

__sub__(other)

Subtract another ITRF coordinate from this one

Parameters:

Name Type Description Default
other itrfcoord

Other ITRF coordinate to subtract

required

Returns:

Type Description
NDArray[float64]

3-element numpy array representing the difference in meters between the two ITRF coordinates

__eq__(other)

True when other is an itrfcoord with exactly the same Cartesian components (no tolerance)

geodesic_distance(other)

Geodesic (shortest path on the WGS-84 ellipsoid) from this coordinate to another: distance and headings

Parameters:

Name Type Description Default
other itrfcoord

ITRF coordinate to measure to

required

Returns:

Type Description
tuple[float, float, float]

(distance in meters, initial heading in radians, heading at destination in radians)

Notes
  • Both points are projected onto the ellipsoid: heights are ignored
  • Vincenty's inverse formula, iterated to convergence (T. Vincenty, Survey Review 23(176), 1975, https://doi.org/10.1179/sre.1975.23.176.88). For nearly antipodal points, where that iteration does not converge, the same series are solved for the initial heading by bisection. Accurate to better than a millimeter for any pair of points
  • Headings are clockwise from north, in (-pi, pi]. The heading at the destination is the direction of travel on arrival (add pi for the back azimuth)
  • For coincident points all three values are 0. Between exactly antipodal points, or from a pole, the shortest path is not unique: the distance is well defined, the headings are those of one of the shortest paths
Example
boston = satkit.itrfcoord(latitude_deg=42.36, longitude_deg=-71.06, altitude=0)
nyc = satkit.itrfcoord(latitude_deg=40.71, longitude_deg=-74.01, altitude=0)
dist, heading_start, heading_end = boston.geodesic_distance(nyc)
print(f"Distance: {dist/1000:.1f} km")

distance_to(other)

Geodesic distance in meters between this coordinate and another

Convenience wrapper around geodesic_distance returning only the distance (shortest distance along the WGS-84 ellipsoid; heights are ignored).

Parameters:

Name Type Description Default
other itrfcoord

ITRF coordinate to measure distance to

required

Returns:

Type Description
float

Distance in meters

move_with_heading(distance, heading_rad)

Move a distance along the Earth surface with a given initial heading

Parameters:

Name Type Description Default
distance float

Distance to move in meters

required
heading_rad float

Initial heading in radians

required
Notes

The path follows the ellipsoid: the starting height is ignored and the result has zero height

Use Vincenty's direct formula to compute position (T. Vincenty, Survey Review 23(176), 1975, https://doi.org/10.1179/sre.1975.23.176.88)

Returns:

Type Description
itrfcoord

New ITRF coordinate after moving distance meters along the geodesic

Example
import math
start = satkit.itrfcoord(latitude_deg=42.36, longitude_deg=-71.06, altitude=0)
# Move 100 km due north
dest = start.move_with_heading(100e3, math.radians(0))
print(f"Destination: {dest.latitude_deg:.2f} deg lat, {dest.longitude_deg:.2f} deg lon")

__init__(*, latitude_rad, longitude_rad, altitude=None, height=None)

__init__(vec: npt.ArrayLike) -> None
__init__(x: float, y: float, z: float) -> None
__init__(*, latitude_deg: float, longitude_deg: float, altitude: float | None = None, height: float | None = None) -> None
__init__(*, latitude_rad: float, longitude_rad: float, altitude: float | None = None, height: float | None = None) -> None

Create ITRF coordinate from Cartesian vector or geodetic parameters.

Pass the Cartesian position positionally, either as one 3-element array-like or as three floats; or pass the geodetic position as keywords: a latitude and a longitude, both required, each in degrees or in radians, and optionally a height. The two forms cannot be mixed.

Parameters:

Name Type Description Default
vec

ITRF Cartesian location in meters (any real numeric 3-element array-like: numpy array, list or tuple)

required
latitude_deg

Geodetic latitude in degrees, in [-90, 90]

required
longitude_deg

Longitude in degrees

required
latitude_rad float

Geodetic latitude in radians, in [-pi/2, pi/2]

required
longitude_rad float

Longitude in radians

required
altitude float | None

Height above ellipsoid, meters. Default is 0

None
height float | None

Height above ellipsoid, meters (alias of altitude)

None

Raises:

Type Description
TypeError

no position given; positional and keyword forms mixed; the same quantity given twice (latitude_deg with latitude_rad, longitude_deg with longitude_rad, altitude with height); latitude or longitude missing; the positional argument is not a real numeric array-like or three numbers; a keyword that is not a real number

ValueError

latitude outside [-90, 90] degrees; a NaN or infinite latitude, longitude, height or Cartesian component; a positional array that does not have 3 elements

Notes

The named constructors itrfcoord.from_vector and itrfcoord.from_geodetic do the same.

from_geodetic(*, latitude_rad, longitude_rad, height=None)

from_geodetic(*, latitude_deg: float, longitude_deg: float, height: float | None = None) -> itrfcoord
from_geodetic(*, latitude_rad: float, longitude_rad: float, height: float | None = None) -> itrfcoord

Create an ITRF coordinate from a geodetic position

The named-constructor form of itrfcoord(latitude_deg=..., longitude_deg=..., altitude=...), with the same checks. Give a latitude and a longitude, each in degrees or in radians, and optionally the height; all arguments are keyword-only.

Parameters:

Name Type Description Default
latitude_rad float

Geodetic latitude in radians, in [-pi/2, pi/2]. Give this or latitude_deg (degrees, in [-90, 90])

required
longitude_rad float

Longitude in radians. Give this or longitude_deg (degrees)

required
height float | None

Height above the WGS84 ellipsoid, meters. Default is 0

None

Returns:

Type Description
itrfcoord

New ITRF coordinate

Raises:

Type Description
TypeError

latitude or longitude missing; the same quantity given in both units (latitude_deg with latitude_rad, longitude_deg with longitude_rad); an argument that is not a real number

ValueError

latitude outside [-90, 90] degrees; a NaN or infinite latitude, longitude or height

Example
coord = satkit.itrfcoord.from_geodetic(latitude_deg=42.44, longitude_deg=-71.15, height=100)
print(coord)
# ITRFCoord(lat:  42.4400 deg, lon: -71.1500 deg, hae:  0.10 km)

geodetic

Geodetic coordinates with named fields

Returned by itrfcoord.geodetic; it has no constructor and its fields are read-only.

Attributes:

Name Type Description
latitude_rad float

Latitude in radians

longitude_rad float

Longitude in radians

height_m float

Height above WGS84 ellipsoid in meters

latitude_deg float

Latitude in degrees (computed)

longitude_deg float

Longitude in degrees (computed)

latitude_rad property

Latitude in radians

longitude_rad property

Longitude in radians

height_m property

Height above WGS84 ellipsoid in meters

latitude_deg property

Latitude in degrees

longitude_deg property

Longitude in degrees

__eq__(other)

True when other is a geodetic with exactly the same latitude, longitude and height (no tolerance)

__hash__()

Hash of the three fields, consistent with ==