def getQpqw2eci(self): """Returns the frame transformation matrix from the PQW (co-planar) frame to the earth-centered inertial (ECI) frame, w.r.t. J2000. """ w = rot.Z(self.w_rad) i = rot.X(self.i_rad) O = rot.Z(self.O_rad) return (w.dot(i).dot(O)).transpose()
def test_example4p7(self): O = rot.Z(40 * pi / 180) i = rot.X(30 * pi / 180) w = rot.Z(60 * pi / 180) wiO_act = w.dot(i).dot(O) wiO_ref = numpy.array([[-0.099068, 0.89593, 0.43301], [-0.94175, -0.22496, 0.25], [0.32139, -0.38302, 0.86603]]) dWIO = (wiO_ref - wiO_act).reshape((9, )) self.assertTrue(dWIO.dot(dWIO)**0.5 < 1e-4)
def getQpqw2eci(self, t_dt=None): """Returns a time-varying tranformation matrix that converts vectors from the PQW (co-orbital) frame to the earth-centered inertial (ECI) frame (w.r.t. the J2000 epochal orientation). This includes the RAAN precession and AoP procession rates induced by the J2 harmonic. """ w = rot.Z(self.getAop(t_dt)) i = rot.X(self.i_rad) O = rot.Z(self.getRaan(t_dt)) return (w.dot(i).dot(O)).transpose()
def getQecf2enu(rSiteLla_radm): """Returns a transformation matrix that converts an ECF vector to ENZ as perceived from a site at the given lat/lon/alt location. Note that this is a frame rotation only--relative range requires user subtraction. """ Quen2enu = numpy.array([[0, 1, 0], [0, 0, 1], [1, 0, 0]]) ry = rot.Y(-rSiteLla_radm[0]) rz = rot.Z(rSiteLla_radm[1]) return Quen2enu.dot(ry).dot(rz)
def getQeci2ecf(t_dt): """Returns a 3x3 numpy.array that defines a transformation (at this level of fidelity, just a Z rotation) from the ECI to ECF frame at the given *datetime.datetime* value. """ return rot.Z(getGmst(t_dt))
def test_Z(self): v = rot.Z(0.5 * pi).dot(numpy.array([1, 0, 0])) self.assertTrue(norm(v - numpy.array([0, -1, 0])) < 1e-8)