-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdebugh.ml
51 lines (39 loc) · 1.36 KB
/
debugh.ml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
(*
For debugging purposes use this command line (and change astro_utils.ml from open Cohttp_lwt_jsoo to open Cohttp_lwt_unix
ocamlfind ocamlmktop -package yojson,cohttp,lwt_ppx,unix,xml-light,cohttp-lwt-unix,cohttp -linkpkg -thread altaz.ml astro_utils.ml horizons.ml debugh.ml -o debugh
*)
open Cohttp_lwt_unix
open Altaz
open Lwt.Infix
open Horizons;;
open Printf;;
type target_category =
| SolarSystem
| Comets
| DeepSky
| Horizons
| NgcCatalog
| RecentTargets
type target_info = {
name: string;
ra: float;
dec: float;
mag: float;
desc: string;
category: target_category;
debug: string;
}
let dbgxml = ref (Xml.PCData "")
let show_info = print_endline
let search_text = try Sys.getenv "ID" with _ -> "599"
let callback body rslt = Array.iteri (fun ix itm -> Printf.printf "\"%s\" " (match ix with
| 1 -> (Altaz.hms_of_float (float_of_string itm))
| 2 -> (Altaz.dms_of_float (float_of_string itm))
| 3 -> (Altaz.dms_of_float (float_of_string itm))
| 4 -> (Altaz.dms_of_float (float_of_string itm))
| 5 -> (Altaz.dms_of_float (float_of_string itm))
| _ -> itm)) rslt; print_endline body
let tasks = horizons' show_info callback search_text 2460662.983
let run () =
Lwt_main.run tasks
let _ = run()