SkyModel

from acron.atmosphere import SkyModel
class SkyModel

Bases:

Bases: TypedReferenceCount

A planet’s air as three media (Hillaire 2020, after Bruneton & Neyret 2008), and its CPU light model: Rayleigh-scattering molecules and Mie-scattering aerosols, each thinning exponentially with height, and an ozone layer that only absorbs (a tent profile). Units are the shaders’: kilometres and 1/km. The defaults are the Earth of Hillaire’s paper.

transmittance() is the colour of the sunlight (or moonlight) after it crossed the air to a point, for a DirectionalLight; sky_irradiance() a rough irradiance of a horizontal surface by the sky (single scattering over a spread of directions, plus 40 % for the higher orders), for an AmbientLight. The native twin of acron.sky’s Atmosphere, computed in double precision; a default sky_irradiance() takes some 50 us.

Inheritance diagram

digraph inheritance705e798c23 { bgcolor=transparent; rankdir=BT; size="8.0, 12.0"; "DTOOL_SUPER_BASE" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style=""]; "ReferenceCount" [URL="acron.core.ReferenceCount.html#acron.core.ReferenceCount",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "DTOOL_SUPER_BASE" -> "ReferenceCount" [arrowsize=0.75,style=""]; "SkyModel" [URL="acron.atmosphere.SkyModel.html#acron.atmosphere.SkyModel",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "TypedReferenceCount" -> "SkyModel" [arrowsize=0.75,style=""]; "TypedObject" [URL="acron.core.TypedObject.html#acron.core.TypedObject",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "DTOOL_SUPER_BASE" -> "TypedObject" [arrowsize=0.75,style=""]; "TypedReferenceCount" [URL="acron.core.TypedReferenceCount.html#acron.core.TypedReferenceCount",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "TypedObject" -> "TypedReferenceCount" [arrowsize=0.75,style=""]; "ReferenceCount" -> "TypedReferenceCount" [arrowsize=0.75,style=""]; }
__init__()

The Earth’s air (Hillaire 2020).

Any air: radii and scale heights in km, coefficients in 1/km.

extinction()

The extinction (1/km, rgb) at a height (km above the ground).

static get_class_type()
get_ground_albedo()
get_ground_radius()
get_mie_absorption()
get_mie_g()
get_mie_scale_height()
get_mie_scattering()
get_ozone_absorption()
get_ozone_centre()
get_ozone_width()
get_rayleigh_scale_height()
get_rayleigh_scattering()
get_top_radius()
property ground_albedo → float
property ground_radius → float
property mie_absorption → float
property mie_g → float
property mie_scale_height → float
property mie_scattering → float
property ozone_absorption → LVecBase3d
property ozone_centre → float
property ozone_width → float
ray_to_top()

The distance (km) from height_km along cos_zenith to the top of the air, or -1 when the ray meets the ground first.

property rayleigh_scale_height → float
property rayleigh_scattering → LVecBase3d
set_ground_albedo()
set_ground_radius()
set_mie_absorption()
set_mie_g()
set_mie_scale_height()
set_mie_scattering()
set_ozone_absorption()
set_ozone_centre()
set_ozone_width()
set_rayleigh_scale_height()
set_rayleigh_scattering()
set_top_radius()
sky_irradiance()

A rough irradiance (rgb) the sky gives a horizontal surface at height_km under a sun in the direction sun_up (z up) of the given illuminance: single scattering summed over directions upward directions (a golden spiral, uniform in solid angle) of steps samples each (the sunlight to each sample a 12-step transmittance), times 1.4 for the higher orders.

sky_irradiance() for a white sun of this illuminance.

property top_radius → float
transmittance()

How much light (rgb, 0..1) gets from the top of the air down to a point height_km up, arriving from cos_zenith (1: straight down from overhead); zero when the planet is in the way. steps steps crowded round the ray’s lowest point (optical_depth_d()).

with_weather()

This air with haze times the aerosols (1: clear) and humidity 0..1 (wet aerosols scatter more and absorb less: hazier, whiter); haze_height >= 0 overrides the aerosols’ scale height.