pub struct Ephemeris { /* private fields */ }Expand description
Owned ASSIST ephemeris data. Freed on drop.
Read-only after creation — safe to share across threads.
Implementations§
Source§impl Ephemeris
impl Ephemeris
Sourcepub fn from_paths(planets: &Path, asteroids: &Path) -> Result<Self>
pub fn from_paths(planets: &Path, asteroids: &Path) -> Result<Self>
Load ephemeris from SPK files.
Sourcepub fn as_ptr(&self) -> *const assist_ephem
pub fn as_ptr(&self) -> *const assist_ephem
Raw pointer to the underlying assist_ephem. Useful for direct FFI calls.
Returns a *const pointer because Ephemeris implements Sync on the
premise that the underlying data is read-only after construction. Call
.cast_mut() at the call site if the target FFI signature requires
*mut; that cast is the caller’s assertion of unique access.
Sourcepub fn jd_ref(&self) -> f64
pub fn jd_ref(&self) -> f64
Reference Julian date for the ephemeris (typically 2451545.0 = J2000.0 TDB).
Sourcepub fn set_jd_ref(&mut self, jd: f64)
pub fn set_jd_ref(&mut self, jd: f64)
Override the reference Julian date.
Requires &mut self, which prevents concurrent mutation when the
Ephemeris is shared across threads via Arc. Must be called before
any AssistSim is attached.
Sourcepub fn c_au_per_day(&self) -> f64
pub fn c_au_per_day(&self) -> f64
Speed of light in AU/day.
Sourcepub fn mjd_to_assist_time(&self, mjd_tdb: f64) -> f64
pub fn mjd_to_assist_time(&self, mjd_tdb: f64) -> f64
Convert MJD TDB to ASSIST simulation time (days from jd_ref).
ASSIST stores times as days offset from the ephemeris reference JD,
where JD = MJD + 2_400_000.5.
Sourcepub fn earth_radius_au(&self) -> f64
pub fn earth_radius_au(&self) -> f64
Earth equatorial radius in AU.
Sourcepub fn get_body_state(&self, body_id: i32, t: f64) -> Result<reb_particle>
pub fn get_body_state(&self, body_id: i32, t: f64) -> Result<reb_particle>
Get a solar system body’s state at time t (days from jd_ref).
Sourcepub fn get_body_state_array(&self, body_id: i32, t: f64) -> Result<[f64; 6]>
pub fn get_body_state_array(&self, body_id: i32, t: f64) -> Result<[f64; 6]>
Get a solar system body’s 6-element state [x, y, z, vx, vy, vz] at
time t (days from jd_ref). Convenience over Self::get_body_state
when the caller only needs the kinematic state, not the full
reb_particle (mass, hash, etc.).