コンテンツにスキップ

HorizonsTable

このコンテンツはまだ日本語訳がありません。

Defined in: horizons.rs:49

Available on crate feature alloc only.

pub struct HorizonsTable

A parsed Horizons vector table with Hermite interpolation support.

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.


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.


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 std only.

Load a Horizons CSV table from a file on disk.


fn samples(&self) -> &[HorizonsSample]

All samples, in ascending epoch order.


fn len(&self) -> usize

Number of samples in the table.


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).


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.


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.