import pyzdde.zdde as pyz l = pyz.PyZDDE() l.zDDEInit() l.zSetMacroPath(r"C:\PROGRAMSANDEXPERIMENTS\ZEMAX\Macros") l.zLoadFile(r'C:\Users\Indranil\Documents\ZEMAX\Samples\Sequential\Objectives\Cooke 40 degree field.zmx') l.zGetFile() x,y,_,_ = l.zSpiralSpot(0.0,0.4,1,10,1000) figsize(8,5) # Set figure size of IPython figure # required to have opened the notebook with --pylab inline sp = scatter(x, y, s=5, c='red', linewidth=0.35) grid() ax = gca() ax.set_aspect('equal') # Note that the kernel is going to be busy for a little time hx = 0.0 hy = 0.4 spirals = 100 rays = 6000 xb,yb,_,_ = l.zSpiralSpot(hx,hy,1,spirals,rays) xg,yg,_,_ = l.zSpiralSpot(hx,hy,2,spirals,rays) xr,yr,_,_ = l.zSpiralSpot(hx,hy,3,spirals,rays) figsize(10,6) ax = plt.gca() fig = plt.gcf() ax.set_aspect('equal') ax.scatter(xr,yr,s=5,c='red',linewidth=0.35,zorder=20) ax.scatter(xg,yg,s=5,c='lime',linewidth=0.35,zorder=21) ax.scatter(xb,yb,s=5,c='blue',linewidth=0.35,zorder=22) ax.set_xlabel('x');ax.set_ylabel('y') fig.suptitle('Spiral Spot') ax.grid(color='lightgray', linestyle='-', linewidth=1) ax.ticklabel_format(scilimits=(-2,2)) if l.zPushLensPermission(): l.zPushLens(updateFlag=1) print l.ipzCaptureWindow.__doc__ l.ipzCaptureWindow(1) l.ipzCaptureWindow(2) l.ipzCaptureWindow(3) l.ipzCaptureWindow(4) print l.ipzCaptureWindow2.__doc__ l.ipzCaptureWindow2('Lay') # Ray fan plot (for field 3) l.ipzCaptureWindow2('Ray',gamma=0.4) # FFT PSF (for field 3) l.ipzCaptureWindow2('Fps', gamma=0.85) l.ipzGetTextWindow('Pre') l.zDDEClose()