How to acces airy disc in ZOS-API

  • 17 January 2023
  • 2 replies


I’m using ZOS-API in python to analyse PSFs using the Huygens and FFT methods. Is there a way to extract the airy radius and return it to Python?



Best answer by David.Nguyen 17 January 2023, 17:37

View original

2 replies

Userlevel 6
Badge +2

Hi Charlotte,


I could be wrong but the Airy radius should be:

To solve this formula you need the wavelength (lambda), and the numerical aperture (NA). Both can be retrieved through the ZOSAPI. Specifically, the ISNA (image-space NA) operand gives you the NA of your system through the Merit Function Editor. In the ZOSAPI you can evaluate a single operand without calculating the entire Merit Function using the Merit Function Editor (MFE) method:

GetOperandValue(MeritOperandType type, int srf, int wave, double Hx, double Hy, double Px, double Py, double Ex, double Ey) 

So, a piece of code like below should return the Airy radius in Python:

# Wavenumber in OpticStudio
wavenumber = 1

# Wavelength [um]
wavelength = TheSystem.SystemData.Wavelengths.GetWavelength(wavenumber).Wavelength

# Retrieve Merit Function Editor (MFE)
mfe = TheSystem.MFE

# Evaluate ISNA (Image-Space NA)
isna = mfe.GetOperandValue(ZOSAPI.Editors.MFE.MeritOperandType.ISNA, 0, 0, 0, 0, 0, 0, 0, 0)

# Calculate Airy radius
airy = 1.22 * wavelength / (2 * isna)

# Display the result

I hope this helps.

Take care,


Thanks David, that works!