[Physics] How to estimate colour temperature based on the position of the sun in the sky

astronomyatmospheric sciencesunthermal-radiationvisible-light

I'd like to estimate the colour-temperature of sunlight (as applied in photography) based on the position of the sun in the sky for a mobile phone app I'm working on (app link from a more appropriate question –Are there any mobile applications that calculate sunrise/sunset based on location?).

I'm already able to determine the position of the sun in the sky based on the date, time, latitude and longitude.

From this position (sun elevation from the horizon) I'd like to estimate the colour-temperature assuming clear skys. I understand there are factors such as how overcast the sky is that I won't be able to take into account. I'll assume an unobstructed view of the horizon.

E.g. Something like the following.

Light Source                    Colour Temperature in K
============                    =======================
Sunrise and Sunset              2,000 to 3,000
Sunlight at 10 Degree elevation 3,500
Sunlight at 20 Degree elevation 4,000
Sunlight at 30 Degree elevation 4,500
Noon Sun and Clear Sky          4,900 to 5,800
Start of Blue Hour              ?

Is there a formula I can use that directly relates the estimated colour temperature to the suns position in the sky?

Note, this question was originally asked on the photography stack exchange but was migrated here as more of a physics based problem.

My current understanding of the problem is that I'll need to apply Rayleigh scattering and possibly Mie scattering.

The following image from Cambridge in colour shows an (exaggerated?) colour temperature scale with dawn (1), sunrise (2), midday (3), sunset (4) and dusk (5) marked.
Exaggerated sky colour temperature

Best Answer

The sun's color is directly related to the air mass its light travels through to reach the observer.

An article which relates the air mass to the observed spectrum of the sun is linked here. In particular, equation 17 provides the intensity seen by an observer as a function of wavelength, accounting for contributions from air molecules and aerosols. This equation applies to an observer at sea level, although the role of altitude is also discussed in the article.

At a given zenith angle, one can then calculate the radiation spectrum as a function of wavelength, for various levels of aerosols (figures 9, 10, and 11).

The resulting spectra are no longer Planckian, and you'll have to apply your favorite definition of color temperature to each one.

Related Question