Orbit Data Messages (CCSDS 502.0-B-3)
0
fork

Configure Feed

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

ocaml-odm: rewrite README example to typecheck

The block had a missing [in] after [Odm.epoch_range seg] (running
the [let] phrase into [Printf.printf]) and referenced unbound
[segment] / [unix_timestamp]. Wrap each flow as a function ([report
path], [position_at ~segment ~unix_timestamp]), switch [Printf.printf]
to [Fmt.pr], and add [fmt] to the mdx libraries.

+14 -10
+13 -9
README.md
··· 29 29 ## Usage 30 30 31 31 ```ocaml 32 - match Odm.of_kvn_file "ephemeris.oem" with 33 - | Ok oem -> 34 - List.iter (fun seg -> 35 - let (start, stop) = Odm.epoch_range seg Printf.printf "Segment: %s to %s (%d points)\n" 36 - start stop (Array.length (Odm.state_vectors seg)) 37 - ) (Odm.segments oem) 38 - | Error e -> Fmt.epr "%a\n" Odm.pp_error e 32 + let report path = 33 + match Odm.of_kvn_file path with 34 + | Ok oem -> 35 + List.iter 36 + (fun seg -> 37 + let start, stop = Odm.epoch_range seg in 38 + Fmt.pr "Segment: %s to %s (%d points)@." start stop 39 + (Array.length (Odm.state_vectors seg))) 40 + (Odm.segments oem) 41 + | Error e -> Fmt.epr "%a@." Odm.pp_error e 39 42 40 - (* Interpolate position at a given time *) 41 - let pos = Odm.interpolate segment unix_timestamp 43 + (* Interpolate position at a given time. *) 44 + let position_at ~segment ~unix_timestamp = 45 + Odm.interpolate segment unix_timestamp 42 46 ``` 43 47 44 48 ## API Overview
+1 -1
dune
··· 4 4 5 5 (mdx 6 6 (files README.md) 7 - (libraries odm)) 7 + (libraries odm fmt))