While I was working on a research project using the “direct solar irradiance” component in Ladybug, I realized that the equation used to calculate diffuse irradiance for anisotropic sky is (0.313* math.cos(vec_angle) *0.313* math.cos(vec_angle), in https://www.ladybug.tools/ladybug/docs/_modules/ladybug/wea.html , while in an ASHRAE document (page 7) the equation is 0.313 x cos^2(theta). I wonder if this is a bug or if there was a reason to use 0.313^2 instead of just 0.313?
Good catch. The difference between 0.313 × cos²(theta) and 0.313² × cos²(theta) seems worth checking, especially since it can affect the calculated diffuse irradiance. Hopefully someone familiar with the implementation can clarify whether this was intentional or just a typo in the source code.
Looks like it’s a bug that goes all of the way back to Ladybug Legacy.
I must have made the mistake 9 years ago when I added the anisotrophic sky model there:
… and then I must have copied into the new ladybug source code without double-checking the primary source. I’ll push a fix to the latest ladybug source code shortly.