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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
//! [`AssistData`] — bundle of the data resources every high-level entry
//! point needs: the JPL SPK [`Ephemeris`], and optionally an MPC
//! [`ObservatoryTable`] (which itself may carry an
//! [`EarthOrientation`](crate::earth_orientation::EarthOrientation) for
//! sub-mas observatory rotation).
//!
//! Replacing the old `(ephem, obs_table)` argument pair across the public
//! API with a single `&AssistData` argument keeps call sites short and
//! matches how real workflows load these resources: once at startup, all
//! together, held for the lifetime of the process.
use Ephemeris;
use crateObservatoryTable;
/// Bundle of the data resources the high-level `assist_*` functions need.
///
/// Minimal usage — propagation only:
///
/// ```no_run
/// # use assist_rs::{AssistData, Ephemeris};
/// # use std::path::Path;
/// # fn f() -> assist_rs::Result<()> {
/// let ephem = Ephemeris::from_paths(Path::new("de440.bsp"), Path::new("sb441-n16.bsp"))?;
/// let data = AssistData::new(ephem);
/// # Ok(())
/// # }
/// ```
///
/// With observatory support (needed for `Origin::Observatory(..)` queries
/// and for ground-based `Observer`s in `assist_generate_ephemeris`):
///
/// ```no_run
/// # use assist_rs::{AssistData, Ephemeris, ObservatoryTable};
/// # use std::path::Path;
/// # fn f() -> assist_rs::Result<()> {
/// let ephem = Ephemeris::from_paths(Path::new("de440.bsp"), Path::new("sb441-n16.bsp"))?;
/// let obs = ObservatoryTable::from_json(Path::new("obscodes_extended.json"))?;
/// let data = AssistData::new(ephem).with_observatory(obs);
/// # Ok(())
/// # }
/// ```
///
/// With Earth-orientation precision for ground observatories, attach the
/// EOP kernels to the observatory table before bundling:
///
/// ```no_run
/// # use assist_rs::{AssistData, Ephemeris, ObservatoryTable};
/// # use assist_rs::earth_orientation::EarthOrientation;
/// # use std::path::Path;
/// # fn f() -> Result<(), Box<dyn std::error::Error>> {
/// # let ephem = Ephemeris::from_paths(Path::new("de440.bsp"), Path::new("sb441-n16.bsp"))?;
/// let eo = EarthOrientation::from_paths(&[Path::new("earth_latest_high_prec.bpc")])?;
/// let obs = ObservatoryTable::from_json(Path::new("obscodes_extended.json"))?
/// .with_earth_orientation(eo);
/// let data = AssistData::new(ephem).with_observatory(obs);
/// # Ok(())
/// # }
/// ```