Theory behind SPC…
For calculating the position of the Sun (without taking into account atmospheric refraction) at a given geographical location, date and time, we use the algorithm described in:
http://www.stargazing.net/kepler/sun.htm
http://www.xylem.f2s.com/kepler/moonrise.html
Atmospheric refraction is taken into account as described in our earlier work:
http://www.fi.uib.no/~neda/sunset/index.html (or http://www.arxiv.org/abs/physics/0204060). In short: after fixing the temperature and pressure at a given height, we construct a Standard Atmosphere model, by imposing a standard 6.5K/km temperature lapse rate. By using Edlen's semi-empirical formula we calculate then the refractive index profile (which is dependent on height alone). In this optical atmosphere model, we follow the path of the light-rays by using the principles of classical geometrical optics.By neglecting the errors from the used Standard Atmosphere model the precision of the present version of the Sun Position Calculator is always under 1 minute both for the elevation angle and the azimuth of the Sun.
Errors arising from atmospheric refraction are not easily estimated. Our previous studies convinced us, that the Standard Atmosphere approximation is a proper one, and atmospheric refraction can be accounted well in this manner. However, if the atmospheric parameters from the input are incorrect, the errors when the Sun is in the vicinity of the horizon (elevation less than 1 degree) can be orders of magnitude higher then the previously given 1 minute estimate.