I have begun reading about quaternions after a long time. However I should answer this soon to other members of my work group. My understanding of quaternions is composed of four values w,x,y and z and that they can be used to represent rotations.
I have received data that supposedly represent quaternions
What are the conditions that have to be met for these data to be valid?
I have been told one condition of the quaternions is they have to have unit length so I am checking this condition on the data
I was told that a second one is that the w part(the scalar part) has to be non-negative to represent a proper rotation. However watching videos about quaternions make me doubt this.
Are there other conditions for data to be valid as quaternions?
Every unit quaternion represents a rotation, i.e., if you have $(w, z, y, z)$ and $$ w^2 + x^2 + y^2 + z^2 = 1 $$ then it represents a rotation. Unfortunately, the rotation represented by $(w, x, y, z)$ and the one represented by $(-w, -x, -y, -z)$ are one and the same, so folks often say "Only use non-negative values of $w$" as a way to make things unique. Unfortunately, that doesn't really work, because $(0, 1, 0, 0)$ and $(0, -1, 0, 0)$ still represent the same rotation. But you can't just say "OK, make $w, x, y,$ and $z$ all be nonnegative", because that ends up ruling out some rotations that you want, like $(0, s, -s, 0)$, where $s = \sqrt{2}/2$.
So when you want to check whether your data is valid, the sum-of-squares is the only sure thing; non-negative $w$ is something you might expect to see ... a quick look at the data in a spreadsheet would tell you a lot, as would an email to the person who sent you the data ... and beyond that, there's probably no other fixed pattern in the data that you can check for.