Skip to content

Commit 9cbad4a

Browse files
committed
improve docstring. add assert_index_equal
1 parent 955b22e commit 9cbad4a

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

pvlib/tracking.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
import numpy as np
77
import pandas as pd
8+
from pandas.util.testing import assert_index_equal
89

910
from pvlib.tools import cosd, sind
1011

@@ -51,7 +52,8 @@ def singleaxis(apparent_zenith, apparent_azimuth, latitude=1,
5152
5253
axis_azimuth : float
5354
A value denoting the compass direction along which
54-
the axis of rotation lies, in decimal degrees.
55+
the axis of rotation lies.
56+
Measured in decimal degrees East of North.
5557
5658
max_angle : float
5759
A value denoting the maximum rotation angle, in
@@ -99,7 +101,7 @@ def singleaxis(apparent_zenith, apparent_azimuth, latitude=1,
99101
pvl_logger.debug('tracking.singleaxis')
100102

101103
# MATLAB to Python conversion by
102-
# Will Holmgren, U. Arizona, March, 2015. @wholmgren
104+
# Will Holmgren (@wholmgren), U. Arizona. March, 2015.
103105

104106
# Calculate sun position x, y, z using coordinate system as in [1], Eq 2.
105107

@@ -117,6 +119,12 @@ def singleaxis(apparent_zenith, apparent_azimuth, latitude=1,
117119
# Rotate sun azimuth to coordinate system as in [1]
118120
# to calculate sun position.
119121

122+
try:
123+
assert_index_equal(apparent_azimuth.index, apparent_zenith.index)
124+
except AssertionError:
125+
raise ValueError('apparent_azimuth.index and ' +
126+
'apparent_zenith.index must match.')
127+
120128
times = apparent_azimuth.index
121129

122130
az = apparent_azimuth - 180

0 commit comments

Comments
 (0)