Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def plotradialevolutionFunc(cam, axicon, begin, end, number):
- xDim = cam.pixelSize_x * cam.resolution_x
- yDim = cam.pixelSize_y * cam.resolution_y
- x = np.linspace(-xDim / 2, xDim / 2, cam.resolution_x)
- y = np.linspace(-yDim / 2, yDim / 2, cam.resolution_y)
- X, Y = np.meshgrid(x, y)
- R = np.sqrt(X ** 2 + Y ** 2)
- fig, ax = plt.subplots()
- number_list = np.linspace(begin, end, number)
- def animate(i):
- ax.clear()
- Z = np.real(axicon.calc_diffraction(R, i))
- ax.set_aspect('equal')
- ax.contourf(X, Y, Z, 20)
- ax.tick_params(direction='inout', length=8, width=1, pad=8, labelsize=18, top=False, right=False)
- return [ax]
- anim = animation.FuncAnimation(fig, animate, frames=number_list, interval=10, blit=True, repeat=True, repeat_delay=100)
- plt.show()
- def plotradialevolutionArtist(cam, axicon, begin, end, number):
- xDim = cam.pixelSize_x * cam.resolution_x
- yDim = cam.pixelSize_y * cam.resolution_y
- x = np.linspace(-xDim / 2, xDim / 2, cam.resolution_x)
- y = np.linspace(-yDim / 2, yDim / 2, cam.resolution_y)
- X, Y = np.meshgrid(x, y)
- R = np.sqrt(X ** 2 + Y ** 2)
- fig, ax = plt.subplots()
- number_list = np.linspace(begin, end, number)
- ims = []
- for i in number_list:
- Z = np.real(axicon.calc_diffraction(R, i))
- ax.set_aspect('equal')
- ax.contourf(X, Y, Z, 20)
- ax.tick_params(direction='inout', length=8, width=1, pad=8, labelsize=18, top=False, right=False)
- ims.append([ax])
- anim = animation.ArtistAnimation(fig, ims, interval=100, blit=True, repeat=True, repeat_delay=100)
- plt.show()
Add Comment
Please, Sign In to add comment