Change refraction correction limit in ephemeris solar position algorithm#2524
Change refraction correction limit in ephemeris solar position algorithm#2524AdamRJensen wants to merge 2 commits intopvlib:mainfrom
Conversation
echedey-ls
left a comment
There was a problem hiding this comment.
Three thingies:
-
You've got some nice references that are not currently in the docstring: https://pvlib-python.readthedocs.io/en/stable/reference/generated/pvlib.solarposition.ephemeris.html I suggest adding at least the most relevant one. I'm aware
ephemerismay be superseded soon (quoting Kevin and Kevin, yet again) -
If you want to leave another hint for users that may find a difference, you can add to the docstring:
.. versionchanged:: 0.13.1 Refraction correction between 85º and 90º now correctly follows known references [...]_. -
I love that y'all have looked through all the details of the SPA algorithms and are fixing small incoherences. Could #2323 be in scope of this PR? I won't object if not. But for the sake of having the most 1-to-1 implementation somewhere...
| * Change refraction for solar elevation angles between 85 and 90 | ||
| degrees to be calculated rather than set to 0 in | ||
| :py:func:`~pvlib.solarposition.ephemeris`. (:pull:`2524`) |
There was a problem hiding this comment.
I guess this qualifies more like a bugfix rather than a Breaking Change - I don't see how my code would not run after this update.
|
As far as we can determine, setting refraction to 0. at elevation > 85 was a choice made some years ago by staff at our PV lab. The Grover Hughes' notes containing this algorithm are not published anywhere. We pass around a pdf containing a scan. |
|
That PDF is available here: https://pvpmc.sandia.gov/modeling-guide/1-weather-design-inputs/sun-position/sandias-ephemeris-model/ |
|
I read some comments about removing this function in the near future. Perhaps the effort to change it now (ever so minimally) can be spared? |
docs/sphinx/source/whatsnewfor all changes. Includes link to the GitHub Issue with:issue:`num`or this Pull Request with:pull:`num`. Includes contributor name and/or GitHub username (link with:ghuser:`user`).remote-data) and Milestone are assigned to the Pull Request and linked Issue.The refraction correction used by the Sandia empheris solar position algorithm sets refraction to zero above 85 degree elevation. This limit does not seem to configured in the reference, rather is is 90 degrees. Therefore, I propose that we change this to follow the reference. The 85 degree limit may come from the NOAA solar position algorithm which claims to use the Hughes refraction algorithm although deviating slightly from the original reference.
pvlib-python/pvlib/solarposition.py
Lines 831 to 832 in b1fd3f7
From "Engineering Astronomy" by Grver W. Hughes, Sandia Laboratories
Sun-Pointing Programs and Their Accuracy - John C. Zimmerman
NOAA