Skip to main content
Solved

How to acces airy disc in ZOS-API

  • January 17, 2023
  • 2 replies
  • 151 views

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?

 

Best answer by David.Nguyen

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

I hope this helps.

Take care,


David

View original
Did this topic help you find an answer to your question?

2 replies

David.Nguyen
Luminary
Forum|alt.badge.img+2
  • Luminary
  • 1088 replies
  • Answer
  • January 17, 2023

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

I hope this helps.

Take care,


David


  • Author
  • Single Emitter
  • 1 reply
  • January 17, 2023

Thanks David, that works!


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings