slmsuite.holography.toolbox.format_2vectors#

format_2vectors(vectors)[source]#

Validates that an array of 2-dimensional vectors is a numpy.ndarray of shape (2, N). Handles shaping and transposing if, for instance, tuples or row vectors are passed. This a wrapper of format_vectors() for backwards compatibility.

Parameters:

vectors (array_like) – 2-vector or array of 2-vectors to process. Desires shape of (2, N). Uses the "crop" keyword of format_vectors().

Returns:

vectors – Cleaned column vector(s). Shape of (2, N).

Return type:

numpy.ndarray

Raises:

ValueError – If the vector input was inappropriate.