Gerchberg-Saxton phase retrieval#

lasy.utils.phase_retrieval.gerchberg_saxton_algo(laserPos1, laserPos2, dz, condition='max_iterations', max_iterations=10, amplitude_error=1.0, debug=False)[source]#

Implement the Gerchberg-Saxton Algorithm.

Given two laser profiles and a distance betweent them, calculate the spatial phase profile of the laser in both planes using the Gerchberg-Saxton algorithm. Returns the phase of the laser in both planes.

Parameters:
laserPos1, laserPos2instance of Laser
dzfloat (meters)

Distance between the two laser pulses

conditionstring

The condition on which to stop the iterative loop. Options are: ‘max_iterations’, stopping after a fixed number of iterations or ‘amplitude_error’, waiting for the residual of the e-field amplitude from laserPos1 to fall below ‘amplitude_error’

max_iterationsint

Maximum number of iterations to perform

amplitude_errorfloat

Residual value for amplitude given as a fraction of the maximum initial amplitude value for laserPos1.

debugboolean (default: False)

if True, the error at each iteration is printed to standard output

Returns:
phase1, phase2ndarray of floats (rad)

Phase profiles of the laser pulse at the locations where laserPos1 and laserPos2 are defined.