@@ -150,33 +150,113 @@ def test_haurwitz():
150
150
assert_frame_equal (expected , out )
151
151
152
152
153
- def test_simplified_solis ():
154
- clearsky .simplified_solis ()
153
+ def test_simplified_solis_series_elevation ():
154
+ expected = pd .DataFrame (
155
+ np .array ([[ 0. , 0. , 0. ],
156
+ [ 0. , 0. , 0. ],
157
+ [ 377.80060035 , 79.91931339 , 42.77453223 ],
158
+ [ 869.47538184 , 706.37903999 , 110.05635962 ],
159
+ [ 958.89448856 , 1062.44821373 , 129.02349236 ],
160
+ [ 913.3209839 , 860.48978599 , 118.94598678 ],
161
+ [ 634.01066762 , 256.00505836 , 72.18396705 ],
162
+ [ 0. , 0. , 0. ],
163
+ [ 0. , 0. , 0. ]]),
164
+ columns = ['dni' , 'ghi' , 'dhi' ],
165
+ index = times_localized )
166
+
167
+ out = clearsky .simplified_solis (ephem_data ['apparent_elevation' ])
168
+ assert_frame_equal (expected , out )
169
+
170
+
171
+ def test_simplified_solis_scalar_elevation ():
172
+ expected = pd .DataFrame (np .array ([[959.335463 , 1064.653145 , 129.125602 ]]),
173
+ columns = ['dni' , 'ghi' , 'dhi' ])
174
+
175
+ out = clearsky .simplified_solis (80 )
176
+ assert_frame_equal (expected , out )
177
+
178
+
179
+ def test_simplified_solis_array_elevation ():
180
+ expected = pd .DataFrame (np .array ([[959.335463 , 1064.653145 , 129.125602 ]]),
181
+ columns = ['dni' , 'ghi' , 'dhi' ])
182
+
183
+ out = clearsky .simplified_solis (np .array ([80 ]))
184
+ assert_frame_equal (expected , out )
185
+
186
+
187
+ def test_simplified_solis_dni_extra ():
188
+ expected = pd .DataFrame (np .array ([[963.555414 , 1069.33637 , 129.693603 ]]),
189
+ columns = ['dni' , 'ghi' , 'dhi' ])
190
+
191
+ out = clearsky .simplified_solis (80 , dni_extra = 1370 )
192
+ assert_frame_equal (expected , out )
193
+
155
194
195
+ def test_simplified_solis_pressure ():
196
+ expected = pd .DataFrame (np .
197
+ array ([[ 964.26930718 , 1067.96543669 , 127.22841797 ],
198
+ [ 961.88811874 , 1066.36847963 , 128.1402539 ],
199
+ [ 959.58112234 , 1064.81837558 , 129.0304193 ]]),
200
+ columns = ['dni' , 'ghi' , 'dhi' ])
156
201
157
- def test_calc_i0p ():
158
- clearsky ._calc_i0p (w , aod700 , p , p0 )
202
+ out = clearsky .simplified_solis (
203
+ 80 , pressure = np .array ([95000 , 98000 , 101000 ]))
204
+ assert_frame_equal (expected , out )
159
205
160
206
161
- def test_calc_taub ():
162
- clearsky ._calc_taub (w , aod700 , p , p0 )
207
+ def test_simplified_solis_aod700 ():
208
+ expected = pd .DataFrame (np .
209
+ array ([[ 1056.61710493 , 1105.7229086 , 64.41747323 ],
210
+ [ 1007.50558875 , 1085.74139063 , 102.96233698 ],
211
+ [ 959.3354628 , 1064.65314509 , 129.12560167 ],
212
+ [ 342.45810926 , 638.63409683 , 77.71786575 ],
213
+ [ 55.24140911 , 7.5413313 , 0. ]]),
214
+ columns = ['dni' , 'ghi' , 'dhi' ])
163
215
216
+ aod700 = np .array ([0.0 , 0.05 , 0.1 , 1 , 10 ])
217
+ out = clearsky .simplified_solis (80 , aod700 = aod700 )
218
+ assert_frame_equal (expected , out )
164
219
165
- def test_calc_b ():
166
- clearsky ._calc_b (w , aod700 , p , p0 )
220
+
221
+ def test_simplified_solis_precipitable_water ():
222
+ expected = pd .DataFrame (np .
223
+ array ([[ 1001.15353307 , 1107.84678941 , 128.58887606 ],
224
+ [ 1001.15353307 , 1107.84678941 , 128.58887606 ],
225
+ [ 983.51027357 , 1089.62306672 , 129.08755996 ],
226
+ [ 959.3354628 , 1064.65314509 , 129.12560167 ],
227
+ [ 872.02335029 , 974.18046717 , 125.63581346 ]]),
228
+ columns = ['dni' , 'ghi' , 'dhi' ])
229
+
230
+ out = clearsky .simplified_solis (
231
+ 80 , precipitable_water = pd .Series ([0.0 , 0.2 , 0.5 , 1.0 , 5.0 ]))
232
+ assert_frame_equal (expected , out )
233
+
234
+
235
+ def test_simplified_solis_small_scalar_pw ():
236
+ expected = pd .DataFrame (np .
237
+ array ([[ 1001.15353307 , 1107.84678941 , 128.58887606 ]]),
238
+ columns = ['dni' , 'ghi' , 'dhi' ])
239
+
240
+ out = clearsky .simplified_solis (80 , precipitable_water = 0.1 )
241
+ assert_frame_equal (expected , out )
167
242
168
243
169
- def test_calc_taug ():
170
- clearsky ._calc_taug (w , aod700 , p , p0 )
244
+ def test_simplified_solis_return_raw ():
245
+ expected = np .array ([[[ 1099.25706525 , 656.24601381 ],
246
+ [ 915.31689149 , 530.31697378 ]],
171
247
248
+ [[ 1148.40081325 , 913.42330823 ],
249
+ [ 965.48550828 , 760.04527609 ]],
172
250
173
- def test_calc_g ():
174
- clearsky . _calc_g ( w , aod700 , p , p0 )
251
+ [[ 64.1063074 , 254.6186615 ],
252
+ [ 62.75642216 , 232.21931597 ]]] )
175
253
254
+ aod700 = np .linspace (0 , 0.5 , 2 )
255
+ precipitable_water = np .linspace (0 , 10 , 2 )
176
256
177
- def test_calc_taud ():
178
- clearsky ._calc_taud (w , aod700 , p , p0 )
257
+ aod700 , precipitable_water = np .meshgrid (aod700 , precipitable_water )
179
258
259
+ out = clearsky .simplified_solis (80 , aod700 , precipitable_water ,
260
+ return_raw = True )
180
261
181
- def test_calc_d ():
182
- clearsky ._calc_d (w , aod700 , p , p0 )
262
+ np .allclose (expected , out )
0 commit comments