Physics guide
The single-scattering sky
If every photon reaching the ground has been scattered at most once, the diffuse radiance from a direction with zenith-angle cosine |μ| is (Chapter 12, "RTE for Single Scattering")
I↓(τ*) = F₀ ω̃ μ₀ p(cos Θ) [e^(−τ*/μ₀) − e^(−τ*/|μ|)] / [4π (μ₀ − |μ|)]
Sunlight is depleted on its way down, a fraction ω̃ p(Θ)/4π of what is lost per steradian is redirected toward the observer, and that light is depleted in turn on its way out along the line of sight. The equation assumes that ω̃ and p don't change with height, so the app mixes the haze evenly through the air. The left picture and the dashed curves are this equation and nothing else. When the line of sight is as steep as the sun (|μ| = μ₀), numerator and denominator both vanish; the app uses the limit there, F₀ ω̃ p τ* e^(−τ*/μ₀)/(4π μ₀).
Θ is the angle between the sunbeam and the line of sight's reversed direction, so cos Θ = μ₀|μ| + √(1 − μ₀²)√(1 − μ²) cos Δφ, with Δφ the azimuth of the line of sight from the sun's. Looking toward the sun samples small Θ; looking at the sky opposite it, near the horizon, samples Θ up to 180° minus twice the sun's elevation.
The full sky
The full calculation follows every photon through any number of scatterings, and through any number of reflections from the ground. It splits the radiance by order: light scattered once, light scattered twice, and so on, each order computed from the one before and summed until the remainder is negligible. The once-scattered part is the same equation as on the left. What the right picture adds, and what "Multiple scattering only" shows by itself, is everything from the second order on.
The method is "successive orders of scattering" (Chapter 14 introduces the multiple-scattering problem). It agrees with an independent discrete-ordinate calculation to about 1 % above 6° elevation. Like the single-scattering equation it treats the atmosphere as flat (plane-parallel), which fails within a few degrees of the horizon and for a sun within a few degrees of it.
Why single scattering fails in the blue
The chance that a once-scattered photon is scattered again before it leaves depends on the medium, not on where we stand to look: it is set by ω̃τ* (Chapter 12, "RTE for Single Scattering"). For clean air τ* = τ_R ≈ 0.008 λ⁻⁴·⁰⁹ (λ in µm), about 0.05 at 0.65 µm but 0.21 at 0.45 µm and 0.36 at 0.40 µm. The "Validity" card colours ω̃τ* green below 0.05, amber to 0.2 and red above, and the next card shows the actual share of the sky light that single scattering misses. As a rough guide, ω̃τ* ≈ 0.05 leaves about 10 % to multiple scattering, and 0.2 about 30 %.
Because the missing light is largest at short wavelengths, multiple scattering makes the sky bluer as well as brighter. The ratio I(0.45)/I(0.65) on the zenith card shows how much.
Look also at the horizon. A long line of sight through the layer collects a lot of once-scattered light, so the single-scattering sky brightens toward the horizon. But in the blue, where τ* is largest, the horizon light is dimmed on its long way to the eye and replaced by light scattered many times, so the horizon turns whiter, and single scattering errs most in the low sky opposite a low sun. "Single ÷ full" maps this at the chosen wavelength.
Haze: whitening and the aureole
Aerosol optical thickness falls off slowly with wavelength, τ_a ∝ λ^(−α), with α (the Ångström exponent) between about 1 for mixed haze and 2 for fine smoke, against about 4 for air molecules. The app allows only such fine-mode haze; see "What this app leaves out". Adding haze therefore adds light at all colours nearly equally, and the sky turns whiter. Its phase function (here Henyey–Greenstein, with g typically 0.6 to 0.8) is strongly forward-peaked, so most of that light appears near the sun as a bright, white aureole, while the sky opposite the sun changes much less. With ω̃ < 1 the haze also absorbs, darkening the whole sky.
Haze also raises τ* at every wavelength, so even red light is no longer safely singly scattered once the haze is thick.
Visibility: contrast, not transmittance
Along a horizontal line of sight of length S in a uniform atmosphere, the radiance reaching the eye is a blend of the target's own radiance I(S) and the light scattered into the line of sight on the way (Chapter 12, "Haze and horizontal visibility"):
I(0) = I(S) t + (1 − t) J, t = e^(−βS)
The second term is the airlight. A perfectly black target has I(S) = 0 and appears with radiance (1 − t)J: the farther away, the brighter it gets. The horizon sky is the same blend at t ≈ 0, so its radiance is J itself, and the contrast of the black target against it, C = (J − I)/J, is exactly t. Haze does not dim distant targets so much as fill in the difference between them and their surroundings: the difference shrinks by the factor t whatever the target (the lower plot shows a bright target losing brightness while a dark one gains it, both heading for J).
Defining the visibility V as the distance at which C falls to a threshold Cmin gives Koschmieder's law, V = ln(1/Cmin)/β, about 3/β for the 5 % of the World Meteorological Organization's meteorological optical range, 3.9/β for Koschmieder's own 2 %. In this idealization the scattering properties ω̃ and p cancel in the contrast, so the tab's contrast curves and V depend only on β. They still set J, the brightness and colour of the airlight: a lower ω̃ (more of the extinction is absorption) or a phase function that sends less light toward the viewer makes the whole picture darker, and at one fixed exposure that looks like lower contrast although the relative contrast is unchanged.
When ω̃ and g do matter for visibility. The cancellation needs a black target seen against the horizon sky in a uniform atmosphere. Drop either condition and J no longer cancels. For a target of radiance It against a background of radiance Ib (a sunlit hillside, a runway, a building), the apparent contrast is t(Ib − It)/[t Ib + (1 − t)J]: a brighter airlight lowers it, so haze with high ω̃ and a strongly forward phase function (large g) reduces visibility most when you look toward the sun, and dark haze (low ω̃, such as smoke or soot) hurts less than its extinction suggests. The same happens when the line of sight is partly shaded or the haze is in layers, because J then varies along the path; and for lights at night, where what matters is how much of a point source's light is scattered into a halo. Meteorological optical range is by definition independent of them, which is why a station's reported visibility can differ from what a pilot or driver actually sees. This is why a two-way mirror and a dusty windshield, two cases with the same transmittance but very different visibility, behave so differently.
Airlight and the colour of distant things
The airlight is the horizon sky's colour, and each wavelength is blended on its own, with its own t. In clean air J is blue and the blue light of a distant target is removed fastest, so ridges at 20 to 50 km turn blue: their colour is almost pure airlight, (1 − t)J. In haze J is white or yellowish and all wavelengths fade together, so distant ridges turn grey-white. Looking toward the sun, forward scattering brightens J several-fold and bleaches the scene; looking away from it, J is darker, and the same haze hides less. The contrast is the same in every direction (it depends only on β), but the glare is not, which is the windshield on the way home into the setting sun.
How this tab gets β and J
The extinction coefficient at ground level is the column's optical thickness over a scale height: τ_R(λ)/8.4 km for air molecules (the height at which the density falls by e, which does not depend on surface pressure) plus τ_a(λ)/Ha for the haze, whose depth Ha you choose; τ_a follows the Ångström law of the sky tab. The visibility slider sets τ_a so that Koschmieder's law gives the visibility you choose, for that depth. Clean air alone gives about 270 km at 5 %, so larger values are clamped to that.
The airlight J is the horizon sky of the full multiple-scattering calculation for the same sun, haze and ground, in the direction you choose. At the horizon (μ → 0) the plane-parallel radiance is exactly the source function at the ground, which is what the book's path equation needs, so no separate calculation is wanted. It assumes that the haze that sets J along the line of sight is as thick as it is overhead.
Visibility depends on β, so the same τ_a confined to a shallower layer (smaller H_a) shortens it. J does not follow suit: the sky model mixes the haze evenly through the whole atmosphere, whereas a shallow dense layer would give a different airlight. The contrast curves and V are unaffected (they depend only on β), but for small H_a the brightness and colour of the landscape are approximate.
The ground
A bright surface such as snow reflects sunlight back up, and the air above it scatters part of that light down again. Every photon on that path has interacted at least twice, so the surface albedo has no effect at all on the single-scattering sky, while the full sky brightens, most of all near the horizon. The atmosphere and the ground act as one system (Chapter 14).
The sun's disc
The disc is a thousand to ten thousand times brighter than the sky a degree away, so no single exposure shows both. The fisheyes draw it as plain white, a little larger than life; the close-up shows it alone at a fixed exposure, so that both its colour and its dimming can be seen. Its light is the direct beam, sunlight times e^(−τ*/μ₀) at each wavelength: blue light is removed more than red, so a low sun, or one behind fine haze, is dimmer and redder.
The table gives that beam's irradiance on a surface facing the sun and on level ground (× sin of the elevation), for the visible band 0.40–0.70 µm and for broadband sunlight 0.3–4 µm. The broadband values extend the air's λ⁻⁴·⁰⁹ and the haze's Ångström law over the whole solar spectrum, but leave out absorption by water vapour, ozone and other gases, so real values are about 10–20 % lower. Light scattered by the haze into directions within the disc is not added: for fine haze it is about 0.01 % of the beam.
Colour
The sky is computed at 0.40, 0.45, …, 0.70 µm. Between those wavelengths I·λ⁴ is interpolated, because sky light is close to a λ⁻⁴ power law. The radiance relative to F₀ is multiplied by the solar spectrum at the top of the atmosphere (ASTM E-490), weighted by the CIE 1931 colour-matching functions, and converted to sRGB. The picture is white-balanced so that sunlight itself would look white, as a camera set to daylight does, and exposed on the sky's median brightness. Colours too saturated for a screen are pulled toward grey, and colours too bright for it toward white, which is why the low sky near the horizon tends to look washed out, as it does in a photograph. The sun's disc is drawn larger than life, in the colour of the transmitted beam.
What this app leaves out
- Ozone's absorption in the Chappuis band, which keeps the real twilight zenith blue. Without it the sky above a very low sun is paler than real.
- Polarization. The equations are written for intensity alone; the true Rayleigh phase function for unpolarized light is used, but the polarization it produces is not tracked (a few percent error in the full sky).
- The curvature of the Earth and refraction, so nothing here is right within a few degrees of the horizon or for a sun lower than about 3°.
- Vertical structure: the sky tab mixes the haze evenly through the air, though real haze sits mostly in the lowest kilometre or two. The visibility tab uses a haze depth only to turn the column optical thickness into an extinction coefficient at ground level.
- For visibility: black targets against the horizon sky only, in daylight, along a horizontal, homogeneous path. No ozone, gases or Earth's curvature (matters beyond tens of kilometres), no clouds or haze layers, no night-time visibility, which is judged from lights and obeys a different law. The sky drawn behind the ridges, a few degrees above the horizon, differs a little from J, so the farthest ridges do not vanish exactly as C = t says. The reported visibility at a weather station is a related but distinct quantity (discrete steps, capped at a maximum).
- Coarse particles: desert dust, sea salt and thin cirrus. Particles several micrometres across and larger have a sharp diffraction peak within a degree or two of the forward direction, which brightens the sun's disc and what a pyrheliometer reads beside it. A Henyey–Greenstein phase function has no such peak, so the app keeps to fine haze (α ≥ 0.8, g ≤ 0.8), for which it is a fair stand-in.
- Any wavelength dependence of the aerosol's g and ω̃, and the absorption of light by gases.