use arika::epoch::Epoch;
#[derive(Debug, Clone)]
pub struct SpaceWeather {
pub f107_daily: f64,
pub f107_avg: f64,
pub ap_daily: f64,
pub ap_3hour_history: [f64; 7],
}
pub trait SpaceWeatherProvider: Send + Sync {
fn get(&self, epoch: &Epoch) -> SpaceWeather;
}
#[derive(Debug, Clone)]
pub struct ConstantWeather {
weather: SpaceWeather,
}
impl ConstantWeather {
pub fn new(f107: f64, ap: f64) -> Self {
Self {
weather: SpaceWeather {
f107_daily: f107,
f107_avg: f107,
ap_daily: ap,
ap_3hour_history: [ap; 7],
},
}
}
pub fn solar_min() -> Self {
Self::new(70.0, 4.0)
}
pub fn solar_moderate() -> Self {
Self::new(150.0, 15.0)
}
pub fn solar_max() -> Self {
Self::new(250.0, 50.0)
}
}
impl SpaceWeatherProvider for ConstantWeather {
fn get(&self, _epoch: &Epoch) -> SpaceWeather {
self.weather.clone()
}
}