plt.close('all') n_mp_slice = 25000 intensity = 1.2e11 epsn_x = 2.5e-6 epsn_y = 2.5e-6 sigma_z = 9.7e-2 n_slices = 150 n_mp_bunch = n_mp_slice * n_slices long_unif = True ################# # Build machine # ################# machine = LHC_custom.LHC(n_segments=1, machine_configuration='HLLHC-injection') ################ # Make a bunch # ################ bunch = machine.generate_6D_Gaussian_bunch(n_mp_bunch, intensity, epsn_x, epsn_y, sigma_z) if long_unif: bunch.z = 4 * sigma_z * (np.random.rand(len(bunch.z)) - 0.5) ########## # Slicer # ########## slicer = UniformBinSlicer(n_slices=n_slices, z_cuts=(-pp.z_cut, pp.z_cut))
plt.close('all') plt.rcParams.update({'font.size': 12}) figglob = plt.figure(1) axglob = figglob.add_subplot(111) axdistrlist = [] figfplist = [] for ifol, folder in enumerate(folders): pars = extract_info_from_sim_param(folder + '/Simulation_parameters.py') machine = LHC_custom.LHC( n_segments=1, machine_configuration=pars['machine_configuration'], beta_x=pars['beta_x'], beta_y=pars['beta_y'], accQ_x=pars['Q_x'], accQ_y=pars['Q_y'], Qp_x=pars['Qp_x'], Qp_y=pars['Qp_y'], octupole_knob=pars['octupole_knob'], optics_dict=None, V_RF=pars['V_RF']) Qs = machine.longitudinal_map.Q_s Qx = machine.transverse_map.accQ_x Qy = machine.transverse_map.accQ_y frac_qx, _ = math.modf(Qx) frac_qy, _ = math.modf(Qy) filename_footprint = 'footprint.h5' ob = mfm.object_with_arrays_and_scalar_from_h5(folder + '/' + filename_footprint)
titlestr = labels[ifol] if fname is not None: titlestr += (' - ' + fname) if flag_compact: plt.suptitle(titlestr, x=0.1, horizontalalignment='left') else: plt.suptitle(titlestr) # Get Qx Qs machine = LHC_custom.LHC(n_segments=1, machine_configuration=pars.machine_configuration, beta_x=pars.beta_x, beta_y=pars.beta_y, accQ_x=pars.Q_x, accQ_y=pars.Q_y, Qp_x=pars.Qp_x, Qp_y=pars.Qp_y, octupole_knob=pars.octupole_knob, optics_dict=None, V_RF=pars.V_RF) Qs = machine.longitudinal_map.Q_s Qx = machine.transverse_map.accQ_x frac_qx, _ = math.modf(Qx) text_info = 'Tune machine: %.4f'%frac_qx +\ '\nSynchrotron tune: %.3fe-3 (V_RF: %.1f MV)'%(Qs*1e3, pars.V_RF*1e-6) +\ '\nTune centroid: %.4f (%.2fe-3)\n'%(tune_centroid, 1e3*tune_centroid-frac_qx*1e3) if not flag_no_slice: text_info += f'Mode {i_mode}, {n_osc_axis[i_mode]:.2f} oscillations ' +\ {False: "(most unstable)", True: "(forced)"}[forced] + '\n'+\