calculate surface angles using unit normal#2702
Conversation
| surface_azimuth = np.degrees( | ||
| np.arctan2(unit_normal[:, 0], unit_normal[:, 1])) |
There was a problem hiding this comment.
I would include this line in the function that calculates the unit normal so that it is self-contained w.r.t. its conventions.
There was a problem hiding this comment.
Are you suggesting that _unit_normal calculate and return surface_azimuth? I'm unclear what you are suggesting.
|
|
||
| def _unit_normal(axis_azimuth, axis_tilt, theta): | ||
| """ | ||
| Unit normal to rotated tracker surface, in global E-N-Up coordinates, |
There was a problem hiding this comment.
I don't know whether there is a precedent somewhere, but I have personally been using a left-handed N-E-Up system in my toolbox to match the usual azimuth angle convention. Just for info; not recommending a change.
echedey-ls
left a comment
There was a problem hiding this comment.
I've compared _unit_normal with an implementation I did based on scipy rotation objects, and they match. The 3d axis basis is the same E-N-Up, left-hand rotations.
I just left this comment in the issue, I hope not to delay a fix on negative tilt handling.
pvlib/tracking.py
Outdated
| Unit normal to rotated tracker surface, in global E-N-Up coordinates, | ||
| given by R*(0, 0, 1)^T, where: | ||
|
|
||
| R = Rz(-axis_azimuth) Rx(-axis_tilt) Ry(theta) * |
There was a problem hiding this comment.
| R = Rz(-axis_azimuth) Rx(-axis_tilt) Ry(theta) * | |
| R = Rz(-axis_azimuth) Rx(-axis_tilt) Ry(theta) |
pvlib/tracking.py
Outdated
| rotation by -axis_tilt about the x-axis, where axis_tilt is negated | ||
| because pvlib's convention is that the positive y-axis is tilted | ||
| downwards. Ry is a rotation by theta | ||
| about the y-axis. theta is negated so that a negative. |
There was a problem hiding this comment.
I think this sentence was not ended correctly, right?
docs/sphinx/source/referencefor API changes.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.Changes the calculation of surface angles for tracking.singleaxis to allow for negative axis_tilt.
Changes the output of singleaxis in the case of surface_tilt=0, to consistently return surface_azimuth=axis_azimuth.