@@ -24,7 +24,7 @@ def test_solar_noon():
24
24
gcr = 2.0 / 7.0 )
25
25
26
26
expect = pd .DataFrame ({'aoi' : 10 , 'surface_azimuth' : np .nan ,
27
- 'surface_tilt' : 90 , 'tracker_theta' : 0 },
27
+ 'surface_tilt' : 0 , 'tracker_theta' : 0 },
28
28
index = [0 ], dtype = np .float64 )
29
29
30
30
assert_frame_equal (expect , tracker_data )
@@ -40,7 +40,7 @@ def test_azimuth_north_south():
40
40
gcr = 2.0 / 7.0 )
41
41
42
42
expect = pd .DataFrame ({'aoi' : 0 , 'surface_azimuth' : 90 ,
43
- 'surface_tilt' : 30 , 'tracker_theta' : - 60 },
43
+ 'surface_tilt' : 60 , 'tracker_theta' : - 60 },
44
44
index = [0 ], dtype = np .float64 )
45
45
46
46
assert_frame_equal (expect , tracker_data )
@@ -80,7 +80,7 @@ def test_backtrack():
80
80
gcr = 2.0 / 7.0 )
81
81
82
82
expect = pd .DataFrame ({'aoi' : 0 , 'surface_azimuth' : 90 ,
83
- 'surface_tilt' : 10 , 'tracker_theta' : 80 },
83
+ 'surface_tilt' : 80 , 'tracker_theta' : 80 },
84
84
index = [0 ], dtype = np .float64 )
85
85
86
86
assert_frame_equal (expect , tracker_data )
@@ -91,7 +91,7 @@ def test_backtrack():
91
91
gcr = 2.0 / 7.0 )
92
92
93
93
expect = pd .DataFrame ({'aoi' : 52.5716 , 'surface_azimuth' : 90 ,
94
- 'surface_tilt' : 62.5716 , 'tracker_theta' : 27.4283 },
94
+ 'surface_tilt' : 27.42833 , 'tracker_theta' : 27.4283 },
95
95
index = [0 ], dtype = np .float64 )
96
96
97
97
assert_frame_equal (expect , tracker_data )
@@ -106,8 +106,8 @@ def test_axis_tilt():
106
106
max_angle = 90 , backtrack = True ,
107
107
gcr = 2.0 / 7.0 )
108
108
109
- expect = pd .DataFrame ({'aoi' : 7.286245 , 'surface_azimuth' : 142.6573 ,
110
- 'surface_tilt' : 54.0125 , 'tracker_theta' : - 20.88121 },
109
+ expect = pd .DataFrame ({'aoi' : 7.286245 , 'surface_azimuth' : 37.3427 ,
110
+ 'surface_tilt' : 35.98741 , 'tracker_theta' : - 20.88121 },
111
111
index = [0 ], dtype = np .float64 )
112
112
113
113
assert_frame_equal (expect , tracker_data )
@@ -117,8 +117,8 @@ def test_axis_tilt():
117
117
max_angle = 90 , backtrack = True ,
118
118
gcr = 2.0 / 7.0 )
119
119
120
- expect = pd .DataFrame ({'aoi' : 47.6632 , 'surface_azimuth' : 50.9696 ,
121
- 'surface_tilt' : 47.4847 , 'tracker_theta' : 31.6655 },
120
+ expect = pd .DataFrame ({'aoi' : 47.6632 , 'surface_azimuth' : 129.0303 ,
121
+ 'surface_tilt' : 42.5152 , 'tracker_theta' : 31.6655 },
122
122
index = [0 ], dtype = np .float64 )
123
123
124
124
assert_frame_equal (expect , tracker_data )
@@ -134,7 +134,7 @@ def test_axis_azimuth():
134
134
gcr = 2.0 / 7.0 )
135
135
136
136
expect = pd .DataFrame ({'aoi' : 30 , 'surface_azimuth' : np .nan ,
137
- 'surface_tilt' : 90 , 'tracker_theta' : 0 },
137
+ 'surface_tilt' : 0 , 'tracker_theta' : 0 },
138
138
index = [0 ], dtype = np .float64 )
139
139
140
140
assert_frame_equal (expect , tracker_data )
@@ -147,8 +147,19 @@ def test_axis_azimuth():
147
147
max_angle = 90 , backtrack = True ,
148
148
gcr = 2.0 / 7.0 )
149
149
150
- expect = pd .DataFrame ({'aoi' : 0 , 'surface_azimuth' : 0 ,
151
- 'surface_tilt' : 60 , 'tracker_theta' : 30 },
150
+ expect = pd .DataFrame ({'aoi' : 0 , 'surface_azimuth' : 180 ,
151
+ 'surface_tilt' : 30 , 'tracker_theta' : 30 },
152
152
index = [0 ], dtype = np .float64 )
153
153
154
- assert_frame_equal (expect , tracker_data )
154
+ assert_frame_equal (expect , tracker_data )
155
+
156
+
157
+ @raises (ValueError )
158
+ def test_index_mismatch ():
159
+ apparent_zenith = pd .Series ([30 ])
160
+ apparent_azimuth = pd .Series ([90 ,180 ])
161
+
162
+ tracker_data = tracking .singleaxis (apparent_zenith , apparent_azimuth ,
163
+ axis_tilt = 0 , axis_azimuth = 90 ,
164
+ max_angle = 90 , backtrack = True ,
165
+ gcr = 2.0 / 7.0 )
0 commit comments