CCSDS 502.0-B-3 Orbit Ephemeris Message parser and interpolator
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Use shared Vec3.t in ocaml-ocm and ocaml-oem

Replace duplicate vec3 type and pp_vec3 with shared Vec3.t and Vec3.pp.

+7 -16
+1 -1
lib/dune
··· 1 1 (library 2 2 (name oem) 3 3 (public_name oem) 4 - (libraries ptime fmt)) 4 + (libraries vec3 ptime fmt))
+5 -8
lib/oem.ml
··· 9 9 (* Types *) 10 10 (* ------------------------------------------------------------------ *) 11 11 12 - type vec3 = { x : float; y : float; z : float } 13 - type state_vector = { epoch : Ptime.t; pos : vec3; vel : vec3 } 12 + type state_vector = { epoch : Ptime.t; pos : Vec3.t; vel : Vec3.t } 14 13 type covariance = { epoch : Ptime.t; ref_frame : string; matrix : float array } 15 14 16 15 type metadata = { ··· 265 264 let sv = 266 265 { 267 266 epoch; 268 - pos = { x = a.(0); y = a.(1); z = a.(2) }; 269 - vel = { x = a.(3); y = a.(4); z = a.(5) }; 267 + pos = Vec3.v a.(0) a.(1) a.(2); 268 + vel = Vec3.v a.(3) a.(4) a.(5); 270 269 } 271 270 in 272 271 vectors := sv :: !vectors; ··· 450 449 (* Pretty-printing *) 451 450 (* ------------------------------------------------------------------ *) 452 451 453 - let pp_vec3 ppf v = Fmt.pf ppf "(%.3f, %.3f, %.3f)" v.x v.y v.z 454 - 455 452 let pp_state_vector ppf (sv : state_vector) = 456 - Fmt.pf ppf "%a pos=%a vel=%a" (Ptime.pp_rfc3339 ()) sv.epoch pp_vec3 sv.pos 457 - pp_vec3 sv.vel 453 + Fmt.pf ppf "%a pos=%a vel=%a" (Ptime.pp_rfc3339 ()) sv.epoch Vec3.pp sv.pos 454 + Vec3.pp sv.vel 458 455 459 456 let pp_header ppf h = 460 457 Fmt.pf ppf "OEM v%s by %s (%s)" h.version h.originator h.creation_date
+1 -7
lib/oem.mli
··· 9 9 10 10 (** {1 Types} *) 11 11 12 - type vec3 = { x : float; y : float; z : float } 13 - (** Position or velocity vector (km or km/s). *) 14 - 15 - type state_vector = { epoch : Ptime.t; pos : vec3; vel : vec3 } 12 + type state_vector = { epoch : Ptime.t; pos : Vec3.t; vel : Vec3.t } 16 13 (** A single ephemeris data point: position and velocity at an epoch. *) 17 14 18 15 type covariance = { epoch : Ptime.t; ref_frame : string; matrix : float array } ··· 89 86 (** [object_id oem] is the object ID from the first segment. *) 90 87 91 88 (** {1 Pretty-printing} *) 92 - 93 - val pp_vec3 : vec3 Fmt.t 94 - (** [pp_vec3] pretty-prints a 3D vector. *) 95 89 96 90 val pp_state_vector : state_vector Fmt.t 97 91 (** [pp_state_vector] pretty-prints a state vector. *)