"""."""

import numpy as np

from association_studio.common import FVT


def check_yaw_quat(vec: FVT) -> None:
    if vec.ndim != 1:
        raise ValueError('Quaternion must be a 1-dimensional array.')

    if vec.size != 4:
        raise ValueError('Quaternion must be a 4-element array.')

    if not np.allclose(vec[1:3], 0.0):
        raise ValueError('rx, ry are assumed to be zeros.')

    if vec[0] < 0.0:
        raise ValueError('Scalar part should be positive.')

    if abs(np.linalg.norm(vec) - 1) > 1.0e-6:
        raise ValueError('Quaternion vector should be normalized.')
