-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Allow asymmetrical rotation limits in pvlib.tracking.singleaxis
#1809
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
Closed
MichalArieli
wants to merge
5
commits into
pvlib:main
from
solargik:add_min_angle_singleaxis_tracking
Closed
Changes from 3 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
251deb7
Modify max_angle to accept tuples in addition to
MichalArieli a3f898a
Merge branch 'main' of https://github.com/solargik/pvlib-python into …
MichalArieli 476bdba
Merge branch 'main' into add_min_angle_singleaxis_tracking
MichalArieli ebb4240
add text
MichalArieli 0a9a760
add comment to docs/sphinx/source/whatsnew/v0.10.2
MichalArieli File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -44,12 +44,17 @@ def singleaxis(apparent_zenith, apparent_azimuth, | |||||
A value denoting the compass direction along which the axis of | ||||||
rotation lies. Measured in decimal degrees east of north. | ||||||
|
||||||
max_angle : float, default 90 | ||||||
max_angle : float or tuple, default 90 | ||||||
A value denoting the maximum rotation angle, in decimal degrees, | ||||||
of the one-axis tracker from its horizontal position (horizontal | ||||||
if axis_tilt = 0). A max_angle of 90 degrees allows the tracker | ||||||
to rotate to a vertical position to point the panel towards a | ||||||
horizon. max_angle of 180 degrees allows for full rotation. | ||||||
if axis_tilt = 0). If a float is provided, it represents the maximum | ||||||
rotation angle, and the minimum rotation angle is assumed to be the | ||||||
opposite of the maximum angle. If a tuple of (min_angle, max_angle) | ||||||
is provided, it represents both the minimum and maximum rotation angles. | ||||||
|
||||||
A max_angle of 90 degrees allows the tracker to rotate to a vertical | ||||||
position to point the panel towards a horizon. A max_angle of 180 degrees | ||||||
allows for full rotation. | ||||||
|
||||||
backtrack : bool, default True | ||||||
Controls whether the tracker has the capability to "backtrack" | ||||||
|
@@ -190,7 +195,17 @@ def singleaxis(apparent_zenith, apparent_azimuth, | |||||
|
||||||
# NOTE: max_angle defined relative to zero-point rotation, not the | ||||||
# system-plane normal | ||||||
tracker_theta = np.clip(tracker_theta, -max_angle, max_angle) | ||||||
|
||||||
|
||||||
# Determine minimum and maximum rotation angles for the tracker based on max_angle. | ||||||
# If max_angle is a single value, assume min_angle is the negative of max_angle. | ||||||
if np.array(max_angle).size == 1: | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Maybe a bit easier to read while achieving the same thing? |
||||||
min_angle = -max_angle | ||||||
else: | ||||||
min_angle, max_angle = max_angle | ||||||
|
||||||
# Clip tracker_theta between the minimum and maximum angles. | ||||||
tracker_theta = np.clip(tracker_theta, min_angle, max_angle) | ||||||
|
||||||
# Calculate auxiliary angles | ||||||
surface = calc_surface_orientation(tracker_theta, axis_tilt, axis_azimuth) | ||||||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
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 feel like we need to explain the orientation that distinguishes
min_angle
frommax_angle
. Suggest adding a new paragraph like:A rotation to
'max_angle'
is a counter-clockwise rotation about the y-axis of the tracker coordinate system. For example, for a tracker with'axis_azimuth'
oriented to the south, a rotation to'max_angle'
is towards the west, and a rotation toward'min_angle'
is in the opposite direction, toward the east.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.
Thank you for this input! As you suggested, I have added this paragraph.