@@ -98,7 +98,7 @@ def gps_millis_to_tow(millis, add_leap_secs=False, verbose=False):
9898 print ('leapSecs added' )
9999 tow = tow + out_leapsecs
100100
101- return int (gps_week ), tow
101+ return np . int64 (gps_week ), tow
102102
103103def datetime_to_tow (t_datetime , add_leap_secs = True , verbose = False ):
104104 """Convert Python datetime object to GPS Week and time of week.
@@ -133,7 +133,7 @@ def datetime_to_tow(t_datetime, add_leap_secs=True, verbose=False):
133133
134134 tow = ((t_datetime - GPS_EPOCH_0 ) - timedelta (gps_week * 7.0 )).total_seconds ()
135135
136- return int (gps_week ), tow
136+ return np . int64 (gps_week ), tow
137137
138138
139139def tow_to_datetime (gps_week , tow , rem_leap_secs = True ):
@@ -301,7 +301,7 @@ def unix_millis_to_tow(unix_millis):
301301 """
302302 t_utc = unix_millis_to_datetime (unix_millis )
303303 gps_week , tow = datetime_to_tow (t_utc , add_leap_secs = True )
304- return int (gps_week ), tow
304+ return np . int64 (gps_week ), tow
305305
306306
307307def unix_to_gps_millis (unix_millis , add_leap_secs = True ):
@@ -328,10 +328,10 @@ def unix_to_gps_millis(unix_millis, add_leap_secs=True):
328328 for t_idx , unix in enumerate (unix_millis ):
329329 t_utc = unix_millis_to_datetime (unix )
330330 gps_millis [t_idx ] = datetime_to_gps_millis (t_utc , add_leap_secs = add_leap_secs )
331- gps_millis = gps_millis .astype (int )
331+ gps_millis = gps_millis .astype (np . int64 )
332332 else :
333333 t_utc = unix_millis_to_datetime (unix_millis )
334- gps_millis = int (datetime_to_gps_millis (t_utc , add_leap_secs = add_leap_secs ))
334+ gps_millis = np . int64 (datetime_to_gps_millis (t_utc , add_leap_secs = add_leap_secs ))
335335 return gps_millis
336336
337337
@@ -386,10 +386,10 @@ def gps_to_unix_millis(gps_millis, rem_leap_secs=True):
386386 for t_idx , gps in enumerate (gps_millis ):
387387 t_utc = gps_millis_to_datetime (gps , rem_leap_secs = rem_leap_secs )
388388 unix_millis [t_idx ] = datetime_to_unix_millis (t_utc )
389- gps_millis = gps_millis .astype (int )
389+ gps_millis = gps_millis .astype (np . int64 )
390390 else :
391391 t_utc = gps_millis_to_datetime (gps_millis , rem_leap_secs = rem_leap_secs )
392- unix_millis = int (datetime_to_unix_millis (t_utc ))
392+ unix_millis = np . int64 (datetime_to_unix_millis (t_utc ))
393393 return unix_millis
394394
395395def _check_tzinfo (t_datetime ):
0 commit comments