fig30 = plt.figure(30) ax31 = fig30.add_subplot(111) ax31.matshow(np.abs(WW_plot)) fig31 = plt.figure(31) ax311 = fig31.add_subplot(111) ax311.matshow(WW_plot - np.diag(np.diag(WW_plot))) fig50 = plt.figure(50) ax51 = fig50.add_subplot(111) fig60 = plt.figure(60) ax61 = fig60.add_subplot(111) import PyECLOUD.mystyle as ms for ii in list(range(0, 200, 1))[::-2]: colorcurr = ms.colorprog(ii, 200) ax51.plot(z_resp, WW_plot[:, ii], color=colorcurr) ax61.plot(z_resp-z_resp[ii], WW_plot[:, ii], '-', color=colorcurr) fig70 = plt.figure(70) ax71 = fig70.add_subplot(111) ax71.matshow(np.abs(MM_plot)) # Plot frequency responde fig80 = plt.figure(80) ax81 = fig80.add_subplot(111) response_ene = np.sum(MM_plot**2, axis=0) response_ene = response_ene/np.max(response_ene) ax81.plot(response_ene[0::2], '.-', label='cosine terms', alpha=.6, markeredgewidth=0, color='C0', lw=3, markersize=10)
pyecl_output_file = '../../testing/tests_buildup/LHC_ArcDipReal_450GeV_sey1.70_2.5e11ppb_bl_1.00ns/Pyecltest_angle3D.mat' #~ pyecl_output_file = '../../testing/tests_buildup/LHC_ArcDipReal_450GeV_sey1.70_2.5e11ppb_bl_1.00ns_change_s_and_E0/Pyecltest_angle3D.mat' pyecl_output_file = '../../testing/tests_buildup/LHC_ArcDipReal_450GeV_sey1.70_2.5e11ppb_bl_1.00ns_seyfromfile/Pyecltest_angle3D.mat' ob = mlo.myloadmat_to_obj(pyecl_output_file) pl.close('all') ms.mystyle_arial() fig1 = pl.figure(1, figsize=(2 * 8, 6)) fig1.set_facecolor('w') sp1 = fig1.add_subplot(1, 2, 1) sp2 = fig1.add_subplot(1, 2, 2, sharex=sp1) for i_ct, ct in enumerate(ob.sey_test_cos_theta): thiscol = ms.colorprog(i_ct, len(ob.sey_test_cos_theta)) label = 'costheta=%.2f' % ct sp1.plot(ob.sey_test_E_impact_eV, ob.sey_test_del_true_mat[i_ct, :], color=thiscol, label=label) sp2.plot(ob.sey_test_E_impact_eV, ob.sey_test_del_elast_mat[i_ct, :], color=thiscol, label=label) sp2.legend(loc='best', prop={'size': 14}) sp1.set_ylabel('Delta true') sp2.set_ylabel('Delta elast') for sp in [sp1, sp2]:
secondary_angle_distribution='cosine_3D') Q_Qmax_test_vect = np.linspace(0, 1, 6) E_test = np.linspace(0, 1600, 10000) plt.close('all') ms.mystyle_arial(fontsz=16) fig1 = plt.figure(1) fig1.set_facecolor('w') ax1 = fig1.add_subplot(1, 1, 1) for iq, Q_Qmax in enumerate(Q_Qmax_test_vect): colorcurr = ms.colorprog(iq, len(Q_Qmax_test_vect), cm='rainbow') semod.Q_segments[:] = Q_Qmax * semod.Q_max_segments yiel, flag_elast, flag_truesec = semod.SEY_process( nel_impact=E_test * 0 + 1., E_impact_eV=E_test, costheta_impact=E_test * 0 + 1., i_impact=np.int_(E_test * 0 + 1)) ax1.plot(E_test, yiel, label='%.2f' % Q_Qmax, linewidth=2, color=colorcurr) ax1.grid(True) ax1.set_xlabel('Energy [eV]') ax1.set_ylabel('Secondary Electron Yield') ax1.legend(loc='lower right', prop={'size': 16}, title='Q/Qmax', ncol=2)
ob = mlo.myloadmat_to_obj('./Pyecltest.mat') mid_x = 0.5 * (ob.Vx[1:] + ob.Vx[:-1]) Dx_plot = 2e-3 x_spectrum = np.arange(0., np.max(mid_x), Dx_plot) spectra = [] for ii, xx in enumerate(x_spectrum): mask = np.abs(mid_x - xx) < Dx_plot # It is meant to overlap a bit spec = np.sum(np.sum(ob.En_hist_seg[mask, :, :], axis=0), axis=0) spec /= np.sum(spec) spectra.append(spec) fig10 = plt.figure(10) for ii, xx in enumerate(x_spectrum): col = ms.colorprog(ii, len(x_spectrum)) plt.semilogy(ob.En_g_hist, spectra[ii], color=col, linewidth=2., label='%.1f mm' % (xx * 1e3)) plt.legend() fig = pl.figure(1) pl.plot(ob.t, ob.Nel_timep, linewidth=2) pl.xlabel('Time [s]') pl.ylabel('Number of $e^-$ per unit length [$m^{-1}$]') ms.scix() pl.grid('on') pl.suptitle( 'Var. name: Nel_timep\nNumber of electrons in the chamber at each time step'
E_impact_eV_test = np.array( list(np.arange(0, 499., 1.)) + list(np.arange(500., 2000, 5))) cos_theta_test = np.linspace(0, 1., 10) del_true_mat, del_elast_mat = impact_man.extract_sey_curves( n_rep, E_impact_eV_test, cos_theta_test) pl.close('all') ms.mystyle_arial() fig1 = pl.figure(1, figsize=(2 * 8, 6)) fig1.set_facecolor('w') sp1 = fig1.add_subplot(1, 2, 1) sp2 = fig1.add_subplot(1, 2, 2, sharex=sp1) for i_ct, ct in enumerate(cos_theta_test): thiscol = ms.colorprog(i_ct, len(cos_theta_test)) label = 'costheta=%.2f' % ct sp1.plot(E_impact_eV_test, del_true_mat[i_ct, :], color=thiscol, label=label) sp2.plot(E_impact_eV_test, del_elast_mat[i_ct, :], color=thiscol, label=label) sp2.legend(loc='best', prop={'size': 14}) sp1.set_ylabel('Delta true') sp2.set_ylabel('Delta elast') for sp in [sp1, sp2]: