rsc_wp#
- pyrost.bin.rsc_wp(wft: numpy.ndarray, dx0: float, dx: float, z: float, wl: float, axis: int = - 1, backend: str = 'numpy', num_threads: int = 1)#
Wavefront propagator based on Rayleigh-Sommerfeld convolution method [RSC]. Propagates a wavefront wft by z distance downstream. You can choose between ‘fftw’ and ‘numpy’ backends for FFT calculations.
- Parameters
wft (numpy.ndarray) – Initial wavefront.
dx0 (float) – Sampling interval at the plane upstream [um].
dx (float) – Sampling interval at the plane downstream [um].
z (float) – Propagation distance [um].
wl (float) – Incoming beam’s wavelength [um].
axis (int) – Axis of wft array along which the calculation is performed.
backend (str) – Choose between numpy (‘numpy’) or FFTW (‘fftw’) library for the FFT implementation.
num_threads (int) – Number of threads used in the calculations.
- Returns
Propagated wavefront.
- Raises
RuntimeError – If ‘numpy’ backend exits with eror during the calculation.
ValueError – If backend option is invalid.
- Return type
Notes
The Rayleigh-Sommerfeld diffraction integral transform is defined as:
\[u^{\prime}(x^{\prime}) = \frac{z}{j \sqrt{\lambda}} \int_{-\infty}^{+\infty} u(x) \mathrm{exp} \left[-j k r(x, x^{\prime}) \right] dx\]with
\[r(x, x^{\prime}) = \left[ (x - x^{\prime})^2 + z^2 \right]^{1 / 2}\]References
- RSC
V. Nascov and P. C. Logofătu, “Fast computation algorithm for the Rayleigh-Sommerfeld diffraction formula using a type of scaled convolution,” Appl. Opt. 48, 4310-4319 (2009).