Ejemplo n.º 1
0
 def test_gps(self):
     available_date = GPSTime.from_datetime(datetime(2020, 5, 1, 12))
     dog = AstroDog(valid_const=["GPS"],
                    valid_ephem_types=EphemerisType.ULTRA_RAPID_ORBIT)
     dog.get_orbit_data(available_date, only_predictions=True)
     self.assertGreater(len(dog.orbits.keys()), 0)
     self.assertTrue(available_date in dog.orbit_fetched_times)
Ejemplo n.º 2
0
def get_orbit_data(t: GPSTime, valid_const, auto_update, valid_ephem_types):
  astro_dog = AstroDog(valid_const=valid_const, auto_update=auto_update, valid_ephem_types=valid_ephem_types)
  cloudlog.info(f"Start to download/parse orbits for time {t.as_datetime()}")
  start_time = time.monotonic()
  try:
    astro_dog.get_orbit_data(t, only_predictions=True)
    cloudlog.info(f"Done parsing orbits. Took {time.monotonic() - start_time:.1f}s")
    return astro_dog.orbits, astro_dog.orbit_fetched_times, t
  except (RuntimeError, ValueError, IOError) as e:
    cloudlog.warning(f"No orbit data found or parsing failure: {e}")
  return None, None, t
Ejemplo n.º 3
0
def get_orbit_data(t: GPSTime, valid_const, auto_update, valid_ephem_types):
  astro_dog = AstroDog(valid_const=valid_const, auto_update=auto_update, valid_ephem_types=valid_ephem_types)
  cloudlog.info(f"Start to download/parse orbits for time {t.as_datetime()}")
  start_time = time.monotonic()
  data = None
  try:
    astro_dog.get_orbit_data(t, only_predictions=True)
    data = (astro_dog.orbits, astro_dog.orbit_fetched_times)
  except RuntimeError as e:
    cloudlog.info(f"No orbit data found. {e}")
  cloudlog.info(f"Done parsing orbits. Took {time.monotonic() - start_time:.1f}s")
  return data
Ejemplo n.º 4
0
 def test_gps_and_glonass_2022(self):
     # Test GPS and GLONASS separately from the first date that GLONASS Ultra-Rapid prediction orbits were available
     available_date = GPSTime.from_datetime(datetime(2022, 1, 29, 11, 31))
     for t in range(0, 24, 3):
         check_date = available_date + t * SECS_IN_HR
         for const in ["GPS", "GLONASS"]:
             dog = AstroDog(
                 valid_const=const,
                 valid_ephem_types=EphemerisType.ULTRA_RAPID_ORBIT)
             dog.get_orbit_data(check_date, only_predictions=True)
             self.assertGreater(len(dog.orbits.keys()), 0)
             self.assertTrue(check_date in dog.orbit_fetched_times)
Ejemplo n.º 5
0
def get_orbit_data(t: GPSTime, valid_const, auto_update, valid_ephem_types,
                   cache_dir):
    astro_dog = AstroDog(valid_const=valid_const,
                         auto_update=auto_update,
                         valid_ephem_types=valid_ephem_types,
                         cache_dir=cache_dir)
    cloudlog.info(f"Start to download/parse orbits for time {t.as_datetime()}")
    start_time = time.monotonic()
    try:
        astro_dog.get_orbit_data(t, only_predictions=True)
        cloudlog.info(
            f"Done parsing orbits. Took {time.monotonic() - start_time:.1f}s")
        cloudlog.debug(
            f"Downloaded orbits ({sum([len(v) for v in astro_dog.orbits])}): {list(astro_dog.orbits.keys())}"
            +
            f"With time range: {[f'{start.as_datetime()}, {end.as_datetime()}' for (start,end) in astro_dog.orbit_fetched_times._ranges]}"
        )
        return astro_dog.orbits, astro_dog.orbit_fetched_times, t
    except (DownloadFailed, RuntimeError, ValueError, IOError) as e:
        cloudlog.warning(f"No orbit data found or parsing failure: {e}")
    return None, None, t