Hi Kibru,
Yes, you can simply use the PSF Cross Section with different thicknesses on the last surface in the LDE and then “stack” them all together to get the Y-Z or X-Z through-focus PSF.
The few things to keep in mind are:
- You have to use Huygens PSF Cross Section (FFT PSF is calculated in pupil space and therefore there is no “common” coordinate system between different PSF slices)
- For off-axis points that have a large image-space angle, you will need to shift each PSF slice so the Center coordinates align
- You need to make sure the Normalize box is unchecked
To automate this, I would suggest using the ZOS-API to change the defocus, run the Huygens PSF Cross Section, and create the PSF stack. The 5 supported languages for the ZOS-API are Python, C#, Matlab, Mathematica, and C++ (the first 4 connect via .NET while C++ connects using COM); I have not seen any user on the forum who has dealt with Julia yet so it might take a little effort to connect the ZOS-API to Julia.
@MichaelH Thank you very much.
Which one is used for depth of field? first surface or last surface thickness?
I used ZPL macro to change the object focus, run Huygens PSF, and create the PSF stacks. But, I am not sure if ZPL gives the same result as ZOS-API.