A library that computes the ephemerides.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

35 lines
667 B

  1. #!/usr/bin/env python3
  2. from skyfield.api import Loader
  3. from skyfield.timelib import Time
  4. from skyfield.nutationlib import iau2000b
  5. from skyfield_data import get_skyfield_data_path
  6. LOADER = Loader(get_skyfield_data_path())
  7. def get_timescale():
  8. return LOADER.timescale()
  9. def get_skf_objects():
  10. return LOADER("de421.bsp")
  11. def get_iau2000b(time: Time):
  12. return iau2000b(time.tt)
  13. def flatten_list(the_list: list):
  14. new_list = []
  15. for item in the_list:
  16. if isinstance(item, list):
  17. for item2 in flatten_list(item):
  18. new_list.append(item2)
  19. continue
  20. new_list.append(item)
  21. return new_list