Skip to content

CssiData

Defined in: cssi.rs:83

pub struct CssiData

Parsed CSSI space weather data, sorted by date.

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.


fn is_empty(&self) -> bool

Whether the dataset is empty.


fn date_range(&self) -> [Option<(Epoch, Epoch)>](https://doc.rust-lang.org/std/option/enum.Option.html)

Date range as (first_epoch, last_epoch).


fn records(&self) -> &[CssiDailyRecord]

Access the underlying records.


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.