NREL / Radiance

This repo has been archived. Please refer to https://github.com/LBNL-ETA/Radiance/tree/master for the latest updates.
Other
166 stars 64 forks source link

Change max gensky zenith to 89.999 #7

Closed Lumenade closed 9 years ago

Lumenade commented 9 years ago

Updated gensky to keep the sun position 0.001 degrees from the zenith instead of 3.0 degrees from the zenith. This 3 degree error causes inaccuracies in locations between the tropics where the sun can be truly directly overhead. A difference of 0.001 degrees is approximately the same as a 100 m offset in position at the equator, a 3 degree error is the equivalent of having the model be more than 330 km from where it should be. See this Wikipedia chart for further information.

rpg777 commented 9 years ago

Hi @Lumenade,

The three degree limit is there for a reason. From Greg Ward:

The problem with having the sun too close to the zenith is due to the design of the CIE clear sky model, which is based around zenith brightness. The formula for the zenith brightness on line 247 of gensky.c is:

zenithbr = (1.376*turbidity-1.81)*tan(altitude)+0.38;

At 87 degrees, the current maximum allowed altitude, this comes out to 30.17 with the default turbidity. If we change the maximum to 89.999, then the zenith brightness goes up to 89,450 thanks to that tangent in there. (Another scaling factor gets applied before the final value, but this is the same in all cases.)

Using such a large zenith brightness wrecks the rest of the approximation -- it breaks the model, essentially. I'm afraid that equatorial regions are just stuck with this problem until CIE introduces something better, Wikipedia notwithstanding.

Therefore we will not recommend this change be pushed up to the main Radiance repo. Thanks for the work, and please note the issue above as you use your gensky version!