Doing shadow studys for highrise buildings, I recognized that the SunAltitudes differ slighltly from the Ladybug_Legacy sunpath component (Ver. 0.0.67) to LB the sunpath component (Ver. 1.6).
In the python code of sunpath 0.0.67 component is indicated, that the algorithm relies on RADIANCE sun.c. Consulting the radiance source code, I found the there exists also a more accurate Michalsky algorithm. So I’m curious if the ladybug calculation relies on the Michalsky algorithm.
Futhermore I saw, that the results of several online suncalc algorithm differ on SunAltitudes to eachother and to ladybug. How accurate is the ladybug algorithm in comparison to those onlinetools?
LBT Ladybug uses the NOAA model, which is more-than-accurate for studying TMY data (like what the vast majority of EPW files provide).
If you’re trying to get deeper into the weeds, then the next level down in accuracy is to match the exact calendar year of sun positions to the one that you want to study (eg. 2024). The sun positions will be a few minutes different from year to year so there’s no use in trying to make things more accurate without first matching these years.
We wrote Ladybug primarily to work with TMY data so we don’t really support changing the calendar year that is used on any of the components. But, if you really want to change it, this is the part of the source code that handles the year property of the datetimes fed into the Sunpath class:
So you see that you can just pass the Sunpath class some custom DateTime objects where you have set the year property and you can get sun positions for that particular year. Throughout ladybug, you see that we just default to using 2017 for the vast majority of cases and we use 2016 for leap year EPWs. But the capability is there if you want to use the exact year and match sun positions down to the minute. You just have to create some of your own DateTime objects inside a GHPython component.