You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With permission I can edit this comment and add a photo of the poster.
Describe the solution you'd like
A fast implementation of the SG2, USNO or NOAA solar position algorithms set as the default model for the get_solarposition wrapper.
Describe alternatives you've considered
We could leave the default as nrel_numpy
Additional context
Increased run-time speed of pvlib reduces carbon output of running models (no matter how small or large that might be)
I am happy to re-implement one of the above models in Rust with python bindings and open source the rust backend. I know that this comment will open up a can of worms. I think one way to go about this is to implement the model twice, once in python as a reference for the community and once in rust/julia/c++ etc. for use in practice. Users would be able to select which model to use at their prerogative.
Solpos is a great algorithm as fast as usno but as accurate as spa and it already has a c implementation. Try pip install solarutils or see https://sunpower.github.io/SolarUtils/
Should we update to a faster algorithm given @AdamRJensen's poster at this year's PVPMC which shows that most algorithms have minimal impact on energy regardless of run-time?
A paper is in the works with more detail on this topic. Note that we already have a faster alternative to SPA (pvlib.solarposition.ephemeris), but quoting #2323 (comment):
A bit of context: @AdamRJensen, @IoannisSifnaios, and I have a project underway comparing solar position algorithms. We plan to contribute implementations of one or more algorithms to pvlib-python, depending on the results of the comparison. We expect some of them to be better than ephemeris in all respects (speed, accuracy, period of validity, clear reference).
#2152 and #2167 are candidates, but those PRs are on hold for now while we work towards clear recommendations for choice of algorithm.
Solpos is a great algorithm as fast as usno but as accurate as spa
I do not think this is true, unless "accurate as spa" means "produces practically equivalent solar energy simulations", which is also the case for half a dozen other algorithms :)
Activity
williamhobbs commentedon May 17, 2025
I like the idea. A picture of the poster (with permission) would definitely be nice.
mikofski commentedon May 17, 2025
Solpos is a great algorithm as fast as usno but as accurate as spa and it already has a c implementation. Try
pip install solarutilsor see https://sunpower.github.io/SolarUtils/kurt-rhee commentedon May 17, 2025
@mikofski that is awesome, would it be feasible to add the algorithm to pvlib to make it easier for newcomers to use? I wouldn't mind doing the work.
mikofski commentedon May 17, 2025
I would appreciate a Python version of SOLPOS. Or pvlib can also import optional dependent, for example perhaps consider sg2
Past concerns were
SPECTRL2 addition by Kevin resolved these concerns by reimplementing natively.
Related / past:
Purpose of listing these just for reference
adriesse commentedon May 18, 2025
Are there issues here?
I admit SPA sometimes takes longer than I would like, but I can cache the results if needed. Consistency is most important to me.
Here's a slide from software comparisons I did (what!? it's already) 6 years ago.
kandersolar commentedon May 18, 2025
A paper is in the works with more detail on this topic. Note that we already have a faster alternative to SPA (
pvlib.solarposition.ephemeris), but quoting #2323 (comment):#2152 and #2167 are candidates, but those PRs are on hold for now while we work towards clear recommendations for choice of algorithm.
I do not think this is true, unless "accurate as spa" means "produces practically equivalent solar energy simulations", which is also the case for half a dozen other algorithms :)
kurt-rhee commentedon May 19, 2025
Nice! @kandersolar can do this way better so I'll leave this up, but I won't do any work on the topic.
adriesse commentedon May 21, 2025
Looking forward to both of these! The poster made some claims but lacked justification. :(
adriesse commentedon Apr 3, 2026
Just wondering, is the paper out yet?
kandersolar commentedon Apr 8, 2026
Alas, not even submitted yet. It's on the backburner. Hopefully we will return to it sometime this year.
One clarification: by "we already have a faster alternative to SPA", I meant that pvlib already has one, not that a new one has been developed.
adriesse commentedon Apr 9, 2026
Ah, that's a significant clarification. I had the impression a something new was in the works.
williamhobbs commentedon Jul 20, 2026
Here's the poster that @kurt-rhee originally referenced:
https://pvpmc.sandia.gov/download/8943/?tmstv=1784555161
https://www.sandia.gov/app/uploads/sites/243/dlm_uploads/2025/05/7_2025_pvpmc_albuquerque_solar_position_algorithms_landscape.pdf