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 in the \(k\)-space upon Fourier transform.
- Parameters:
matrix (numpy.ndarray) – Data to pad.
shape ((int, int) OR None) – The desired shape of the
matrixinnumpy(h, w)form. IfNone, thematrixis returned unpadded.
- Returns:
Padded
matrix.- Return type:
numpy.ndarray