Whew! This week was hard! I cleaned up the rayctracer code data management and the python code for interpreting and plotting the data. Which sounds not too bad, but was very hard to keep everything working and organized. Probably that’s because I’m as good with python but it always has a tendency to turn into mess of scripts and not well organized like c++ into classes and functions.
Anyhow, I have finally got it running and not too bad of results: Here I traced a simple cube and compared the ray trace to the solcast file Ghi. It’s perfect for diffuse light. It’s just a little off on the direct light, and outside the error bars… I think this is related to the time used for calculating the sun position.

At any rate it seems accurate enough for my purposes. A lingering question for refractive media is that there seemed to be too many rays bouncing until they timed out (too many reflections). That’s something I’ll have to look into later, but in general that can happen in glazing due to total interior reflection. I saw it in the solTrace program and thought it was a bug at first.
