def test_duplicate(self): print(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> test_duplicate") b1=Beam() b2=b1.duplicate() assert_almost_equal(b1.x, b2.x ,9) assert_almost_equal(b1.y, b2.y ,9) assert_almost_equal(b1.z, b2.z ,9) assert_almost_equal(b1.vx,b2.vx,9) assert_almost_equal(b1.vy,b2.vy,9) assert_almost_equal(b1.vz,b2.vz,9)
area = [Beam(), Beam(), Beam(), Beam(), Beam()] bins_list = [1, 2, 3, 4, 5] y_list = [1, 2, 3, 4, 5] date = "dati/Moretti/" + "M.Moretti " + time.strftime( "%d-%m-%y at %H:%M:%S") + ".h5" f = h5py.File(date, 'w') f.close() Nn = 7 for i in range(Nn): beam = beam1.duplicate() alpha = round(-0.03 + 0.01 * i, 3) print(alpha) f = h5py.File(date, 'a') f1 = f.create_group(str(alpha)) montel = CompoundOpticalElement.initialize_as_montel_parabolic( p=0.351, q=1., theta=theta(), bound1=bound, bound2=bound, angle_of_mismatch=alpha) beam = montel.trace_montel(beam, f1)
ymin=ymin, zmax=zmax, zmin=zmin) b = [0] * 7 salpha = [0] * 7 bins_list = [1, 2, 3, 4, 5] y_list = [1, 2, 3, 4, 5] Nn = 7 for i in range(Nn): print("iteration %d" % i) beam = beam0.duplicate() alpha = (-0.03 + 0.01 * i) * np.pi / 180 print(alpha) salpha[i] = str(round(-0.03 + 0.01 * i, 3)) montel = CompoundOpticalElement.initialize_as_montel_parabolic( p=0.351, q=1., theta_z=theta(), bound1=bound, bound2=bound, angle_of_mismatch=alpha, infinity_location='q') beam1, beam2, beam3 = montel.trace_montel(beam, print_footprint=0, mode=1)