About Blue Sky
Why is the sky blue, and not violet? Why are sunsets red, clouds white and far-off hills blue, and why is it the other way round on Mars? Every colour on this page is worked out, not painted: the page follows sunlight of the measured spectrum through the air, works out how much of each colour is scattered towards you and how much is lost on the way, and turns the light that reaches you into a colour using the CIE's standard tables of how the eye responds to each wavelength.
THE SKY opens on the CAMERA view, looking towards the sun the way a photo would; WHOLE SKY shows all of it round you, with the sun in the middle and the sky behind you at both edges. Drag the sun up and down (or use the slider, or ↑ and ↓), anywhere on the sky to see the spectrum of that patch, and press START to watch the sun go down (PAUSE stops it where it is and RESUME carries on). The chart shows sunlight above the air, the sunlight that reaches you, and the light from the patch of sky you picked, each scaled to its own peak. HAZE sets how much haze there is and KIND what it is made of: city haze, sea air (mostly sea salt), desert dust or smoke from fires, each a different mix of particle sizes that scatter and absorb the colours differently. VIEW: CAMERA (the default), a picture 8°, 20°, 45° or 70° across aimed at the sun's side of the sky with the horizon a quarter of the way up, the way sunsets are photographed. Most sunset photos are zoomed in further than they look: the sun is always half a degree across, so a sun a tenth of the picture's width means the whole picture is only about 5° of sky, all of it inside the glow round the sun. Try 8° with the sun a degree or two up. Untick OZONE after sunset to see what the ozone layer does to the twilight sky. EYES ADJUST lets the picture brighten as the light fades, as your eyes do (in the camera, it is the camera's automatic exposure); untick it to keep the setting for daylight.
THE TANK is the classroom demonstration: a lamp shines along a tank of water with a little milk in it. From the side the beam looks bluish; looking down the tank, the lamp looks orange. Change how much milk and how big the particles are: tiny ones scatter blue far more than red, big ones (like cloud droplets) scatter every colour about the same, which is why clouds are white.
FAR HILLS: hills further away look bluer and paler, because the air between you and them scatters blue sunlight into your eye while it dims the hill's own light. Snow on a far peak looks warmer than near snow for the opposite reason: its bright light loses more blue than red on the way.
POLARISED is the whole sky seen from below, as through a fisheye lens, with the sun low in the south. Light scattered at right angles to the sun's rays is the most polarised, so a band 90° from the sun darkens when you turn a polarising filter the right way (like polarised sunglasses tilted). HAZE lowers the polarisation, as haze does in real skies. Tick SHOW THE PATTERN for the direction of the polarisation across the sky, the pattern bees use.
MARS uses the same sums for Mars: a thin carbon-dioxide air, less than one-hundredth of Earth's pressure, and fine reddish dust. The day sky comes out butterscotch and the sky round the setting sun blue, as the rovers' cameras have seen.
THE STORY
John Tyndall showed in the 1860s that a beam of light through a fine mist of particles looks blue from the side, and thought the sky's blue might come from tiny particles in the air. Lord Rayleigh worked out the law in 1871: particles much smaller than the wavelength scatter light in proportion to one over the wavelength to the fourth power, so violet light at 400 nm is scattered about 9 times as much as deep red at 700 nm. In 1899 he showed that the molecules of the air themselves are enough to make the sky blue, no dust needed; Einstein and Smoluchowski later explained the scattering through the tiny jostling ups and downs in the air's density. Gustav Mie published the full theory for spheres of any size in 1908.
The polarisation of skylight was noticed by François Arago in 1809. Karl von Frisch showed in the 1940s that honeybees use the pattern of polarised light in a patch of blue sky to find their way. That Viking sailors used a "sunstone" (a crystal such as Iceland spar) to find the sun in overcast skies is a hypothesis, put forward by the Danish archaeologist Thorkild Ramskou in 1967; no sunstone has been found in a Viking site, though a calcite crystal was found in the wreck of an English ship of 1592 near Alderney.
Edward Hulburt showed in 1953 that the zenith stays blue during twilight because of the ozone layer: with sunlight crossing the high air almost sideways, ozone's Chappuis band takes out orange and yellow light. Without ozone the twilight zenith would be a pale yellowish grey.
On Mars, the Viking landers in 1976 sent back the first colour pictures from the surface, and a pinkish-tan sky. Pathfinder in 1997, Spirit in 2005 and Curiosity since have photographed blue sunsets: Curiosity's picture of the sun setting at Gale crater, taken in April 2015, is the best known.
HOW IT WORKS
Sunlight: the ASTM G173-03 spectrum of sunlight above the air, averaged over each 10 nm band from 380 to 780 nm. Air: the scattering cross-section and optical depth of Bodhaine and others (1999): straight up from sea level, 0.36 at 400 nm, 0.097 at 550 nm and 0.036 at 700 nm, with the air thinning by a factor of e every 8.4 km. Ozone: 300 Dobson units in a layer peaking at 25 km, with the measured absorption of Serdyuchenko and others (2014). Haze: HAZE is the haze's optical depth at 550 nm, straight up: CLEAN 0.05, USUAL 0.15, HAZY 0.4, VERY HAZY 1.0 (dust storms and smoke can go well past 1). Each KIND is a spread of particle sizes and a refractive index measured from the ground by the AERONET network of sun photometers (Dubovik and others, 2002): city haze from Paris, sea air from Lanai in Hawaii, desert dust from Solar Village in Saudi Arabia on a dusty day, smoke from savanna fires in Zambia. Mie's theory on those particles gives how strongly they dim each colour, how much they absorb and in which directions they scatter, and it gives back what AERONET measured: smoke dims 440 nm blue about four times as much as 870 nm infrared and absorbs 12 to 22% of what it meets; dust and sea salt, mostly big grains, dim the colours more nearly alike, and dust absorbs blue more than red. How fast the haze thins with height is the page's own round figure: every 1.2 km for city haze, 1 km for sea air, 3 km for dust and 2.5 km for smoke. The ground reflects as grass and fields (6 to 12%), the sea (6%) or pale desert sand (12 to 45%, redder than blue). With G173's own haze, the page's direct sunlight, with the sun 41.8° up, matches the ASTM G173 standard's direct-sunlight spectrum to within 3% at 450 to 650 nm.
The sky: for each direction the page steps along the line of sight to the top of the air. At each step it works out how much sunlight arrives there (following the sun's ray back out through a round Earth, so high air can still be lit after sunset), how much of that is scattered towards you, and how much of that is lost on the way to you. That is the light scattered once. Light scattered two, three or more times is worked out by 'successive orders' on a grid through the round Earth's air, as in Bruneton and Neyret's sky (2008): at 14 heights (crowded towards the ground, where the haze is), 25 heights of the sun and 192 directions, the light arriving from every direction is followed back along its ray and scattered on, with the same air, the haze's own Mie phase function and reddened sunlight. The ground reflects at every order. Orders are added until the newest adds under 5% of the light so far (6 to 8 orders); the rest is estimated as a geometric series from the last two orders.
Three approximations in that, named: (1) the haze's sharp forward peak is truncated (Potter's method, 1970): inside 12° of straight on its phase function is held level, and the share cut off (3 to 5% of the scattering by city haze and smoke, 10 to 14% for sea air, about 26% for dust) counts as light carrying straight on. (2) The light scattered once is the exact sum with that truncated extinction and the full phase function (the 'TMS' correction of Nakajima and Tanaka, 1988), the peak's share weighted by (1 − e−m)/m, with m the number of forward throws expected along the light's path: the page's own step, so light thrown forwards several times arrives once, not once per throw. (3) The estimated remainder after the last order worked out: a geometric series from the ratio of the last two orders, with that ratio capped at 0.95 so the series can't run away. Checks, all for light falling on black ground: against 24 orders worked out in full, the page's stopping rule and remainder agree to within 1% in very dusty and salty air and on Mars, sun 30° up to 6° below; in a one-off comparison (its scripts are kept with the page's working files, not rerun on every change) against an independent Monte Carlo (photon-by-photon) sum in a round planet's air, the page's sky light on the ground agreed to within 2% in clear and usual air from the sun 2° to 30° up, and to within −2 to +6% in thick haze (optical depth 0.4 to 1, all four kinds) with the sun 2°, 5°, 10° and 30° up, the worst being sea air at 450 nm with the sun 5° up (the page's automatic tests repeat two of those cases, very dusty air with the sun 5° up and hazy city air with the sun 2° up, allowing 9%); in a flat-air Monte Carlo with the sun 30° up, the light scattered once, twice and three times by clear air each agree to within 1 to 3%; with nothing absorbing, the light coming down, going back to space and coming straight through adds up to the sunlight going in (checked on the truncated problem, before the TMS step), to within 0.7% in clear air and 3% in thick sea air; and a local copy of the published SPCTRAL2 formulas (Bird and Riordan 1986), fed the page's own haze, agrees to within 6% at 450 to 650 nm, sun 45° up, usual city haze. Other simplifications: the light scattered more than once is worked out every 40 nm and joined by straight lines; particles are spheres (dust grains aren't); the haze thins smoothly with height (real haze often lies in layers); the ground reflects evenly in all directions; there are no clouds; refraction is left out, so the sun sets about half a degree early. The light scattered more than once takes a few seconds for each kind of air, away from the page; until it is in, the first picture shows the light scattered once, and after that the last finished picture stays up, dimmed, with a note saying so.
The camera: a lens like a phone's (straight lines stay straight), aimed at the sun's bearing. Its meter weighs the middle of the frame most, as cameras' 'centre-weighted' meters do, and the reading is shown as middle grey; the sun's own disc is left out of the reading (on a camera's sensor those few pixels are clipped to white anyway). With EYES ADJUST off, the exposure is fixed: the one for a high sun in that air. White balance is daylight (the sRGB standard's), so a sunset is not 'corrected' towards white. Phones also brighten the dark parts of a picture and boost colour; the page doesn't, which is one reason a phone's sunset can look more orange across the frame. The sea is a calm mirror (Fresnel's law for water), without the ripples that spread the sun's reflection into a path, and land is level ground lit by the sun and the page's own sky. What the page shows: with the sun a few degrees up and some haze, a camera aimed at the sun gives a frame orange from side to side; in clean air the low sky is orange under a blue sky; very thick haze swallows the low sun, and the sky goes dull, pinkish grey. That last one is real too: weather forecasters say the most vivid sunsets come in clean air, and thick haze near the ground mutes them.
Colour: the spectrum is multiplied by the CIE 1931 colour-matching functions (the CIE's own table, 2° observer), giving the X, Y, Z values, then turned into screen colours with the sRGB standard's sums. From there on it is the display, not physics, and these are the page's choices: a colour outside what a screen can show is mixed with grey of the same brightness until it fits; brightness goes through a tone curve (Reinhard's, white at 6 times the exposure's middle); any pixel still too bright for the screen is scaled down with its colour kept, and pixels more than 2.5 times too bright are blended towards white (the sun's disc, and on some settings the glow round it). On MARS there is no EYES ADJUST: the picture always adjusts, and with the sun under 18° up the exposure is eased (fully by 8°) towards the glow beside the sun, as a camera aimed at the sunset would be, so the glow's colour isn't lost to white. Swatches marked "colour only" show the colour with the brightness set aside. Brightness is a display choice too, not physics: the whole-sky view is scaled so a midday sky reaches a fixed level (1.2 on the page's scale); with EYES ADJUST on it lifts darker skies only part of the way (by the 0.3 power of how much darker they are, so dusk still looks darker); FAR HILLS sets its picture so the air in front of the hills has a fixed brightness (0.62); and on MARS, with a low sun, the exposure leans towards a level of 0.55 for the glow beside the sun so its colour isn't lost.
Particles: Mie's theory, worked out in full for spheres (after Bohren and Huffman's method), over a spread of sizes so the colours don't flicker with tiny size changes. In the tank, particles of refractive index 1.50 in water. On Mars, the dust's refractive index measured by Wolff and others (2009) from orbit, with sizes spread around 1.5 micrometres. The dust absorbs about a fifth of the blue light it meets but only about 3% of the red (the page's sums: 79% of 440 nm light is scattered rather than absorbed, 97% at 670 nm), and like all particles a little bigger than the wavelength it throws light forwards in a narrow cone, narrower for blue than for red. Mars's air: 610 Pa at the surface on average, nearly all carbon dioxide, which scatters about 2.5 times as much as Earth's air per molecule; the dust slider is the optical depth at 880 nm, as the rovers measure it. Light scattered more than once, which matters even more there than on Earth, is worked out by the same orders as on Earth. Real Mars dust grains aren't spheres: the Mars sky here is a sketch of why, not a forecast of exactly what a camera would see.
Far hills: a hill's own light (woodland reflecting about 2.5% of blue and red light and up to 7% of green, then rising past 700 nm, the red edge of leaves, to 27.5% at 780 nm, lit by the sun and by the page's sky) is dimmed by e−βd over d km, and the air in between adds its own glow, (1 − e−βd) times the brightness of an endless stretch of air. The haze is city haze with the same Mie properties as THE SKY's. The air in between is lit by the sun and by the sky's own light scattered more than once (taken from THE SKY's sums at ground level, once they are in). Simplifications: the line of sight is level with the haze even along it, the hill is level ground, and the sky's light is worked out for the nearest of a set of hazes about 18% apart. The visibility is Koschmieder's 3.912 / β at 550 nm: air with no haze at all would let you see about 340 km.
Polarisation: single scattering by molecules gives a polarisation of 0.946 × sin²θ / (1 + cos²θ) at θ from the sun (0.946 allows for air molecules not being perfect spheres). The page scales that by the molecules' share of all the light from that patch: light scattered by haze and light scattered more than once are both counted as unpolarised. They aren't quite (that needs the full polarised sums), so the page's figures are a little low: a clean sky here peaks at about 56% (USUAL haze 39%), well under the 75 to 80% seen on the clearest days.
FURTHER WATCHING AND READING