def test_diffraction_grating(): path = OpticalPath() path.append(Lens(3, 16., [5., 1.], theta=30.)) path.append(Lens(10, 16., [8., 3.], theta=15.)) path.append(DiffractionGrating(1.6, 16., [10, 3.], theta=15.)) path.propagate(25) ax = plt.gca() ax.axis('equal') path.plot(ax) plt.show()
def test_imaging_path_with_object(): obj = Object(2.0, theta=15.) path = OpticalPath(obj) path.append(Lens(3, 16., [5., 1.], theta=30.)) path.append(Lens(10, 16., [8., 3.], theta=15.)) path.propagate(20) ax = plt.gca() ax.axis('equal') path.plot(ax) plt.show()
def test_imaging_path(): path = OpticalPath() path.append(Lens(5, 16., [5., 1.], theta=30.)) path.append(Aperture(4, [7., 2.])) path.append(ParabolicMirror(5., 8., [15., 3.], theta=155)) path.append(ParabolicMirror(5., 8., [9., 15.], theta=-45)) path.propagate(15) ax = plt.gca() ax.axis('equal') path.plot(ax) plt.show()
def test_imaging_path_with_diffraction_grating(): raypy2d.elements.plot_blockers = False obj = Object(2.0, n=5) path = OpticalPath(obj) path.append(Lens(3, 16., [3., 0])) path.append(DiffractionGrating(1.6, 16., [8, 0.])) # path.append(Lens(5, 16., [10.,0])) path.append(ParabolicMirror(16., 35., [20, 5.5], theta=160., flipped=True)) # path.append(Lens(3, 16., [15, 1.], theta=10.)) path.propagate(-5) ax = plt.gca() ax.axis('equal') path.plot(ax) plt.show()