@@ -104,6 +104,9 @@ def load_ephemeris(file_type, gps_millis,
104104
105105 """
106106
107+ if isinstance (file_paths , (str , os .PathLike )):
108+ file_paths = [file_paths ]
109+
107110 existing_paths , needed_files = _verify_ephemeris (file_type ,
108111 gps_millis ,
109112 constellations ,
@@ -477,6 +480,9 @@ def _valid_ephemeris_in_paths(date, possible_types, file_paths=None):
477480 for path in file_paths :
478481 if os .path .split (path )[1 ][10 :] == os .path .split (recommended_file [1 ])[1 ][10 :- 3 ]:
479482 return True , path
483+ for path in file_paths :
484+ if os .path .split (path )[1 ][3 :] == str (gps_week ).zfill (4 ) + str ((timetuple .tm_wday + 1 )% 7 ) + ".sp3" :
485+ return True , path
480486
481487 # sp3 from last two weeks
482488 elif possible_type == "sp3_rapid_GFZ" :
@@ -498,6 +504,9 @@ def _valid_ephemeris_in_paths(date, possible_types, file_paths=None):
498504 for path in file_paths :
499505 if os .path .split (path )[1 ][10 :] == os .path .split (recommended_file [1 ])[1 ][10 :- 3 ]:
500506 return True , path
507+ for path in file_paths :
508+ if os .path .split (path )[1 ][3 :] == str (gps_week ).zfill (4 ) + str ((timetuple .tm_wday + 1 )% 7 ) + ".sp3" :
509+ return True , path
501510
502511 # sp3 if longer than two weeks ago
503512 elif possible_type == "sp3_final_CODE" :
@@ -519,6 +528,9 @@ def _valid_ephemeris_in_paths(date, possible_types, file_paths=None):
519528 for path in file_paths :
520529 if os .path .split (path )[1 ][10 :] == os .path .split (recommended_file [1 ])[1 ][10 :- 3 ]:
521530 return True , path
531+ for path in file_paths :
532+ if os .path .split (path )[1 ][3 :] == str (gps_week ).zfill (4 ) + str ((timetuple .tm_wday + 1 )% 7 ) + ".sp3" :
533+ return True , path
522534
523535 # clk from last three days
524536 elif possible_type == "clk_rapid_CODE" :
@@ -540,6 +552,9 @@ def _valid_ephemeris_in_paths(date, possible_types, file_paths=None):
540552 for path in file_paths :
541553 if os .path .split (path )[1 ][10 :] == os .path .split (recommended_file [1 ])[1 ][10 :- 3 ]:
542554 return True , path
555+ for path in file_paths :
556+ if os .path .split (path )[1 ][3 :] == str (gps_week ).zfill (4 ) + str ((timetuple .tm_wday + 1 )% 7 ) + ".clk" :
557+ return True , path
543558
544559 # clk from last two weeks
545560 elif possible_type == "clk_rapid_GFZ" :
@@ -561,6 +576,9 @@ def _valid_ephemeris_in_paths(date, possible_types, file_paths=None):
561576 for path in file_paths :
562577 if os .path .split (path )[1 ][10 :] == os .path .split (recommended_file [1 ])[1 ][10 :- 3 ]:
563578 return True , path
579+ for path in file_paths :
580+ if os .path .split (path )[1 ][3 :] == str (gps_week ).zfill (4 ) + str ((timetuple .tm_wday + 1 )% 7 ) + ".clk" :
581+ return True , path
564582
565583 # clk if longer than two weeks ago
566584 elif possible_type == "clk_final_CODE" :
@@ -582,6 +600,9 @@ def _valid_ephemeris_in_paths(date, possible_types, file_paths=None):
582600 for path in file_paths :
583601 if os .path .split (path )[1 ][10 :] == os .path .split (recommended_file [1 ])[1 ][10 :- 3 ]:
584602 return True , path
603+ for path in file_paths :
604+ if os .path .split (path )[1 ][3 :] == str (gps_week ).zfill (4 ) + str ((timetuple .tm_wday + 1 )% 7 ) + ".clk" :
605+ return True , path
585606
586607 else :
587608 raise RuntimeError (possible_type ,"invalid possible_type " \
0 commit comments