tritons 0.0.3

Triton celestial simulation crate for the MilkyWay SolarSystem workspace
Documentation
#[test]
fn dust_impact_ejecta() {
    let d = tritons::environment::dust::DustEnvironment::impact_ejecta();
    assert!(d.lofting_probability > 0.0);
    assert!(d.adhesion_risk(100.0) > 0.0);
}

#[test]
fn dust_settled_lower() {
    let e = tritons::environment::dust::DustEnvironment::impact_ejecta();
    let s = tritons::environment::dust::DustEnvironment::settled_regolith();
    assert!(s.adhesion_risk(0.0) < e.adhesion_risk(0.0));
}

#[test]
fn radiation_nominal() {
    let r = tritons::environment::radiation::RadiationEnvironment::nominal_surface();
    assert!(r.effective_daily_dose_msv() > 0.0);
}

#[test]
fn radiation_sheltered_lower() {
    let nom = tritons::environment::radiation::RadiationEnvironment::nominal_surface();
    let shel = tritons::environment::radiation::RadiationEnvironment::sheltered(2.0);
    assert!(shel.effective_daily_dose_msv() < nom.effective_daily_dose_msv());
}

#[test]
fn annual_dose() {
    let r = tritons::environment::radiation::RadiationEnvironment::nominal_surface();
    assert!(tritons::environment::radiation::annual_crew_dose_msv(r) > 0.0);
}

#[test]
fn thermal_in_range() {
    let t = tritons::environment::thermal::ThermalEnvironment {
        local_time_hours: 141.0 * 0.5,
        latitude_deg: 0.0,
        shadowed: false,
    };
    let temp = t.surface_temperature_k();
    assert!((35.0..=42.0).contains(&temp));
}

#[test]
fn shadow_reduces_temp() {
    let lit = tritons::environment::thermal::ThermalEnvironment {
        local_time_hours: 141.0 * 0.5,
        latitude_deg: 0.0,
        shadowed: false,
    };
    let dark = tritons::environment::thermal::ThermalEnvironment {
        local_time_hours: 141.0 * 0.5,
        latitude_deg: 0.0,
        shadowed: true,
    };
    assert!(dark.surface_temperature_k() <= lit.surface_temperature_k());
}

#[test]
fn thermal_cycle_span() {
    assert!(tritons::environment::thermal::thermal_cycle_span_k(0.0) > 0.0);
}