libera_utils.kernel_maker.mechanism_quaternions#
- libera_utils.kernel_maker.mechanism_quaternions(angles: float | floating | ndarray | Series, axis: ndarray) ndarray#
SPICE scalar-first quaternions for rotation by each
angleaboutaxis.q = [cos(theta/2), sin(theta/2) * axis]representsR(axis, theta), the mechanism frame’s rotation relative to its parent. Returns an(N, 4)array ordered (c, x, y, z).Notes
The Az/El CK configs must declare
FLIP SPICE QUATERNIONS(not plainSPICE QUATERNIONS) for these to load correctly. With FLIP, MSOPCK yieldspxform(mechanism, parent) = R(axis, +angle); plainSPICE QUATERNIONSstores the transpose (the inverse rotation), which shows up as a large pointing error. This pairing of the scalar-first half-angle form with the FLIP declaration was pinned empirically against a controlled single-axis rotation, so the two must stay in sync.