ITRF Coordinates¶
The International Terrestrial Reference Frame (ITRF) is the standard Earth-fixed coordinate system used in geodesy and satellite operations. Positions in this frame rotate with the Earth, making it the natural choice for describing locations on or near the Earth's surface.
satkit.itrfcoord represents a position in this frame and provides conversions between:
- Geodetic coordinates: latitude, longitude, and altitude above the WGS-84 ellipsoid
- Cartesian coordinates: a 3-element vector (x, y, z) in meters, with origin at the Earth's center
This tutorial demonstrates creating coordinates from geodetic parameters, converting to/from Cartesian vectors, and computing geodesic (great-circle) distances between locations.
import satkit as sk
# Specify a coordinate via Geodetic latitude & longitude (if altitude is left out, default is 0
boston = sk.itrfcoord(latitude_deg=42.14, longitude_deg=-71.15)
# Denver, CO is at a higher altitude; altitude is specified in meters
denver = sk.itrfcoord(latitude_deg=32.7392, longitude_deg=-104.99, altitude=1600)
print(f'Denver = {denver}')
# Get the Cartesian vector for Denver
print(f'Denver vector coordinate is {denver.vector}')
# Create a duplicate of the Denver coordinate, using vector as input
denver2 = sk.itrfcoord(denver.vector)
print(f'Denver created from Cartesian is {denver2}')
Denver = ITRFCoord(lat: 32.7392 deg, lon: -104.9900 deg, hae: 1.60 km) Denver vector coordinate is [-1389345.60167272 -5188730.62268842 3430531.07678629] Denver created from Cartesian is ITRFCoord(lat: 32.7392 deg, lon: -104.9900 deg, hae: 1.60 km)
Creating Coordinates¶
Coordinates can be created from geodetic parameters (latitude, longitude, altitude) or from a Cartesian position vector. The altitude defaults to 0 (on the ellipsoid surface) if not specified.
Geodesic Distance¶
The geodesic_distance method computes the shortest path between two points along the surface of the WGS-84 ellipsoid, returning the distance in meters along with the initial and final headings of the path.
import satkit as sk
newyork = sk.itrfcoord(latitude_deg=40.7128, longitude_deg=-74.0060)
destinations = [
{'name': 'London', 'latitude_deg': 51.5072, 'longitude_deg': -0.1276},
{'name': 'Paris', 'latitude_deg': 48.8566, 'longitude_deg': 2.3522},
{'name': 'Toronto', 'latitude_deg': 43.6532, 'longitude_deg': -79.3832},
{'name': 'Tokyo', 'latitude_deg': 35.6763, 'longitude_deg': 139.65},
{'name': 'Sau Paulo', 'latitude_deg': -23.5558, 'longitude_deg': -46.6396}
]
for dest in destinations:
destcoord = sk.itrfcoord(latitude_deg=dest['latitude_deg'], longitude_deg=dest['longitude_deg'])
# Distance, start, and end heading along great circle to destination coordinate
dist, _heading_start, _heading_end = newyork.geodesic_distance(destcoord)
print(f'New York to {dest['name']} distance is {dist/1e3:.0f} km')
New York to London distance is 5585 km New York to Paris distance is 5853 km New York to Toronto distance is 551 km New York to Tokyo distance is 10876 km New York to Sau Paulo distance is 7658 km