-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Change refraction correction limit in ephemeris solar position algorithm #2524
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Change refraction correction limit in ephemeris solar position algorithm #2524
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
ephemeris
may 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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/whatsnew
for 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