optics.propagators¶
Free-space propagator classes.
Functions
|
Compute the N-dimensional discrete Fourier Transform |
|
Compute the N-dimensional inverse discrete Fourier transform |
Classes
|
|
|
Free space Fresnel wave propagator |
|
Free space wave propagator |
- class optics.propagators.Propagator(input_shape, dx, wavelength, z)[source]¶
Bases:
object
Free space wave propagator
Propagates a planar source field, \(U(x, y, 0)\) a distance \(z\), computed via the exact transfer function given by (Eq. 5-4, [1])
\[U(x, y, z) = \mathcal{F}^{-1} \left( \mathcal{F}(U(x,y,0)) \times e^{j 2 \pi z / \lambda \sqrt{1 - (\lambda f_x)^2 - (\lambda f_x)^2}} \right) \;,\]where the \(\mathcal{F}\) is the Fourier transform, implemented by
numpy.fft.fftn()
.
- class optics.propagators.FresnelPropagator(input_shape, dx, wavelength, z)[source]¶
Bases:
Propagator
Free space Fresnel wave propagator
Propagates a planar source field, \(U(x, y, 0)\) a distance \(z\), computed via the Fresnel transfer function given by (Eq. 5-3, [1])
\[U(x, y, z) = \mathcal{F}^{-1} \left( \mathcal{F} (U(x,y,0)) \times \, e^{j2\pi z / \lambda} \times e^{-j\pi \lambda z (f_x^2 + f_y^2)} \right) \;,\]where the \(\mathcal{F}\) is the Fourier transform, implemented by
numpy.fft.fftn()
.
- optics.propagators.fft(x, output_shape=None, axes=None, norm='ortho')[source]¶
Compute the N-dimensional discrete Fourier Transform
- Parameters:
x (
ndarray
) – Input arrayoutput_shape (
Optional
[Sequence
[int
]]) – Shape of output array. Defaults to input shape.axes (
Optional
[Sequence
[int
]]) – Axes over which to compute the FFT. Defaults to all axes.norm (
Optional
[str
]) – Method of normalizing FFT. Either “backward”, “ortho”, “forward”. Defaults to “ortho”.
- Return type:
- Returns:
out – Output array
- optics.propagators.ifft(x, output_shape=None, axes=None, norm='ortho')[source]¶
Compute the N-dimensional inverse discrete Fourier transform
- Parameters:
x (
ndarray
) – Input arrayoutput_shape (
Optional
[Sequence
[int
]]) – Shape of output array. Defaults to input shape.axes (
Optional
[Sequence
[int
]]) – Axes over which to compute the FFT. Defaults to all axes.norm (
Optional
[str
]) – Method of normalizing FFT. Either “backward”, “ortho”, “forward”. Defaults to “ortho”.
- Return type:
- Returns:
out – Output array