コンテンツにスキップ

HorizonsTable

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

Defined in: horizons.rs:47

pub struct HorizonsTable

A parsed Horizons vector table with Hermite interpolation support.

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)

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.