def test_get_astroplan_sun_and_time_small_range(self): end = self.start + timedelta(hours=10) sun, time_range = get_astroplan_sun_and_time(self.start, end, self.interval) self.assertIsInstance(sun, FixedTarget) self.assertEqual(len(time_range), 61) check_time_range = [time.mjd for time in time_range[::20]] expected_time_range = [58400.58074074052, 58400.71962963045, 58400.85851852037, 58400.997407410294] for i in range(0, len(expected_time_range)): self.assertEqual(check_time_range[i], expected_time_range[i])
def test_get_astroplan_sun_and_time(self): end = self.start + timedelta(days=2) sun, time_range = get_astroplan_sun_and_time(self.start, end, self.interval) self.assertIsInstance(sun, SkyCoord) self.assertEqual(len(time_range), 288) check_time_range = [time.mjd for time in time_range[::50]] expected_time_range = [58400.58074074052, 58400.92796296533, 58401.27518519014, 58401.62240741495, 58401.96962963976, 58402.31685186457] for i in range(0, len(expected_time_range)): self.assertEqual(check_time_range[i], expected_time_range[i])