122122import gzip
123123import ftplib
124124from ftplib import FTP_TLS , FTP
125- from datetime import datetime , timezone , timedelta , time , UTC
125+ from datetime import datetime , timezone , timedelta , time
126126
127127import unlzw3
128128import numpy as np
@@ -280,7 +280,7 @@ def _verify_ephemeris(file_type, gps_millis, constellations=None,
280280 raise RuntimeError ("gnss_lib_py cannot automatically " \
281281 + "download rinex nav files for " \
282282 + "times before Jan 1, 2013" )
283- if datetime .now (UTC ).date () == date :
283+ if datetime .now (timezone . utc ).date () == date :
284284 possible_types = ["rinex_nav_today" ]
285285 else :
286286 if constellations is not None and list (constellations ) == ["gps" ]:
@@ -290,7 +290,7 @@ def _verify_ephemeris(file_type, gps_millis, constellations=None,
290290
291291 # download from day's stream if too early in the day
292292 # that combined file is not yet uploaded to CDDIS.
293- if datetime .now (UTC ) < datetime .combine (date + timedelta (days = 1 ),
293+ if datetime .now (timezone . utc ) < datetime .combine (date + timedelta (days = 1 ),
294294 time (12 )).astimezone (timezone .utc ): # pragma: no cover
295295 possible_types += ["rinex_nav_today" ]
296296 else :
@@ -304,9 +304,9 @@ def _verify_ephemeris(file_type, gps_millis, constellations=None,
304304 raise RuntimeError ("gnss_lib_py cannot automatically " \
305305 + "download sp3 files for " \
306306 + "times before May 25, 2012" )
307- if datetime .now (UTC ).date () - timedelta (days = 3 ) < date :
307+ if datetime .now (timezone . utc ).date () - timedelta (days = 3 ) < date :
308308 possible_types += ["sp3_rapid_CODE" ]
309- elif datetime .now (UTC ).date () - timedelta (days = 14 ) < date :
309+ elif datetime .now (timezone . utc ).date () - timedelta (days = 14 ) < date :
310310 possible_types += ["sp3_rapid_GFZ" ]
311311 elif date >= datetime (2017 , 8 , 13 ).date ():
312312 possible_types += ["sp3_final_CODE" ]
@@ -318,9 +318,9 @@ def _verify_ephemeris(file_type, gps_millis, constellations=None,
318318 raise RuntimeError ("gnss_lib_py cannot automatically " \
319319 + "download clk files for " \
320320 + "times before Oct 14, 2012" )
321- if datetime .now (UTC ).date () - timedelta (days = 3 ) < date :
321+ if datetime .now (timezone . utc ).date () - timedelta (days = 3 ) < date :
322322 possible_types += ["clk_rapid_CODE" ]
323- elif datetime .now (UTC ).date () - timedelta (days = 14 ) < date :
323+ elif datetime .now (timezone . utc ).date () - timedelta (days = 14 ) < date :
324324 possible_types += ["clk_rapid_GFZ" ]
325325 elif date >= datetime (2020 , 7 , 5 ).date ():
326326 possible_types += ["clk_final_CODE" ]
@@ -430,7 +430,7 @@ def _extract_ephemeris_dates(file_type, dt_timestamps):
430430 needed_dates .update ({dt .date () + timedelta (days = 1 ) for dt in dt_timestamps
431431 if ((dt >= datetime .combine (dt .date (),
432432 time (22 ,tzinfo = timezone .utc ))) &
433- (dt .date () != datetime .now (UTC ).date ()))
433+ (dt .date () != datetime .now (timezone . utc ).date ()))
434434 })
435435
436436 else :
0 commit comments