29
29
30
30
times = (pd .date_range ('2003-10-17 12:30:30' , periods = 1 , freq = 'D' )
31
31
.tz_localize ('MST' ))
32
- unixtimes = times .tz_convert ('UTC' ).astype (np .int64 )* 1.0 / 10 ** 9
32
+ unixtimes = np .array (times .tz_convert ('UTC' ).astype (np .int64 )* 1.0 / 10 ** 9 )
33
+
33
34
lat = 39.742476
34
35
lon = - 105.1786
35
36
elev = 1830.14
@@ -251,6 +252,9 @@ def test_transit_sunrise_sunset(self):
251
252
sunset = pd .DatetimeIndex ([dt .datetime (1996 , 7 , 5 , 17 , 1 , 4 ),
252
253
dt .datetime (2004 , 12 , 4 , 19 , 2 , 2 )]
253
254
).tz_localize ('UTC' ).astype (np .int64 )* 1.0 / 10 ** 9
255
+ times = np .array (times )
256
+ sunrise = np .array (sunrise )
257
+ sunset = np .array (sunset )
254
258
result = self .spa .transit_sunrise_sunset (times , - 35.0 , 0.0 , 64.0 , 1 )
255
259
assert_almost_equal (sunrise / 1e3 , result [1 ]/ 1e3 , 3 )
256
260
assert_almost_equal (sunset / 1e3 , result [2 ]/ 1e3 , 3 )
@@ -262,6 +266,9 @@ def test_transit_sunrise_sunset(self):
262
266
).tz_localize ('UTC' ).astype (np .int64 )* 1.0 / 10 ** 9
263
267
sunrise = pd .DatetimeIndex ([dt .datetime (1994 , 1 , 2 , 7 , 8 , 12 ),]
264
268
).tz_localize ('UTC' ).astype (np .int64 )* 1.0 / 10 ** 9
269
+ times = np .array (times )
270
+ sunrise = np .array (sunrise )
271
+ sunset = np .array (sunset )
265
272
result = self .spa .transit_sunrise_sunset (times , 35.0 , 0.0 , 64.0 , 1 )
266
273
assert_almost_equal (sunrise / 1e3 , result [1 ]/ 1e3 , 3 )
267
274
assert_almost_equal (sunset / 1e3 , result [2 ]/ 1e3 , 3 )
@@ -283,6 +290,9 @@ def test_transit_sunrise_sunset(self):
283
290
dt .datetime (2015 , 8 , 2 , 19 , 10 ),
284
291
dt .datetime (2015 , 12 , 2 , 16 , 38 ),],
285
292
).tz_localize ('MST' ).astype (np .int64 )* 1.0 / 10 ** 9
293
+ times = np .array (times )
294
+ sunrise = np .array (sunrise )
295
+ sunset = np .array (sunset )
286
296
result = self .spa .transit_sunrise_sunset (times , 39.0 , - 105.0 , 64.0 , 1 )
287
297
assert_almost_equal (sunrise / 1e3 , result [1 ]/ 1e3 , 1 )
288
298
assert_almost_equal (sunset / 1e3 , result [2 ]/ 1e3 , 1 )
@@ -305,6 +315,9 @@ def test_transit_sunrise_sunset(self):
305
315
dt .datetime (2015 , 12 , 2 , 16 , 50 ),],
306
316
).tz_localize ('Asia/Shanghai'
307
317
).astype (np .int64 )* 1.0 / 10 ** 9
318
+ times = np .array (times )
319
+ sunrise = np .array (sunrise )
320
+ sunset = np .array (sunset )
308
321
result = self .spa .transit_sunrise_sunset (times , 39.917 , 116.383 , 64.0 ,1 )
309
322
assert_almost_equal (sunrise / 1e3 , result [1 ]/ 1e3 , 1 )
310
323
assert_almost_equal (sunset / 1e3 , result [2 ]/ 1e3 , 1 )
@@ -313,6 +326,7 @@ def test_earthsun_distance(self):
313
326
times = (pd .date_range ('2003-10-17 12:30:30' , periods = 1 , freq = 'D' )
314
327
.tz_localize ('MST' ))
315
328
unixtimes = times .tz_convert ('UTC' ).astype (np .int64 )* 1.0 / 10 ** 9
329
+ unixtimes = np .array (unixtimes )
316
330
result = self .spa .earthsun_distance (unixtimes , 64.0 , 1 )
317
331
assert_almost_equal (R , result , 6 )
318
332
0 commit comments