slmsuite.holography.toolbox.format_2vectors
- format_2vectors(vectors)[source]
Validates that an array of 2D vectors is a
numpy.ndarray
of shape(2, N)
. Handles shaping and transposing if, for instance, tuples or row vectors are passed.- Parameters
vectors (array_like) – 2-vector or array of 2-vectors to process. Shape of
(2, N)
.- Returns
vectors – Cleaned column vector(s).
- Return type
numpy.ndarray
- Raises
AssertionError – If the vector input was inappropriate.