-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Rename solar position inputs in tracking.singleaxis #2480
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?
Rename solar position inputs in tracking.singleaxis #2480
Conversation
…on-tracking.singlaxis
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.
LGTM :)
apparent_zenith
has a lot of occurrences so I've not reviewed them all. apparent_azimuth
only seems to exist as positional arguments in test_tracking.py
. I don't think they deserve to change.
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.
Glad to see this change finally happening!
Docs build looks clean, but the CI found one more in the tests:
pvlib-python/tests/test_tracking.py
Lines 296 to 297 in dfafe6d
result = tracking.singleaxis( | |
apparent_zenith=80, apparent_azimuth=338, axis_tilt=30, |
Also can we add a new test using with pytest.warns(pvlibDeprecationWarning, match='...')
for the new messages? Seems like good practice, even if somewhat redundant.
I'm ok with this change There's another instance of |
This:
IMHO it would be a grave disservice to imply that true extraterrestrial unrefracted zenith is correct in tracking algorithms, because it would lead to errors in tracker rotations and therefore incur significant losses in deployed PV systems. Therefore I’m -1 on this change, if that’s the condition. |
I may be a little confused about what's being proposed and discussed, but I'm understanding that there are 3 items:
The concern I have is that the outputs of pvlib solar position functions include |
In case folks missed it or have forgotten, there is useful and relevant discussion in #1403 of what Note that if we demand that functions which take refracted zenith call the corresponding parameter
I was curious how big this error actually is so I ran a quick simulation. Unrefracted sun position is lower in the sky, so tracking (/backtracking) according to that will not cause self-shading. The difference in annual irradiation due to worse AOI is pretty small, only ~0.05% assuming always-clear conditions. Quick simulation code here: Click to expand!import pandas as pd
import pvlib
times = pd.date_range("2020-01-01", "2020-12-31 23:59", freq="1min", tz="Etc/GMT+5")
location = pvlib.location.Location(40, -80)
sp = location.get_solarposition(times)
cs = location.get_clearsky(times, solar_position=sp)
am = pvlib.atmosphere.get_relative_airmass(sp.apparent_zenith)
et = pvlib.irradiance.get_extra_radiation(times)
tr1 = pvlib.tracking.singleaxis(sp.apparent_zenith, sp.azimuth, backtrack=True, gcr=0.4)
tr2 = pvlib.tracking.singleaxis(sp.zenith, sp.azimuth, backtrack=True, gcr=0.4)
kwargs = dict(solar_zenith=sp.apparent_zenith, solar_azimuth=sp.azimuth, airmass=am, dni_extra=et, **cs)
gti1 = pvlib.irradiance.get_total_irradiance(tr1.surface_tilt, tr1.surface_azimuth, **kwargs)
gti2 = pvlib.irradiance.get_total_irradiance(tr2.surface_tilt, tr2.surface_azimuth, **kwargs)
rel_diff_annual_irrad = 1 - gti2['poa_global'].sum() / gti1['poa_global'].sum()
print(f"difference in annual GTI: {100 * rel_diff_annual_irrad:0.02f}%") |
Thanks, @kandersolar. I did either miss or forget about #1403. I'm also +1 for |
I agree with Cliff & Will, I propose we limit scope in this PR to just renaming the confusing
So this is a topic that deserves its own issue in my opinion |
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.Rename the inputs to the
tracking.singleaxis
function. Specifically,apparent_zenith
->solar_zenith
andapparent_azimuth
-->solar_azimuth