Spaces:
Sleeping
Sleeping
Update zern_generator.py
Browse files35 unmodified lines363738394041429 unmodified lines52535455565758596035 unmodified linesdef generate_batch(resolution):term = ["PISTON","V-TILT","H-TILT","DEFOCUS0","O-PR.ASTIGMATISM","V-PR.ASTIGMATISM","V-PR.COMA","H-PR.COMA","V-TREFOIL","O-TREFOIL","P-SPHERICAL","O-SC.ASTIGMATISM","V-SC.ASTIGMATISM","V-QUADRAFOIL","O-QUADRAFOIL","V-SC.COMA","H-SC.COMA","V-SC-TREFOIL","O-SC-TREFOIL","O-PENTAFOIL","V-PENTAFOIL"]ddx = np.linspace(*span, resolution)ddy = np.linspace(*span, resolution)xv, yv = np.meshgrid(ddx, ddy)9 unmodified lineszern = [0] * (zern_index - 1) + [1]ax = plt.subplot2grid((5, 6), (i, j))Phi = generate_zern_wavefront(xv, yv, zern)ax.set_title(f"Zernike {zern_index-1} \n {term[i]} ")ax.imshow(Phi, extent=(*span, *span), cmap='gray')zern_index += 1plt.show()return fig35 unmodified lines363738394041429 unmodified lines52535455565758596035 unmodified linesdef generate_batch(resolution):term = ["PISTON","V-TILT","H-TILT","DEFOCUS","O-PR-ASTIGMATISM","V-PR-ASTIGMATISM","V-PR-COMA","H-PR-COMA","V-TREFOIL","O-TREFOIL","P-SPHERICAL","O-SC-ASTIGMATISM","V-SC-ASTIGMATISM","V-QUADRAFOIL","O-QUADRAFOIL","V-SC-COMA","H-SC-COMA","V-SC-TREFOIL","O-SC-TREFOIL","O-PENTAFOIL","V-PENTAFOIL"]ddx = np.linspace(*span, resolution)ddy = np.linspace(*span, resolution)xv, yv = np.meshgrid(ddx, ddy)9 unmodified lineszern = [0] * (zern_index - 1) + [1]ax = plt.subplot2grid((5, 6), (i, j))Phi = generate_zern_wavefront(xv, yv, zern)ax.set_title(f" \n Zernike {zern_index-1} — {term[i]} ")ax.imshow(Phi, extent=(*span, *span), cmap='gray')zern_index += 1plt.show()—return fig
zern_generator.py+3-3