pyoptools.misc.GS package

Submodules

Module contents

pyoptools.misc.GS.gs(idata, itera=10, ia=None)

Gerchberg-Saxton algorithm to calculate DOEs

Calculates the phase distribution in a object plane to obtain an specific amplitude distribution in the target plane. It uses a FFT to calculate the field propagation. The wavefront at the DOE plane is assumed as a plane wave.

ARGUMENTS:

idata

numpy array containing the target amplitude distribution

itera

Maximum number of iterations

ia

Illumination amplitude at the hologram plane if not given it is assumed to be a constant amplitude with a value of 1. If given it should be an array with the same shape of idata

pyoptools.misc.GS.gs_gpu(idata, itera=100)

Gerchberg-Saxton algorithm to calculate DOEs using the GPU

Calculates the phase distribution in a object plane to obtain an specific amplitude distribution in the target plane. It uses a FFT to calculate the field propagation. The wavefront at the DOE plane is assumed as a plane wave.

ARGUMENTS:

idata

numpy array containing the target amplitude distribution

itera

Maximum number of iterations

pyoptools.misc.GS.gs_mod(idata, itera=10, osize=256)

Modified Gerchberg-Saxton algorithm to calculate DOEs

Calculates the phase distribution in a object plane to obtain an specific amplitude distribution in the target plane. It uses a FFT to calculate the field propagation. The wavefront at the DOE plane is assumed as a plane wave. This algorithm leaves a window around the image plane to allow the noise to move there. It only optimises the center of the image.

ARGUMENTS:

idata

numpy array containing the target amplitude distribution

itera

Maximum number of iterations

osize

Size of the center of the image to be optimized It should be smaller than the image itself.

pyoptools.misc.GS.gs_mod_gpu(idata, itera=10, osize=256)