コード例 #1
0
 def phi_local(self):
     theta_z, phi_z = SkyModel.rotate(self.theta_global,
                                      self.phi_global,
                                      yaw=-self.yaw)
     theta_z, phi_z = SkyModel.rotate(theta_z, phi_z, pitch=-self.pitch)
     theta_z, phi_z = SkyModel.rotate(theta_z, phi_z, roll=-self.roll)
     return (phi_z + np.pi) % (2 * np.pi) - np.pi
コード例 #2
0
    def rotate_centre(centre, yaw=0., pitch=0., roll=0.):
        # centre[[1, 0]] = SkyModel.rotate(centre[1], centre[0], yaw=yaw, pitch=pitch, roll=roll)
        centre[[1, 0]] = SkyModel.rotate(np.pi / 2 - centre[1],
                                         np.pi - centre[0],
                                         yaw=yaw,
                                         pitch=-pitch,
                                         roll=-roll)

        centre[0] = (2 * np.pi - centre[0]) % (2 * np.pi) - np.pi
        centre[1] = (3 * np.pi / 2 - centre[1]) % (2 * np.pi) - np.pi
        centre[2] = (centre[2] + roll + np.pi) % (2 * np.pi) - np.pi

        return centre