finesse.gaussian.optimise_HG00_q_scipy

finesse.gaussian.optimise_HG00_q_scipy(e, q, homs, accuracy=1e-06, return_fit_result=False, fix_spot_size=False, astigmatic=False, method='nelder-mead')[source]

Computes the optimal complex beam parameter to describe an optical field, described by a vector of HG modes. This optimisation assumes that the field to be optimised is approximately a HG00 beam shape.

The algorithm maximises the amount of HG00 present in a beam by varying the x and y complex beam parameter.

Parameters
earray_like

Array of complex HG mode amplitudes to be optimised

q[complex | finesse.BeamParam] or tuple

x and y complex beam parameter basis that e is in. If a singular value is given qx=qy, else (qx, qy) should be provided.

homslist(tuple(n, m))

List of HG mode indices for each element in e

accuracyfloat, optional

level to suppress HG20 and HG02 modes to

return_fit_resultbool, optional

When True the optimised result from Scipy minimize is returned.

fix_spot_sizebool, optional

When True a non-linear optimiser is used and keeps the spot sized fixed to its current value. Useful for when you expect just the curvature of a beam to be changing.

astigmaticbool, optional

When True the x and y beam parameters will be optimised separately. If you know they should be equal then set this to False.

Returns
qx, qy(finesse.BeamParam, finesse.BeamParam)

Optimised beam parameters

resScipy fit result

optimised HG mode amplitude array, only when return_fit_result == True