def beam_source1(): beam = Beam(25000) beam.set_circular_spot(r=1e-4) #beam.set_rectangular_spot(xmax=1e-4, xmin=-1e-4, zmax=1e-4, zmin=1e-4) #beam.set_gaussian_spot(dx=1e-4, dz=1e-4) #beam.set_flat_divergence(dx=25e-6, dz=25e-6) #beam.set_gaussian_divergence(25e-6, 25e-6) beam.set_divergences_collimated() xmax = 0. xmin = -100. ymax = 0.3 ymin = -0.4 zmax = 100. zmin = 0. bound = BoundaryRectangle(xmax=xmax, xmin=xmin, ymax=ymax, ymin=ymin, zmax=zmax, zmin=zmin) return beam, bound
def test_ideal_lens_collimated_beam(self): print( ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> test_ideal_lens_collimated_beam" ) beam = Beam() beam.set_circular_spot(20 * 1e-9) beam.set_divergences_collimated() beam.plot_xz() p = 1. q = 5. lens = Optical_element.initialiaze_as_ideal_lens(p, q, q, q) beam = lens.trace_optical_element(beam) beam.plot_xz() if do_plot: plt.show() assert_almost_equal(np.abs(beam.x).mean(), 0.0, 4) assert_almost_equal(np.abs(beam.z).mean(), 0.0, 4)
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) #b2 = beam.y #b3 = beam.z #beam.y = b3 #beam.z = b2 #beam.x *= 1e6 #beam.z *= 1e6 #beam.plot_xz(0)