slmsuite.holography.toolbox#

Helper functions for manipulating phase patterns.

Submodules

phase

Repository of common analytic phase patterns.

Functions

assign_vectors

Assigns each vector in vectors to the closest counterpart assignment_options.

convert_blaze_radius

Alias for convert_radius() for backwards compatibility.

convert_blaze_vector

Alias for convert_vector() for backwards compatibility.

convert_radius

Helper function for scalar unit conversions.

convert_vector

Helper function for vector unit conversions in the \(k\)-space of the SLM.

fit_3pt

Fits three points to an affine transformation.

format_2vectors

Validates that an array of 2-dimensional vectors is a numpy.ndarray of shape (2, N).

format_shape

Helper function to format a shape tuple.

format_vectors

Validates that an array of M-dimensional vectors is a numpy.ndarray of shape (M, N).

imprint

Imprints a region (defined by window) of a matrix with a function.

lloyds_algorithm

Implements Lloyd's Algorithm on a set of seed vectors to promote even vector spacing.

lloyds_points

pad

Helper function to pad data with zeros.

print_blaze_conversions

Helper function to understand unit conversions.

smallest_distance

Returns the smallest distance between pairs of points under a given metric.

transform_grid

Returns a copy of a coordinate basis grid with a given shift and transformation.

unpad

Helper function to unpad data.

voronoi_windows

Returns boolean array windows corresponding to the Voronoi cells for a set of vectors.

window_extent

Find a square that covers the active region of the 2D boolean mask window.

window_slice

Parses the slices that describe the window's view into the larger array.