11
11
from pvlib .location import Location
12
12
from pvlib import tracking
13
13
14
+ SINGLEAXIS_COL_ORDER = ['tracker_theta' , 'aoi' ,
15
+ 'surface_azimuth' , 'surface_tilt' ]
14
16
15
17
def test_solar_noon ():
16
18
apparent_zenith = pd .Series ([10 ])
@@ -20,9 +22,10 @@ def test_solar_noon():
20
22
max_angle = 90 , backtrack = True ,
21
23
gcr = 2.0 / 7.0 )
22
24
23
- expect = pd .DataFrame ({'aoi ' : 10 , 'surface_azimuth ' : 90 ,
24
- 'surface_tilt ' : 0 , 'tracker_theta ' : 0 },
25
+ expect = pd .DataFrame ({'tracker_theta ' : 0 , 'aoi ' : 10 ,
26
+ 'surface_azimuth ' : 90 , 'surface_tilt ' : 0 },
25
27
index = [0 ], dtype = np .float64 )
28
+ expect = expect [SINGLEAXIS_COL_ORDER ]
26
29
27
30
assert_frame_equal (expect , tracker_data )
28
31
@@ -36,9 +39,10 @@ def test_azimuth_north_south():
36
39
max_angle = 90 , backtrack = True ,
37
40
gcr = 2.0 / 7.0 )
38
41
39
- expect = pd .DataFrame ({'aoi ' : 0 , 'surface_azimuth ' : 90 ,
40
- 'surface_tilt ' : 60 , 'tracker_theta ' : - 60 },
42
+ expect = pd .DataFrame ({'tracker_theta ' : - 60 , 'aoi ' : 0 ,
43
+ 'surface_azimuth ' : 90 , 'surface_tilt ' : 60 },
41
44
index = [0 ], dtype = np .float64 )
45
+ expect = expect [SINGLEAXIS_COL_ORDER ]
42
46
43
47
assert_frame_equal (expect , tracker_data )
44
48
@@ -63,6 +67,7 @@ def test_max_angle():
63
67
expect = pd .DataFrame ({'aoi' : 15 , 'surface_azimuth' : 90 ,
64
68
'surface_tilt' : 45 , 'tracker_theta' : 45 },
65
69
index = [0 ], dtype = np .float64 )
70
+ expect = expect [SINGLEAXIS_COL_ORDER ]
66
71
67
72
assert_frame_equal (expect , tracker_data )
68
73
@@ -79,6 +84,7 @@ def test_backtrack():
79
84
expect = pd .DataFrame ({'aoi' : 0 , 'surface_azimuth' : 90 ,
80
85
'surface_tilt' : 80 , 'tracker_theta' : 80 },
81
86
index = [0 ], dtype = np .float64 )
87
+ expect = expect [SINGLEAXIS_COL_ORDER ]
82
88
83
89
assert_frame_equal (expect , tracker_data )
84
90
@@ -90,6 +96,7 @@ def test_backtrack():
90
96
expect = pd .DataFrame ({'aoi' : 52.5716 , 'surface_azimuth' : 90 ,
91
97
'surface_tilt' : 27.42833 , 'tracker_theta' : 27.4283 },
92
98
index = [0 ], dtype = np .float64 )
99
+ expect = expect [SINGLEAXIS_COL_ORDER ]
93
100
94
101
assert_frame_equal (expect , tracker_data )
95
102
@@ -104,8 +111,10 @@ def test_axis_tilt():
104
111
gcr = 2.0 / 7.0 )
105
112
106
113
expect = pd .DataFrame ({'aoi' : 7.286245 , 'surface_azimuth' : 142.65730 ,
107
- 'surface_tilt' : 35.98741 , 'tracker_theta' : - 20.88121 },
114
+ 'surface_tilt' : 35.98741 ,
115
+ 'tracker_theta' : - 20.88121 },
108
116
index = [0 ], dtype = np .float64 )
117
+ expect = expect [SINGLEAXIS_COL_ORDER ]
109
118
110
119
assert_frame_equal (expect , tracker_data )
111
120
@@ -117,6 +126,7 @@ def test_axis_tilt():
117
126
expect = pd .DataFrame ({'aoi' : 47.6632 , 'surface_azimuth' : 50.96969 ,
118
127
'surface_tilt' : 42.5152 , 'tracker_theta' : 31.6655 },
119
128
index = [0 ], dtype = np .float64 )
129
+ expect = expect [SINGLEAXIS_COL_ORDER ]
120
130
121
131
assert_frame_equal (expect , tracker_data )
122
132
@@ -133,6 +143,7 @@ def test_axis_azimuth():
133
143
expect = pd .DataFrame ({'aoi' : 30 , 'surface_azimuth' : 180 ,
134
144
'surface_tilt' : 0 , 'tracker_theta' : 0 },
135
145
index = [0 ], dtype = np .float64 )
146
+ expect = expect [SINGLEAXIS_COL_ORDER ]
136
147
137
148
assert_frame_equal (expect , tracker_data )
138
149
@@ -147,6 +158,7 @@ def test_axis_azimuth():
147
158
expect = pd .DataFrame ({'aoi' : 0 , 'surface_azimuth' : 180 ,
148
159
'surface_tilt' : 30 , 'tracker_theta' : 30 },
149
160
index = [0 ], dtype = np .float64 )
161
+ expect = expect [SINGLEAXIS_COL_ORDER ]
150
162
151
163
assert_frame_equal (expect , tracker_data )
152
164
@@ -184,8 +196,10 @@ def test_SingleAxisTracker_tracking():
184
196
tracker_data = system .singleaxis (apparent_zenith , apparent_azimuth )
185
197
186
198
expect = pd .DataFrame ({'aoi' : 7.286245 , 'surface_azimuth' : 142.65730 ,
187
- 'surface_tilt' : 35.98741 , 'tracker_theta' : - 20.88121 },
199
+ 'surface_tilt' : 35.98741 ,
200
+ 'tracker_theta' : - 20.88121 },
188
201
index = [0 ], dtype = np .float64 )
202
+ expect = expect [SINGLEAXIS_COL_ORDER ]
189
203
190
204
assert_frame_equal (expect , tracker_data )
191
205
@@ -202,9 +216,11 @@ def test_SingleAxisTracker_tracking():
202
216
apparent_azimuth = pd .Series ([180 + pvsyst_solar_azimuth ])
203
217
apparent_zenith = pd .Series ([90 - pvsyst_solar_height ])
204
218
tracker_data = pvsyst_system .singleaxis (apparent_zenith , apparent_azimuth )
205
- expect = pd .DataFrame ({'aoi' : 41.07852 , 'surface_azimuth' : 180 - 18.432 ,
206
- 'surface_tilt' : 24.92122 , 'tracker_theta' : - 15.18391 },
219
+ expect = pd .DataFrame ({'aoi' : 41.07852 , 'surface_azimuth' : 180 - 18.432 ,
220
+ 'surface_tilt' : 24.92122 ,
221
+ 'tracker_theta' : - 15.18391 },
207
222
index = [0 ], dtype = np .float64 )
223
+ expect = expect [SINGLEAXIS_COL_ORDER ]
208
224
209
225
assert_frame_equal (expect , tracker_data )
210
226
0 commit comments