! SPOTDIA1 ! This macro uses Point Spread Function data to compute the ! DIFFRACTION SPOT DIAMETER at the 1/e^2 points along the x-axis ! and the y-axis for various scan angles. It also gives the ! ellipticity of the spot and the spot diameter variation ! (computed as a deviation from the average of all spot diameters ! in the scan field). Each of the four 1/e^2 points (x,y) is ! computed separately to preserve the information in the wing ! structure of the curve. Written 1/98 by David Koren, II-VI, Inc. ! Revised 8/98. FORMAT 15.3 title$ = $LENSNAME() date$ = $DATE() A$ = "DIFFRACTION SPOT DIAMETER" PRINT PRINT title$," ", date$ PRINT PRINT A$ PRINT PRINT " CONFIG SCAN ANGLE (x,y) X AXIS Y AXIS ELLIPTICITY" PRINT " degrees microns microns" PRINT SETVECSIZE 20000 bigx = 0 bigy = 0 smalx = 100000 smaly = 100000 nc = NCON() FOR k = 1,nc,1 SETCONFIG (k) GETPSF 0, 1, 2, 1 np = vec1 (0) IF (np == 0) PRINT "PSF Computataion aborted." GOTO 1 ENDIF IF (np == -1) PRINT "SETVECSIZE too small for PSF data." GOTO 1 ENDIF IF (np == -2) PRINT "Not enough system RAM for PSF data." GOTO 1 ENDIF ! The exclamation point can be deleted from the PRINT statement below to print ! the values. !PRINT "There are ", np, " data points, spaced ", vec1 (np+1), "microns apart". nps = SQRT(np) ep = (nps/2)-1 eq = ep*nps xdav=0.0 jmax=0 FOR i = 1, np, 1 IF (vec1(i) > xdav) jmax = i xdav = vec1(i) ENDIF NEXT ! The exclamation point can be deleted from the PRINT statements below to print ! the values. !PRINT "The position of the maximum x value is ", jmax !PRINT "The maximum x value is ", xdav ! Computes the spot radius from the maximum X position to the left side 1/e^2 point. ! flt means 'fraction less than.' FOR i = jmax, jmax-ep, -1 IF (vec1(i) > 0.135) & (vec1(i-1) < 0.135) fltx=(vec1(i)-0.135)/(vec1(i)-vec1(i-1)) srlx=(jmax-((i)-fltx))*(vec1(np+1)) ENDIF NEXT ! Computes the spot radius from the maximum X position to the right side 1/e^2 point. ! fgt means 'fraction greater than.' FOR i = jmax, jmax+ep, 1 IF (vec1(i) > 0.135) & (vec1(i+1) < 0.135) fgtx=(vec1(i)-0.135)/(vec1(i)-vec1(i+1)) srrx=((i+fgtx)-jmax)*(vec1(np+1)) ENDIF NEXT ! Diffraction spot size (x) = spot radius left (x) + spot radius right (x). dssx=srlx+srrx ydav=0.0 kmax=0 FOR i = 1, np, 1 IF (vec1(i) > ydav) kmax = i ydav = vec1(i) ENDIF NEXT ! The exclamation point can be deleted from the PRINT statements below to print ! the values. !PRINT "The position of the maximum y value is ", kmax !PRINT "The maximum y value is ", ydav ! Computes the spot radius from the maximum Y position to the left side 1/e^2 point. ! flt means 'fraction less than.' FOR i = kmax, kmax-eq, -nps IF (vec1(i) > 0.135) & (vec1(i-nps) < 0.135) flty=(vec1(i)-0.135)/(vec1(i)-vec1(i-nps)) srly=(kmax-((i)-(flty*nps)))*(vec1(np+1)/nps) ENDIF NEXT ! Computes the spot radius from the maximum Y position to the right side 1/e^2 point. ! fgt means 'fraction greater than.' FOR i = kmax, kmax+eq, nps IF (vec1(i) > 0.135) & (vec1(i+nps) < 0.135) fgty=(vec1(i)-0.135)/(vec1(i)-vec1(i+nps)) srry=((i+(fgty*nps))-kmax)*(vec1(np+1)/nps) ENDIF NEXT ! Diffraction spot size (y) = spot radius left (y) + spot radius right (y). dssy=srly+srry IF (dssx <= dssy) elip1 = (dssx/dssy) ellipt = elip1 ELSE elip2 = (dssy/dssx) ellipt = elip2 ENDIF PRINT CONF(), PAR3(3), PAR4(8), dssx, dssy, ellipt IF (dssx > bigx) bigx = dssx ENDIF IF (dssy > bigy) bigy = dssy ENDIF IF (dssx < smalx) smalx = dssx ENDIF IF (dssy < smaly) smaly = dssy ENDIF NEXT ! The exclamation point can be deleted from the PRINT statements below to print ! the values. !PRINT bigx,bigy !PRINT smalx,smaly IF (bigx >= bigy) smax = bigx ELSE smax = bigy ENDIF IF (smalx <= smaly) smin = smalx ELSE smin = smaly ENDIF ! The exclamation point can be deleted from the PRINT statement below to print ! the values. !PRINT smax,smin svar = 100*((smax-smin)/(smax+smin)) FORMAT 5.1 PRINT PRINT " The spot diameter variation is +/-",svar, "%" PRINT PRINT " The variation is computed as a deviation from the average" PRINT " of all spot diameters in the scan field." LABEL 1