Back in the 1980s when doing this we used a Naval Almanac - the US Navy navigation | star position formulas and data are all open source (as products of the US Government).
These days you can tease similar information from Celestia, Stellarium, and other astro projects.
Sun angle wrt a smooth perfect ellipsoid is one thing .. actual sun angle + shadows in the presence of mountains, valleys, forests, tall buildings, etc is a whole other ball of fun.