示例#1
0
    def test_change_frame(self):
        obj = SpaceObject(**self.orb_init)

        obj.out_frame = 'TEME'
        xv1 = obj.get_state(0)

        obj.out_frame = 'ITRS'
        xv0 = obj.get_state(0)

        self.assertEqual(xv1.shape, xv0.shape)
        for ind in range(6):
            self.assertNotEqual(xv1[ind, 0], xv0[ind, 0])
示例#2
0
    def test_propagate_epoch(self):
        self.orb_init['propagator'] = sorts.propagator.Kepler
        obj = SpaceObject(**self.orb_init)
        obj.out_frame = obj.in_frame

        state0 = obj.get_state(10.0)
        obj.propagate(10.0)
        state1 = obj.get_state(0.0)
        state2 = obj.orbit.cartesian

        nt.assert_almost_equal(state0, state1, decimal=5)
        nt.assert_almost_equal(state0, state2, decimal=5)
        nt.assert_almost_equal(state2, state1, decimal=5)