Skip to main content

分享一个计算惠更斯PSF半峰全宽(FWHM)的宏


yuan.chen
Zemax Staff
Forum|alt.badge.img+3

 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
INPUT "What window is the Huygens PSF Cross Section?",win

fwhm = 0.5

FOR a = 1, 100, 1
    x1 = GETL(win, a + 0, 2)
    x2 = GETL(win, a + 1, 2)
    
    y1 = GETL(win, a + 0, 3)
    y2 = GETL(win, a + 1, 3)
    
    IF (ABSO(x2 - x1) > 0) & (ABSO(y2 - y1) > 0) 
        IF (y2 > 0.5) & (y1 < 0.5)
            left = (fwhm - y1)/((y2 - y1) / (x2 - x1)) + x1
            PRINT "Left:     " , left
        ENDIF
        IF (y2 < 0.5) & (y1 > 0.5)
            right = (fwhm - y1)/((y2 - y1) / (x2 - x1)) + x1
            PRINT "Right:     " , right
        ENDIF
    ENDIF 
NEXT

PRINT "FWHM:      " , (right - left)

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

2 replies

yuan.chen
Zemax Staff
Forum|alt.badge.img+3
  • Author
  • Zemax Staff
  • 274 replies
  • March 31, 2023

有一些假设和前置操作:

PSF只能有一次上升跟下降

窗口设置要勾选Normalize,选择text窗口

运行时要输入PSF窗口的序号

 


yuan.chen
Zemax Staff
Forum|alt.badge.img+3
  • Author
  • Zemax Staff
  • 274 replies
  • March 31, 2023

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