import sys, os
BIN = os.path.expanduser("../../../")
sys.path.append(BIN)

import pylab as pl
import numpy as np

import PyECLOUD.myloadmat_to_obj as mlo
import PyECLOUD.mystyle as ms

pl.close('all')
ms.mystyle_arial(fontsz=16)
dpiset = 200

ob=mlo.myloadmat_to_obj('../../testing/tests_buildup/LHC_ArcDipReal_450GeV_sey1.60_2.5e11ppb_bl_1.00ns/Pyecltest_ref.mat')

ifig = 0

#################################
# Variables saved per time step #
#################################

#8.
ifig+=1; pl.figure(ifig)
pl.plot(ob.t, ob.lam_t_array, linewidth=2)
pl.xlabel('Time [s]')
pl.ylabel('Beam profile [p/m]') 
ms.scix(); pl.grid('on')
pl.suptitle('Var. name: lam_t_array\nBeam density at each time step')
pl.subplots_adjust(top=.82, bottom=.14)
Beispiel #2
0
lim_dens = [10, 14]
flag_log = True
outp_filname = 'pass%d.avi'%passlist[0]

########

########

qe = 1.60217657e-19
c = 299792458.

i_photog = 0

ms.mystyle_arial(fontsz=fontsz, dist_tick_lab=10)

chamber = mlo.myloadmat_to_obj(folder_sim + '/LHC_chm_ver.mat')
Vx = chamber.Vx
Vy = chamber.Vy

##load output file
obout = mlo.myloadmat_to_obj(folder_sim + '/' + main_outp_filename)
t = obout.t
lam_b1 = obout.lam_t_array
cendens = np.squeeze(obout.cen_density)

#every bunch passage
for pass_ind in passlist:

    filename_rho = 'rho_video/rho_pass%d.mat'%pass_ind
    filename_sc_forces = 'sc_forces/sc_forces_pass%d.mat'%pass_ind
    #new code
Beispiel #3
0
import sys
import os
BIN = os.path.expanduser("../../../../")
sys.path.append(BIN)

import pylab as pl
import numpy as np

import PyECLOUD.myloadmat_to_obj as mlo
import PyECLOUD.mystyle as ms

pl.close('all')
ms.mystyle_arial(fontsz=16)
dpiset = 200

ob = mlo.myloadmat_to_obj('./Pyecltest.mat')

#################################
# Variables saved per time step #
#################################

fig = pl.figure()
pl.plot(ob.t, ob.Nel_timep, linewidth=2)
pl.plot(ob.t, ob.Nelectrons, 'r--', 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'
Beispiel #4
0
import os, sys

BIN = os.path.expanduser(
    "../../../")  # folder containing PyECLOUD, PyPIC, PyKLU
if BIN not in sys.path:
    sys.path.append(BIN)

import PyECLOUD.myloadmat_to_obj as mlm

import matplotlib.pyplot as plt

# obu = mlm.myloadmat_to_obj('LHC_ArcDipReal_450GeV_sey1.70_2.5e11ppb_bl_1.00ns/Pyecltest_angle3D_ref.mat')
# obn = mlm.myloadmat_to_obj('LHC_ArcDipReal_450GeV_sey1.70_2.5e11ppb_bl_1.00ns_nonuniftime/Pyecltest_angle3D.mat')

obu = mlm.myloadmat_to_obj(
    'LHC_ArcDipReal_450GeV_sey1.00_2.5e11ppb_bl_1.00ns_gas_ionization/Pyecltest_angle3D_ref.mat'
)
obn = mlm.myloadmat_to_obj(
    'LHC_ArcDipReal_450GeV_sey1.00_2.5e11ppb_bl_1.00ns_gas_ionization/Pyecltest_angle3D.mat'
)

# obu = mlm.myloadmat_to_obj('LHC_ArcDipReal_6500GeV_sey_1.70_1.1e11ppb_b1_1.00ns/Pyecltest_angle3D_ref.mat')
# obn = mlm.myloadmat_to_obj('LHC_ArcDipReal_6500GeV_sey_1.70_1.1e11ppb_b1_1.00ns/Pyecltest_angle3D.mat')

plt.close('all')
plt.figure(1)
plt.plot(obu.t, obu.Nel_timep, '.-')
plt.plot(obn.t, obn.Nel_timep, '.r')
plt.show()
Beispiel #5
0
BIN = os.path.expanduser("../../../../")
sys.path.append(BIN)

import argparse
import matplotlib.pyplot as plt
import numpy as np
#from colorsys import hsv_to_rgb
import os
import PyECLOUD.myloadmat_to_obj as mlm
import matplotlib.gridspec as gridspec
import PyECLOUD.mystyle as ms

plt.close('all')
ms.mystyle_arial(fontsz=16)

ob = mlm.myloadmat_to_obj(
    './test_saving__iter0.mat')  # load dictionary of the current simulation

N_pass = ob.nel_hist.shape[0]

fig1 = plt.figure(1)
fig1.set_facecolor('w')
plt.pcolormesh(ob.xg_hist, ob.t_hist * 1e6, ob.nel_hist, shading='Gouraud')
plt.axis('tight')

x_bun = 0 * ob.t_hist
x_bun[30:] += 3e-3
plt.plot(x_bun, ob.t_hist * 1e6, '.w', markersize=10.)
plt.xlabel('x [m]')
plt.ylabel('Time [us]')
fig1.subplots_adjust(bottom=.12)
Beispiel #6
0
import numpy as np
import matplotlib.pyplot as pl
import sys
sys.path.append('../../../')

import PyECLOUD.myloadmat_to_obj as mlo
import PyECLOUD.mystyle as ms

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,
Beispiel #7
0
import sys, os
BIN = os.path.expanduser("../../../")
sys.path.append(BIN)

import pylab as pl
import numpy as np

import PyECLOUD.myloadmat_to_obj as mlo
import PyECLOUD.mystyle as ms

pl.close('all')
ms.mystyle_arial(fontsz=16)
dpiset = 200

ob = mlo.myloadmat_to_obj('../../testing/tests_buildup/LHC_ArcDipReal_450GeV_sey1.70_2.5e11ppb_bl_1.00ns/Pyecltest_angle3D_ref.mat')

ifig = 0

#################################
# Variables saved per time step #
#################################

#8.
ifig += 1; pl.figure(ifig)
pl.plot(ob.t, ob.lam_t_array, linewidth=2)
pl.xlabel('Time [s]')
pl.ylabel('Beam profile [p/m]')
ms.scix(); pl.grid('on')
pl.suptitle('Var. name: lam_t_array\nBeam density at each time step')
pl.subplots_adjust(top=.82, bottom=.14)
import sys
import os
BIN = os.path.expanduser("../../../../")
sys.path.append(BIN)

import pylab as pl
import numpy as np

import PyECLOUD.myloadmat_to_obj as mlo
import PyECLOUD.mystyle as ms

pl.close('all')
ms.mystyle_arial(fontsz=16)
dpiset = 200

ob = mlo.myloadmat_to_obj('./Pyecltest.mat')
ob2 = mlo.myloadmat_to_obj('./Pyecltest.mat.ref')
# ob2 = mlo.myloadmat_to_obj('./Pyecltest_excl.mat')

ifig = 0

#################################
# Variables saved per time step #
#################################

# 8.
ifig += 1
pl.figure(ifig)
pl.plot(ob.t, ob.lam_t_array, linewidth=2, label='Furman-Pivi model')
pl.plot(ob2.t, ob2.lam_t_array, '--', linewidth=2, label='ECLOUD model')
pl.xlabel('Time [s]')