- OCaml 79%
- Java 21%
- Shell <1%
cdm #
Conjunction Data Messages (CCSDS 508.0-B-1) for OCaml.
When two objects in orbit are predicted to pass close to each other, a
screening service such as Space-Track or TraCSS sends the satellite operators
a Conjunction Data Message (CDM). It gives the time of closest approach (TCA),
the miss distance, the state and covariance of both objects and, often, a
probability of collision. cdm reads CDMs in the three formats operators
receive: KVN (the CCSDS Keyword = Value Notation), JSON-ST (the Space-Track
JSON format) and the CSV of the TraCSS conjunction assessment verification
dataset. All three produce the same Cdm.t.
Installation #
Install with opam:
$ opam install cdm
If opam cannot find the package, it may not yet be released in the public
opam-repository. Add the overlay repository, then install it:
$ opam repo add samoht https://tangled.org/gazagnaire.org/opam-overlay.git
$ opam update
$ opam install cdm
Usage #
(* Parse CDMs from a TraCSS CSV file *)
let dump_csv path =
match Cdm.Csv.of_file path with
| Ok cdms ->
List.iter (fun (cdm : Cdm.t) ->
Printf.printf "TCA: %s Pc: %e miss: %.3f km\n"
(Cdm.tca cdm) (Cdm.pc cdm) cdm.miss_distance)
cdms
| Error e -> Fmt.epr "%a\n" Cdm.pp_error e
(* Parse a single CDM from KVN format *)
let parse_kvn kvn_string = Cdm.Kvn.of_string kvn_string
API #
Cdm.tis one conjunction event: the two objectsobj1andobj2, theprobabilityof collision, themiss_distancein km, the TCA asepoch, and the CCSDS header and relative metadata when the format carries them.Cdm.object_dataholds the data of one object: its state vector, its position covariance, and its metadata, orbit determination and physical parameters.Cdm.state_vectoris a J2000 position in km and velocity in km/s, andCdm.covariancethe upper triangle of the 3x3 position covariance in the RTN frame, in m^2. J2000 (also EME2000) is an Earth-centred inertial frame: its origin is the Earth's centre, its z axis the Earth's mean rotation axis and its x axis the mean vernal equinox, both as they were at noon on 1 January 2000, so the axes do not turn with the Earth. RTN is the frame that moves with the object: R points radially away from the Earth, N along the orbit's angular momentum, and T completes the triad, close to the direction of travel.Cdm.Csvreads the TraCSS CSV (of_file,of_string, andfold_channelfor a file too large to hold in memory).Cdm.Json_streads Space-Track JSON (of_string,of_single).Cdm.Kvnreads CCSDS KVN (of_string).Cdm.tca,Cdm.tca_ptimeandCdm.pcreturn the TCA and the probability of collision.
A CDM read from CSV carries no CCSDS header or metadata, so those fields are
None.
Licence #
ISC. See LICENSE.md.