Previous: , Up: Color   [Contents][Index]


5.11.7 Daylight

(require 'daylight)

This package calculates the colors of sky as detailed in:
http://www.cs.utah.edu/vissim/papers/sunsky/sunsky.pdf
A Practical Analytic Model for Daylight
A. J. Preetham, Peter Shirley, Brian Smits

Function: solar-hour julian-day hour

Returns the solar-time in hours given the integer julian-day in the range 1 to 366, and the local time in hours.

To be meticulous, subtract 4 minutes for each degree of longitude west of the standard meridian of your time zone.

Function: solar-declination julian-day
Function: solar-polar declination latitude solar-hour

Returns a list of theta_s, the solar angle from the zenith, and phi_s, the solar azimuth. 0 <= theta_s measured in degrees. phi_s is measured in degrees from due south; west of south being positive.

In the following procedures, the number 0 <= theta_s <= 90 is the solar angle from the zenith in degrees.

Turbidity is a measure of the fraction of scattering due to haze as opposed to molecules. This is a convenient quantity because it can be estimated based on visibility of distant objects. This model fails for turbidity values less than 1.3.

    _______________________________________________________________
512|-:                                                             |
   | * pure-air                                                    |
256|-:**                                                           |
   | : ** exceptionally-clear                                      |
128|-:   *                                                         |
   | :    **                                                       |
 64|-:      *                                                      |
   | :       ** very-clear                                         |
 32|-:         **                                                  |
   | :           **                                                |
 16|-:             *** clear                                       |
   | :               ****                                          |
  8|-:                  ****                                       |
   | :                     **** light-haze                         |
  4|-:                         ****                                |
   | :                             ******                          |
  2|-:                                  ******** haze         thin-|
   | :                                          ***********    fog |
  1|-:----------------------------------------------------*******--|
   |_:____.____:____.____:____.____:____.____:____.____:____.____:_|
     1         2         4         8        16        32        64
              Meterorological range (km) versus Turbidity
Function: sunlight-spectrum turbidity theta_s

Returns a vector of 41 values, the spectrum of sunlight from 380.nm to 790.nm for a given turbidity and theta_s.

Function: sunlight-chromaticity turbidity theta_s

Given turbidity and theta_s, sunlight-chromaticity returns the CIEXYZ triple for color of sunlight scaled to be just inside the RGB709 gamut.

Function: zenith-xyy turbidity theta_s

Returns the xyY (chromaticity and luminance) at the zenith. The Luminance has units kcd/m^2.

Function: overcast-sky-color-xyy turbidity theta_s

turbidity is a positive real number expressing the amount of light scattering. The real number theta_s is the solar angle from the zenith in degrees.

overcast-sky-color-xyy returns a function of one angle theta, the angle from the zenith of the viewing direction (in degrees); and returning the xyY value for light coming from that elevation of the sky.

Function: clear-sky-color-xyy turbidity theta_s phi_s
Function: sky-color-xyy turbidity theta_s phi_s

turbidity is a positive real number expressing the amount of light scattering. The real number theta_s is the solar angle from the zenith in degrees. The real number phi_s is the solar angle from south.

clear-sky-color-xyy returns a function of two angles, theta and phi which specify the angles from the zenith and south meridian of the viewing direction (in degrees); returning the xyY value for light coming from that direction of the sky.

sky-color-xyY calls overcast-sky-color-xyY for turbidity <= 20; otherwise the clear-sky-color-xyy function.


Previous: , Up: Color   [Contents][Index]