def example_montel_elliptical(): print( ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> example_montel_elliptical") beam = Beam(25000) beam.set_flat_divergence(25 * 1e-6, 25 * 1e-6) beam.set_rectangular_spot(xmax=25 * 1e-6, xmin=-25 * 1e-6, zmax=5 * 1e-6, zmin=-5 * 1e-6) beam.set_gaussian_divergence(25 * 1e-4, 25 * 1e-4) beam.flag *= 0 p = 5. q = 15. #theta = np.pi/2 - 0.15 theta = 85. * np.pi / 180 xmax = 0. xmin = -0.3 ymax = 0.1 ymin = -0.1 zmax = 0.3 zmin = 0. bound1 = BoundaryRectangle(xmax, xmin, ymax, ymin, zmax, zmin) bound2 = BoundaryRectangle(xmax, xmin, ymax, ymin, zmax, zmin) montel = CompoundOpticalElement.initialize_as_montel_ellipsoid( p=p, q=q, theta=theta, bound1=bound1, bound2=bound2) beam03 = montel.trace_montel(beam) print(beam03[2].N / 25000) plt.figure() plt.plot(beam03[0].x, beam03[0].z, 'ro') plt.plot(beam03[1].x, beam03[1].z, 'bo') plt.plot(beam03[2].x, beam03[2].z, 'go') plt.xlabel('x axis') plt.ylabel('z axis') plt.axis('equal') beam03[2].plot_xz(0) print("No reflection = %d\nOne reflection = %d\nTwo reflection = %d" % (beam03[0].N, beam03[1].N, beam03[2].N)) plt.show()
def example_wolter_1_microscope(): print( ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> example_wolter_1_microscope" ) p = 13.4 q = 0.300 d = 0.1082882 q1 = 0.67041707 theta1 = 88.8 * np.pi / 180 theta2 = 89. * np.pi / 180 wolter_jap = CompoundOpticalElement.wolter_for_japanese(p=p, q=q, d=d, q1=q1, theta1=theta1, theta2=theta2) beam = Beam() beam.set_gaussian_divergence(5 * 1e-5, 0.00025) beam.set_rectangular_spot(xmax=200 * 1e-6, xmin=-200 * 1e-6, zmax=10 * 1e-6, zmin=-10 * 1e-6) beam.plot_xz(0) plt.title('wolter microscope') beam.plot_xpzp(0) wolter_jap.trace_wolter_japanese(beam) b2 = beam.y b3 = beam.z beam.y = b3 beam.z = b2 beam.plot_xz(0) beam.histogram() plt.show()
d = 1. #0.1082882 q1 = 5. #0.67041707 theta1 = 88.8 * np.pi / 180 theta2 = 88.8 * np.pi / 180 wolter_jap = CompoundOpticalElement.wolter_1_for_microscope(p=p, q=q, d=d, q1=q1, theta1=theta1, theta2=theta2) beam = Beam() beam.set_gaussian_divergence(5 * 1e-5, 0.00025) beam.set_rectangular_spot(xmax=200 * 1e-6, xmin=-200 * 1e-6, zmax=10 * 1e-6, zmin=-10 * 1e-6) #beam.set_divergences_collimated() beam.plot_xz(0) plt.title('wolter microscope') beam.plot_xpzp(0) op_axis = Beam(1) op_axis.set_point(0., 0., 0.) op_axis.set_divergences_collimated() beam = op_axis.merge(beam) beam = wolter_jap.trace_compound(beam)
v = Vector(xp, yp - f, 0.) v.normalization() t = Vector(xp / p, -1, 0.) t.normalization() print((np.arccos(v.dot(t))) * 180. / np.pi) return np.arccos(v.dot(t)) if main == "__Moretti_1__": beam0 = Beam() beam0.set_gaussian_divergence(25. / (2 * np.sqrt(2 * np.log(2))) * 1e-6, 25. / (2 * np.sqrt(2 * np.log(2))) * 1e-6) beam0.set_rectangular_spot(xmax=1e-6, xmin=-1e-6, zmax=1e-6, zmin=-1e-6) xmax = 0.0 xmin = -0.1 ymax = 0.150 ymin = -0.150 zmax = 0.1 zmin = -0.0 bound = BoundaryRectangle(xmax=xmax, xmin=xmin, ymax=ymax, ymin=ymin, zmax=zmax, zmin=zmin) b = [0] * 7
#y.z = - np.tan(theta_grazing) / np.sqrt(2 + (np.tan(theta_grazing))**2) #y.x = np.tan(theta_grazing) / np.sqrt(2 + (np.tan(theta_grazing))**2) #y.y = 1 / np.sqrt(2 + np.tan(theta_grazing)**2) #y.normalization() #print(y.x, y.y, y.z) #print(np.arctan(y.x/y.y)*180/np.pi, np.arctan(y.z/y.y)*180/np.pi) # #alpha = -np.arctan(y.z/y.y) #y.rotation(alpha, 'x') #gamma = np.arctan(y.x/y.y) #y.rotation(gamma, 'z') # #print(y.x, y.y, y.z) beam = Beam() beam.set_rectangular_spot(xmax=0.5e-3, xmin=-0.5e-3, zmax=0.5e-3, zmin=-0.5e-3) beam.set_flat_divergence(500 * 1e-6, 800 * 1e-6) beam.set_divergences_collimated() op_axis = Beam(1) op_axis.set_point(0., 0., 0.) op_axis.set_divergences_collimated() beam = op_axis.merge(beam) xmax = 0.0 xmin = -0.01 ymax = 0.300 ymin = -0.300 zmax = 0.01 zmin = 0.0 bound = BoundaryRectangle(xmax=xmax,