def test_visible_above_horizon(self): """ visible_above_horizon test """ #equitorial orbit tle_line1 = "1 44235U 19029A 20178.66667824 .02170155 00000-0 40488-1 0 9998" tle_line2 = "2 44235 00.0000 163.9509 0005249 306.3756 83.0170 15.45172567 61683" #high inclination orbit tle2_line1 = "1 44235U 19029A 20178.66667824 .02170155 00000-0 40488-1 0 9998" tle2_line2 = "2 44235 70.0000 163.9509 0005249 306.3756 83.0170 15.45172567 61683" prop1 = orekit_utils.str_tle_propagator(tle_line1, tle_line2) prop2 = orekit_utils.str_tle_propagator(tle2_line1, tle2_line2) time = AbsoluteDate(2020, 6, 26, 1, 40, 00.000, TimeScalesFactory.getUTC()) #verified with graphing overviews self.assertFalse(orekit_utils.visible_above_horizon( prop1, prop2, time)) self.assertTrue( orekit_utils.visible_above_horizon(prop1, prop2, time.shiftedBy(60. * 10.))) self.assertTrue( orekit_utils.visible_above_horizon( prop1, prop2, time.shiftedBy(60. * 10. + 45. * 60.))) time_period_visible = orekit_utils.visible_above_horizon( prop1, prop2, time, 60 * 30)[0] self.assertTrue( time.shiftedBy(60. * 10.).isBetween(time_period_visible[0], time_period_visible[1]))
def test_find_sat_distance(self): """ find_distance tests: test some well known distances and zero cases """ tle_line1 = "1 25544U 98067A 20174.66385417 .00000447 00000-0 16048-4 0 9992" tle_line2 = "2 25544 51.6446 321.3575 0002606 75.8243 105.9183 15.49453790232862" tle2_line1 = "1 44235U 19029A 20178.58335648 .01685877 00000-0 31131-1 0 9991" tle2_line2 = "2 44235 52.9995 164.3403 0009519 291.6111 354.0622 15.45232749 61668" prop1 = orekit_utils.str_tle_propagator(tle_line1, tle_line2) prop2 = orekit_utils.str_tle_propagator(tle2_line1, tle2_line2) time = orekit_utils.absolute_time_converter_utc_string('2020-12-02T00:00:00.000') self.assertEqual(orekit_utils.find_sat_distance(prop1,prop2,time),orekit_utils.find_sat_distance(prop1,prop2,time)) self.assertEqual(orekit_utils.find_sat_distance(prop1,prop1,time),0.) self.assertEqual(orekit_utils.find_sat_distance(prop2,prop2,time),0.)
def test_str_tle_propagator(self): tle_line1 = "1 25544U 98067A 20174.66385417 .00000447 00000-0 16048-4 0 9992" tle_line2 = "2 25544 51.6446 321.3575 0002606 75.8243 105.9183 15.49453790232862" propagator_1 = orekit_utils.str_tle_propagator(tle_line1, tle_line2) TLE = orekit_utils.convert_tle_string_to_TLE(tle_line1, tle_line2) propagator_2 = TLEPropagator.selectExtrapolator(TLE) time = absolute_time_converter_utc_string('2020-12-02T00:00:00.000') self.assertTrue(propagator_1.propagate(time).getOrbit().toString() == propagator_2.propagate(time).getOrbit().toString())
def test_check_iot_in_range(self): """ check_iot_in_range test """ tle_line1 = "1 44235U 19029A 20178.66667824 .02170155 00000-0 40488-1 0 9998" tle_line2 = "2 44235 00.0000 163.9509 0005249 306.3756 270.0170 15.45172567 61683" prop1 = orekit_utils.str_tle_propagator(tle_line1, tle_line2) lat = 0. lon = 0. alt = 10. time = AbsoluteDate(2020, 6, 26, 1, 40, 00.000, TimeScalesFactory.getUTC()) self.assertTrue(check_iot_in_range(prop1, lat, lon, alt, time)) self.assertFalse(check_iot_in_range(prop1, lat, lon, alt, time.shiftedBy(60.*30.)))