CssiData
Defined in: cssi.rs:83
pub struct CssiDataParsed CSSI space weather data, sorted by date.
Methods
Section titled “Methods”parse()
Section titled “parse()”fn parse(text: &str) -> [Result<Self, CssiParseError>](https://doc.rust-lang.org/std/result/enum.Result.html)
Parse CSSI space weather data from text content.
Accepts the full content of SW-Last5Years.txt or SW-All.txt. Parses OBSERVED and DAILY_PREDICTED sections. Records are sorted by date after parsing; duplicates from overlapping sections are resolved in favor of OBSERVED data.
fn len(&self) -> usize
Number of daily records.
is_empty()
Section titled “is_empty()”fn is_empty(&self) -> bool
Whether the dataset is empty.
date_range()
Section titled “date_range()”fn date_range(&self) -> [Option<(Epoch, Epoch)>](https://doc.rust-lang.org/std/option/enum.Option.html)
Date range as (first_epoch, last_epoch).
records()
Section titled “records()”fn records(&self) -> &[CssiDailyRecord]
Access the underlying records.
truncate_after()
Section titled “truncate_after()”fn truncate_after(&self, epoch: &Epoch) -> Self
Return a new CssiData containing only records up to (and including)
the given epoch’s calendar day.
Useful for simulating “what data was available at time T” by discarding
future observations. When used with CssiSpaceWeather in Clamp mode,
queries after the cutoff will repeat the last available day’s values.