slmsuite.holography.toolbox.pad
- pad(matrix, shape)[source]
Helper function to pad data with zeros. The padding is centered. This is used to get higher resolution upon Fourier transform.
- Parameters
matrix (numpy.ndarray) – Data to pad.
shape ((int, int) OR None) – The desired shape of the
matrix
innumpy
(h, w)
form. IfNone
, thematrix
is returned unpadded.
- Returns
Padded
matrix
.- Return type
numpy.ndarray