Skip to main content

Hi,

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?

 

Thanks David, that works!


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 hum]
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
print(airy)

I hope this helps.

Take care,


David


Reply