Repository navigation
incorrect horizon test in tracker.singleaxis #569
Description
Activity
Other than 0 vs. nan, I believe this follows
pvl_singleaxis.mlines 167-171:% filter for sun above panel horizon) u = zp>0; % apply limits to ideal rotation angle wid(~u) = 0; % set horizontal if zenith<0, sun is below panel horizon
Or did I mix things up when implementing
singleaxis?On 0 vs. nan, I believe my thinking at the time was that it might not be safe to always assume a 0 stow position and in any case a user could always replace the nan with 0s if they cared. I'm generally ok with changing it, though.
The Matlab function has the same error.
Ok, so
singleaxislines 413-414# filter for sun above panel horizon wid[zp <= 0] = np.nan
become
# filter for sun above horizon wid[apparent_zenith >= 90] = np.nan # or 0 if you prefer
Sounds good to me.
Would be best to add a new test that uses the same input data as above but with the
singleaxisfunction rather than the object method.@cwhanse I can do this this afternoon if you're not already on it. Would like to finish off 0.6.0...
- I'm not free this afternoon, so go ahead and fix this bug if you can…________________________________ From: Will Holmgren <notifications@github.com> Sent: Tuesday, September 11, 2018 2:08 PM To: pvlib/pvlib-python Cc: Hansen, Clifford W; Mention Subject: [EXTERNAL] Re: [pvlib/pvlib-python] incorrect horizon test in tracker.singleaxis (#569) @cwhanse<https://github.com/cwhanse> I can do this this afternoon if you're not already on it. Would like to finish off 0.6.0... - You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub<#569 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AFJNL05slHMflPJoRB6_n1ozHrImNhMUks5uaBg-gaJpZM4WiOeP>.
On the topic of "zero vs nan": I wonder whether we could maintain a master list somewhere describing all the cases where a value is special, such as being out of range or non-physical, and how it is encoded, such as zero, nan, -99.99, 7999, or whatever.
Describe the bug
wid[zp <= 0] = np.nansets the tracker rotation angle tonp.nanwhen the sun is behind the array plane, but the array plane is not yet defined. At this line, the array plane is defined only by the tracker tilt and azimuth, but not its rotation.To Reproduce
The plot shows that the tracker rotation
tracker_thetais limited to between -90 and 90.Expected behavior
In the above example, the sun rotates in azimuth at 45 zenith. The vertical tracker without rotation limit should follow the sun around the complete circle.
Screenshots

Versions:
pvlib.__version__: 0.5.2Additional context
One fix would be to substitute a test for solar zenith, so that the tracker rotation is not set when the sun is below the visible horizon. I also wonder if we should set the rotation to 0 (stow position) instead of
np.nanin this case.wid[z <= 0] = np.nanwid[z <= 0] = 0.0