Skip to content

Commit 6ed62ff

Browse files
committed
catch invalid warnings for arccos in singleaxis
1 parent e210b82 commit 6ed62ff

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pvlib/tracking.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -472,14 +472,14 @@ def singleaxis(apparent_zenith, apparent_azimuth,
472472
# temp = np.clip(axes_distance*cosd(wid - side_slope), -1, 1)
473473

474474
# NOTE: account for rare angles below array, see GH 824
475-
with np.errstate(invalid='ignore'):
476-
temp = np.abs(axes_distance * cosd(wid - side_slope))
475+
temp = np.abs(axes_distance * cosd(wid - side_slope))
477476

478477
# backtrack angle
479478
# (always positive b/c acosd returns values between 0 and 180)
480479
# wc = np.degrees(np.arccos(temp))
481480
# equation 14, ref [2]
482-
wc = np.degrees(-np.sign(wid)*np.arccos(temp))
481+
with np.errstate(invalid='ignore'):
482+
wc = np.degrees(-np.sign(wid)*np.arccos(temp))
483483

484484
# Eq 4 applied when wid in QIV (wid < 0 evalulates True), QI
485485
# with np.errstate(invalid='ignore'):

0 commit comments

Comments
 (0)