FFT PSF - 2D#
[1]:
from optiland.psf import FFTPSF
from optiland.samples.objectives import CookeTriplet
[2]:
lens = CookeTriplet()
lens.draw()
[2]:
(<Figure size 1000x400 with 1 Axes>, <Axes: xlabel='Z [mm]', ylabel='Y [mm]'>)
[3]:
psf = FFTPSF(lens, field=(0, 0), wavelength=0.55)
psf.view(projection="2d", num_points=256)
C:\Users\kdani\AppData\Local\Temp\ipykernel_20496\3304088282.py:2: UserWarning: The PSF view has a high oversampling factor (5.57). Results may be inaccurate.
psf.view(projection="2d", num_points=256)
[3]:
(<Figure size 700x550 with 2 Axes>,
<Axes: title={'center': 'ScalarFFT PSF'}, xlabel='X (µm)', ylabel='Y (µm)'>)
Cross-sections and line spread function#
view_cross_section plots 1D slices of the PSF through its peak, along x and y. The values come from cross_section, which returns the positions (µm) and the PSF values along one axis. Pass log=True to see the diffraction rings.
[4]:
psf.view_cross_section()
[4]:
(<Figure size 700x450 with 1 Axes>,
<Axes: title={'center': 'ScalarFFT PSF Cross-Section'}, xlabel='Position (µm)', ylabel='Relative Intensity (%)'>)
line_spread_function integrates the PSF along the other axis, so the line spread function integrates to the same total as the PSF.
[5]:
import matplotlib.pyplot as plt
y, lsf = psf.line_spread_function(axis="y")
plt.plot(y, lsf)
plt.xlabel("Y (µm)")
plt.ylabel("Line Spread Function")
plt.grid(True)
plt.show()