-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add gallery example for cross-axis slope backtracking #1077
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
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.
This is quite clear, except at one point, but I have the advantage of having worked through the reference and the code already.
slope_azimuth = 155 # terrain slopes down to the south-south-east | ||
slope_tilt = 10 # terrain is sloped at 10 degrees from horizontal |
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'm confused at this point. The slope direction is 155 azimuth, but, the tilt is 10 degrees relative to what? Is it 10 degrees rotation relative to the tracker azimuth of 180? That seems an odd choice, since it is difficult to measure the slope tilt except relative to the slope azimuth.
If slope_tilt is 10 degrees relative to horizontal along slope_azimuth, then I'd suggest
slope_azimuth = 155 # terrain slopes down to the south-south-east | |
slope_tilt = 10 # terrain is sloped at 10 degrees from horizontal | |
slope_tilt = 10 # terrain slopes upward 10 degrees from horizontal in the direction of slope_azimuth |
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.
If slope_tilt is 10 degrees relative to horizontal along slope_azimuth,
Correct, but I think your suggested comment has the wrong sign. It's either upwards 10 degrees away from slope_azimuth, or downward 10 degrees towards it. Are you okay with this revision?
terrain slopes upward 10 degrees from horizontal away from the direction of slope_azimuth
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.
slope_azimuth is chosen in the downslope direction? I may have missed that if it's earlier in the text. If not, would be good to add. If slope_azimuth is always downslope, then I think it may be more clear to describe slope_tilt in the direction of slope_azimuth, i.e., always negative.
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.
Thanks for your patience with this reviewer
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.
Changes made. As always, I am grateful for the review :)
Co-authored-by: Cliff Hansen <cwhanse@sandia.gov>
…l/pvlib-python into cross_slope_example
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 and thank you @kanderso-nrel
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.
Thanks @kanderso-nrel, this is very helpful. I commented on a few minor things as I read through it, but I'm ok with merging this anytime.
Would it make sense to link to the other single axis tracker example or at least put them next to each other in the menu? I don't know how that's configured.
Maybe wait to delete tracking.ipynb
until we have a couple of examples for parameters like gcr and max_angle (probably in the simple single-axis tracker example).
Backtracking on sloped terrain | ||
============================== | ||
|
||
Modeling backtracking for single-axis tracker arrays on sloped terrain. |
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.
This reads like a module docstring but renders as regular text, so I think the rendered introduction is awkward.
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.
Agreed it's awkward in the rendered page. The reason for the strange wording is the docstring-style line is also used as the hover text for the thumbnail in the gallery listing, which has to be brief. Open to suggestions for text that works better in both contexts!
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.
Sounds like a gallery configuration problem. Let's ignore.
# sun is low in the sky. The backtracking strategy orients the modules exactly | ||
# on the boundary between shaded and unshaded so that the modules are oriented | ||
# as much towards the sun as possible while still remaining unshaded. | ||
# Unlike the truetracking calculation (which only depends on solar position), |
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.
Is "truetracking" (one word) widely accepted? I'd probably write true-tracking even at the cost of inconsistency with backtracking.
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.
The existing single-axis tracker example uses the hyphenated version.
gcr=gcr, | ||
cross_axis_tilt=cross_axis_tilt) | ||
|
||
backtracking_position = tracker_data['tracker_theta'].fillna(0) |
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.
backtracking_position = tracker_data['tracker_theta'].fillna(0) | |
# tracker rotation is undefined at night | |
backtracking_position = tracker_data['tracker_theta'].fillna(0) |
# calculate the solar position | ||
times = pd.date_range('2019-01-01 06:00', '2019-01-01 18:00', closed='left', | ||
freq='1min', tz=tz) | ||
solpos = solarposition.get_solarposition(times, lat, lon) |
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.
The rendered version has some weird syntax highlighting inconsistencies. I don't see anything wrong so probably safe to ignore.
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.
If you're talking about things being rendered blue-ish with clickable links, I think that's the intersphinx linking: https://sphinx-gallery.github.io/stable/configuration.html#add-intersphinx-links-to-your-examples
Future improvement: configure pvlib functions to link as well, or disable it for everything, for consistency.
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 think related examples can be grouped into sections with folders, and besides that there is ordering functionality: https://sphinx-gallery.github.io/stable/configuration.html#sorting-gallery-subsections Preference on introducing gallery sections here (e.g. "Weather", "PV Modeling", "Tracking") vs leaving that for another day and linking to the other example for now?
Fine by me. |
Was just thinking the same thing, that categories would help organize the examples. |
Thanks. Up to you. Changing this file name to |
This looks great! Thanks Kevin! |
test failure is unrelated. thanks @kanderso-nrel! |
Closes #xxxxTests addedUpdates entries todocs/sphinx/source/api.rst
for API changes.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`
).New code is fully documented. Includes numpydoc compliant docstrings, examples, and comments where necessary.As suggested in #823, here's a gallery example attempting to clarify the various angles and sign conventions in use. The static images are custom (using asymptote) for this example and can easily be modified; I am limited more by tunnel vision and lack of imagination than by the tool and welcome feedback to improve them.
rendered example: https://pvlib-python--1077.org.readthedocs.build/en/1077/auto_examples/plot_backtracking_sloped_terrain.html