Function spice::core::spkpos[][src]

pub fn spkpos<S: Into<String>>(
    target: S,
    time: f64,
    frame: S,
    aberration_correction: S,
    observer: S
) -> (Vector<f64>, f64)

Get the position and one way light time of target with respect to observer in the reference frame at time with optional aberration correction.

Example

let mut kernel = spice::Kernel::new("rsc/data/hera_PO_EMA_2024.tm")?;
let time = spice::ephemeris_from_date("2027-MAR-23 16:00:00");
let (position, light_time) = spice::position("DIMORPHOS", time, "J2000", "NONE", "HERA");

// position: [18.62639796759623  21.05444863563425 -7.136416860555217]
// light_time: 0.00009674284381011395

kernel.unload()?;