coordinate#
Astrodynamics coordinate frame transforms.
Conversions between standard reference frames used in satellite operations: TEME (SGP4 output), ECEF (Earth-fixed), J2000/EME2000 (inertial), and geodetic (lat/lon/alt). Includes WGS-84 constants and GMST computation.
Installation#
opam install coordinate
Usage#
(* Convert SGP4 TEME output to geodetic coordinates *)
let gmst = Coordinate.gmst_of_unix unix_time in
let ecef = Coordinate.teme_to_ecef ~gmst teme_pos in
let geo = Coordinate.ecef_to_geodetic ecef in
Printf.printf "Lat: %.4f Lon: %.4f Alt: %.1f km\n" geo.lat geo.lon geo.alt
API Overview#
type vec3-- Cartesian position/velocity vector (km or km/s)type geodetic--lat(deg),lon(deg),alt(km)earth_radius,earth_mu,earth_j2-- WGS-84 constantsgmst_of_unix,gmst-- Greenwich Mean Sidereal Time (IAU 1982)teme_to_ecef,ecef_to_teme-- TEME/ECEF rotation via GMSTj2000_to_ecef,ecef_to_j2000-- J2000/ECEF rotationecef_to_geodetic-- Bowring's iterative method on WGS-84 ellipsoidgeodetic_to_ecef-- Geodetic to ECEFteme_to_geodetic-- TEME to geodetic (convenience)
License#
ISC