Sun position algoritm - NOAA vs SPA

@mostapha @chris If I’ve understood correctly, the current sun position algorithm is based on NOAA (and the year 2016). And NOAA states its algorithm is based on Astronomical Algorithms by Jean Meeus. (Although not sure if it has been modified or is exactly the same).

Digging into this a little more, it seems that the Solar Position Algorithm (SPA) is the most accurate/referenced. Is there any particular reason NOAA was used instead of SPA? I know that the discrepancy between the two is probably negligible but curious to know to rationale.

The default year used by LBT is 2017 unless you choose a leap year, in which case 2016 is used. The NOAA algorithm is accurate to within two minutes (or 0.008 degrees). This is less than the tiny change in solar position that happens from year to year so it’s suitable for the case where you want to understand a typical year and not specific ones.

If someone wanted to go through the effort of adding in a whole new SPA solar model and an option to access it in Ladybug, I’m not against it but I would feel that it should not be the default for the same reason that the default Rhino model tolerance is 0.001 and not 0.00000000001. Sure, you can set the model tolerance to something that fine or use a solar model that is a few orders of magnitude more accurate but you’ll likely see your model-editing process get noticeably slower, without any real benefit to the typical use cases.

So does that mean compute time was the main reason? Not against NOAA, just curious to know why.

I don’t know if speed is the reason since I don’t know if the SPA model is actually slower (or how much slower) than the NOAA model. It seems like it might be since increased accuracy usually comes with slower speed but I would say the main reason why I’m not currently working the SPA model is that the NOAA model is clearly more-than-accurate for typical cases, it’s fast, and there are other higher-priority things that I could work on that provide clear benefits to people simulating typical conditions and typical years.

But, as I said, I welcome anyone who wants to add the SPA model to Ladybug Sunpath. Just know that many of us are of the philosophy that we shouldn’t let the edge cases negatively affect the typical ones. So, if someone does implement it and it’s significantly slower that the NOAA model, we would expose it as an option on the Sunpath instead of the default behavior.