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.

ephemerides.py 1009 B

12345678910111213141516171819202122
  1. import unittest
  2. from kosmorrolib.ephemerides import EphemeridesComputer
  3. from kosmorrolib.core import get_skf_objects
  4. from kosmorrolib.data import Star, Position
  5. from datetime import date
  6. class EphemeridesComputerTestCase(unittest.TestCase):
  7. def test_get_ephemerides_for_aster_returns_correct_hours(self):
  8. position = Position(0, 0)
  9. position.observation_planet = get_skf_objects()['earth']
  10. star = EphemeridesComputer.get_asters_ephemerides_for_aster(Star('Sun', skyfield_name='sun'),
  11. date=date(2019, 11, 18),
  12. position=position)
  13. self.assertEqual('2019-11-18T05:41:31Z', star.ephemerides.rise_time.utc_iso())
  14. self.assertEqual('2019-11-18T11:45:02Z', star.ephemerides.culmination_time.utc_iso())
  15. self.assertEqual('2019-11-18T17:48:39Z', star.ephemerides.set_time.utc_iso())
  16. if __name__ == '__main__':
  17. unittest.main()