pub fn diffuse_illuminance_ratio(
        p_water_content: Float,
        cos_zenit: Float,
        sky_brightness: Float,
        index: usize,
    ) -> Float {
        if index > 7 {
            panic!("Table 4 of Perez's paper has only 8 sky clearness categories (starting from 0)... received {}", index)
        }

        const TABLE: [(Float, Float, Float, Float); 8] = [
            (97.24, -0.46, 12.00, -8.91),
            (107.22, 1.15, 0.59, -3.95),
            (104.97, 2.96, -5.53, -8.77),
            (102.39, 5.59, -13.95, -13.90),
            (100.71, 5.94, -22.75, -23.74),
            (106.42, 3.83, -36.15, -28.83),
            (141.88, 1.90, -53.24, -14.03),
            (152.23, 0.35, -45.27, -7.98),
        ];

        // Return
        TABLE[index].0
            + TABLE[index].1 * p_water_content
            + TABLE[index].2 * cos_zenit
            + TABLE[index].3 * sky_brightness.ln()
    }
/// Calculates the diffuse illuminance/diffuse radiance ratio
/// according to Equation 7 and Table 4 of Perez et al. 1990
Calculates the diffuse illuminance/diffuse radiance ratio
according to Equation 7 and Table 4 of Perez et al. 1990
Calculates the diffuse illuminance / diffuse radiance ratio according to Equation 7 and Table 4 of Perez et al . 1990
pub fn diffuse_illuminance_ratio(
        p_water_content: Float,
        cos_zenit: Float,
        sky_brightness: Float,
        index: usize,
    ) -> Float {
        if index > 7 {
            panic!("Table 4 of Perez's paper has only 8 sky clearness categories (starting from 0)... received {}", index)
        }
        const TABLE: [(Float, Float, Float, Float); 8] = [
            (97.24, -0.46, 12.00, -8.91),
            (107.22, 1.15, 0.59, -3.95),
            (104.97, 2.96, -5.53, -8.77),
            (102.39, 5.59, -13.95, -13.90),
            (100.71, 5.94, -22.75, -23.74),
            (106.42, 3.83, -36.15, -28.83),
            (141.88, 1.90, -53.24, -14.03),
            (152.23, 0.35, -45.27, -7.98),
        ];
        // Return
        TABLE[index].0
            + TABLE[index].1 * p_water_content
            + TABLE[index].2 * cos_zenit
            + TABLE[index].3 * sky_brightness.ln()
    }
pub fn diffuse_illuminance_ratio ( p_water_content : Float , cos_zenit : Float , sky_brightness : Float , index : usize , ) -> Float { if index > 7 { panic ! ( " " index ) } const TABLE : [ ( Float , Float , Float , Float ) ; 8 ] = [ ( 97.24 , - 0.46 , 12.00 , - 8.91 ) , ( 107.22 , 1.15 , 0.59 , - 3.95 ) , ( 104.97 , 2.96 , - 5.53 , - 8.77 ) , ( 102.39 , 5.59 , - 13.95 , - 13.90 ) , ( 100.71 , 5.94 , - 22.75 , - 23.74 ) , ( 106.42 , 3.83 , - 36.15 , - 28.83 ) , ( 141.88 , 1.90 , - 53.24 , - 14.03 ) , ( 152.23 , 0.35 , - 45.27 , - 7.98 ) , ] ; // Return TABLE [ index ] . 0 + TABLE [ index ] . 1 * p_water_content + TABLE [ index ] . 2 * cos_zenit + TABLE [ index ] . 3 * sky_brightness . ln ( ) }
Calculates the diffuse illuminance/diffuse radiance ratio
according to Equation 7 and Table 4 of Perez et al.
Calculates the diffuse illuminance / diffuse radiance ratio according to Equation 7 and Table 4 of Perez et al .
p_water_content
Float
cos_zenit
Float
sky_brightness
Float
index
usize
p_water_content
Float
cos_zenit
Float
sky_brightness
Float
index
usize