odak.wave.fraunhofer_inverse¶
A definition to calculate Inverse Fraunhofer based beam propagation.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
field |
np.complex |
Complex field (MxN). |
required |
k |
odak.wave.wavenumber |
Wave number of a wave, see odak.wave.wavenumber for more. |
required |
distance |
float |
Propagation distance. |
required |
dx |
float |
Size of one single pixel in the field grid (in meters). |
required |
wavelength |
float |
Wavelength of the electric field. |
required |
Returns:
Type | Description |
---|---|
np.complex |
Final complex field (MxN). |
Source code in odak/wave/classical.py
def fraunhofer_inverse(field, k, distance, dx, wavelength):
"""
A definition to calculate Inverse Fraunhofer based beam propagation.
Parameters
----------
field : np.complex
Complex field (MxN).
k : odak.wave.wavenumber
Wave number of a wave, see odak.wave.wavenumber for more.
distance : float
Propagation distance.
dx : float
Size of one single pixel in the field grid (in meters).
wavelength : float
Wavelength of the electric field.
Returns
-------
result : np.complex
Final complex field (MxN).
"""
distance = np.abs(distance)
nv, nu = field.shape
l = nu*dx
l2 = wavelength*distance/dx
dx2 = wavelength*distance/l
fx = np.linspace(-l2/2., l2/2., nu)
fy = np.linspace(-l2/2., l2/2., nv)
FX, FY = np.meshgrid(fx, fy)
FZ = FX**2+FY**2
c = np.exp(1j*k*distance)/(1j*wavelength*distance) * \
np.exp(1j*k/(2*distance)*FZ)
result = np.fft.fftshift(np.fft.ifft2(np.fft.ifftshift(field/dx**2/c)))
return result