ioss 0.0.3

Io celestial simulation crate for the MilkyWay SolarSystem workspace
Documentation
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct SurfaceCharging {
    pub local_time_hours: f64,
    pub plasma_density_cm3: f64,
    pub photoelectron_current_ua_m2: f64,
}

impl SurfaceCharging {
    pub fn dayside() -> Self {
        Self {
            local_time_hours: 21.0,
            plasma_density_cm3: 3.5,
            photoelectron_current_ua_m2: 0.6,
        }
    }
    pub fn nightside() -> Self {
        Self {
            local_time_hours: 0.0,
            plasma_density_cm3: 1.2,
            photoelectron_current_ua_m2: 0.0,
        }
    }
    pub fn surface_potential_v(&self) -> f64 {
        let diurnal_bias = if (10.0..=32.0).contains(&self.local_time_hours) {
            5.0
        } else {
            -50.0
        };
        diurnal_bias + self.photoelectron_current_ua_m2 * 3.0 - self.plasma_density_cm3 * 8.0
    }
    pub fn dust_lofting_risk(&self) -> f64 {
        (self.surface_potential_v().abs() / 100.0).clamp(0.0, 1.0)
    }
}