HorizonsTable
Defined in: horizons.rs:49
Available on crate feature
alloconly.
pub struct HorizonsTableA parsed Horizons vector table with Hermite interpolation support.
Methods
Section titled “Methods”fetch_vector_table()
Section titled “fetch_vector_table()”fn fetch_vector_table(target: &str, center: &str, start: &Epoch, stop: &Epoch, step: &str, max_age: [Option<Duration>](https://doc.rust-lang.org/std/option/enum.Option.html)) -> [Result<Self, HorizonsError>](https://doc.rust-lang.org/std/result/enum.Result.html)
Fetch a vector table from JPL Horizons with disk caching.
target— Horizons target ID (e.g."-1023"for Artemis 1,"301"for Moon).center— coordinate center in Horizons syntax (e.g."500@399"for Earth geocenter).start/stop— epoch range bracketing the ephemeris.step— Horizons STEP_SIZE string (e.g."10m","1h","1d").max_age— disk-cache max age; defaults to 7 days.
The response is cached at
~/.cache/orts/horizons/<hash>.csv so repeat calls are free.
parse_csv()
Section titled “parse_csv()”fn parse_csv(text: &str) -> [Result<Self, HorizonsError>](https://doc.rust-lang.org/std/result/enum.Result.html)
Parse a Horizons CSV vector-table string.
The input must contain $$SOE / $$EOE markers bracketing CSV rows
of the form JDTDB, Calendar, X, Y, Z, VX, VY, VZ.
from_file()
Section titled “from_file()”fn from_file(path: impl [AsRef<std::path::Path>](https://doc.rust-lang.org/std/convert/trait.AsRef.html)) -> [Result<Self, HorizonsError>](https://doc.rust-lang.org/std/result/enum.Result.html)
Available on crate feature
stdonly.
Load a Horizons CSV table from a file on disk.
samples()
Section titled “samples()”fn samples(&self) -> &[HorizonsSample]
All samples, in ascending epoch order.
fn len(&self) -> usize
Number of samples in the table.
is_empty()
Section titled “is_empty()”fn is_empty(&self) -> bool
Returns true if the table has no samples (parser guarantees this
cannot be constructed from parse_csv — reserved for defensive use).
date_range()
Section titled “date_range()”fn date_range(&self) -> [Option<(Epoch, Epoch)>](https://doc.rust-lang.org/std/option/enum.Option.html)
First and last epochs in the table, if any.
interpolate()
Section titled “interpolate()”fn interpolate(&self, epoch: &Epoch) -> [Option<HorizonsSample>](https://doc.rust-lang.org/std/option/enum.Option.html)
Interpolate state at epoch using cubic Hermite interpolation with
position and velocity at the bracketing samples.
Returns None if epoch is outside the table’s range.