def test_position_convertion(self): position_ecef = (2750.19, -4476.679, -3604.011) p = Position(None, position_ecef, None, None) ecef_est = coordinate_systems.llh_to_ecef(*p.position_llh) self.assertAlmostEqual(position_ecef[0], ecef_est[0], 3) self.assertAlmostEqual(position_ecef[1], ecef_est[1], 3) self.assertAlmostEqual(position_ecef[2], ecef_est[2], 3)
def test_off_nadir_satellite_passing_right_means_negative_sign(self): position_ecef = llh_to_ecef(0, 10, 500 * 1000) velocity_ecef = (0, 0, -1) max_elevation_position = Position(None, position_ecef, velocity_ecef, None) pass_ = PredictedPass(sate_id=1, location=self.location, aos=None, los=None, duration_s=None, max_elevation_position=max_elevation_position, max_elevation_deg=None) self.assertLessEqual(pass_.off_nadir_deg, 0)
def test_off_nadir_satellite_exactly_over(self): position_ecef = llh_to_ecef(0, 0, 500 * 1000) # A satellite exactly over the point velocity_ecef = (0, 0, 1) max_elevation_position = Position(None, position_ecef, velocity_ecef, None) pass_ = PredictedPass(sate_id=1, location=self.location, aos=None, los=None, duration_s=None, max_elevation_position=max_elevation_position, max_elevation_deg=None) self.assertAlmostEqual(pass_.off_nadir_deg, 0, delta=0.02)
def test_off_nadir_satellite_passing_left_means_positive_sign(self): position_ecef = llh_to_ecef(0, -10, 500 * 1000) # A satellite exactyl over the point velocity_ecef = (0, 0, -1) max_elevation_position = Position(None, position_ecef, velocity_ecef, None) pass_ = PredictedPass(sate_id=1, location=self.location, aos=None, los=None, duration_s=None, max_elevation_position=max_elevation_position, max_elevation_deg=None) self.assertGreaterEqual(pass_.off_nadir_deg, 0)