lightpipes
lightpipes copied to clipboard
Support for astigmatic beams
As explained in A. Siegman, Lasers, the Hermite-Gaussian modes can be straightforwardly generalized to astigmatic beams: umn(x,y,z) = um(x,z) * un(y,z)
That would be cool if LightPipes could provide native support for that, at least in the GaussBeam class, with wx, wy as input parameters.
I have written this, but it is ugly:
def AstigGaussBeam(Fin, wx, wy, x_shift=0, y_shift=0, tx=0, ty=0):
if wx == wy:
return LightPipes.GaussBeam(Fin=Fin, w0=wx, x_shift=x_shift, y_shift=y_shift, tx=tx, ty=ty)
Ex = LightPipes.GaussBeam(Fin=Fin, w0=wx, x_shift=x_shift, y_shift=0, tx=tx, ty=0)
Ey = LightPipes.GaussBeam(Fin=Fin, w0=wy, x_shift=0, y_shift=y_shift, tx=0, ty=ty)
Ix = LightPipes.Intensity(Ex,0)
Iy = LightPipes.Intensity(Ey,0)
Phix = LightPipes.Phase(Ex)
Phiy = LightPipes.Phase(Ey)
(Nx, Ny) = Ix.shape
nmidx = int(_np.round(Nx/2))
nmidy = int(_np.round(Ny/2))
Ix = Ix[nmidy,:]
Ix = _np.tile(Ix, (Ny, 1))
Iy = Iy[:,nmidx]
Iy = _np.tile(Iy, (Nx, 1)).T
Phix = Phix[nmidy,:]
Phix = _np.tile(Phix, (Ny, 1))
Phiy = Phiy[:,nmidx]
Phiy = _np.tile(Phiy, (Nx, 1)).T
Eout = LightPipes.SubIntensity(Fin=Fin, Intens=sqrt(_np.multiply(Ix,Iy)))
Eout = LightPipes.SubPhase(Fin=Eout, Phi=Phix+Phiy)
return Eout
Have you tried maybe using Zernike polynomials for this purpose? There is Zernike polynomials info in the manual.