Skip to content
Snippets Groups Projects
Commit 53ab1dd5 authored by Claudio Scafuri's avatar Claudio Scafuri :speech_balloon:
Browse files

testing

parent da71ec54
No related branches found
No related tags found
No related merge requests found
......@@ -56,22 +56,22 @@ mp.title('orb_x' )
mp.show()
print('tune H:',tuneH,'tune V:',tuneV)
print('chrom H:',chromH,' chromV:', chromV)
prinpt('E:', e_eV/1e9,' GeV')
print('E:', e_eV/1e9,' GeV')
# find index in ring strucutre a specific quadrupole
iq = ring.uint32_refpts('QD_S05_02')[0] # use also pattern matching idf needed
iq = ring.uint32_refpts('QD_S05.02')[0] # use also pattern matching idf needed
# get transport matrxi of 'QD_S05_02')
TM = at.find_elem_m66(ring[iq]) # get 6x6 transport materix
print(TM)
# get global ring parameters
ring.radiation_on()
ringparams = ring.radiation_parameters()
ringparams = ring.envelope_parameters(params=ringparams)
print(ringparams)
ringparams2 = ring.envelope_parameters(params=ringparams)
print(ringparams2)
......@@ -4,7 +4,7 @@ import at
import matplotlib.pylab as mp
ring=at.load_lattice("../../machine/lattice/elettra/elettra_strS4.m",energy=2.4e9)
#ring=at.load_lattice("../../machine/lattice/elettra/srlattice_with_aper_SCW.m",energy=2.0e9)
refpts = range(len(ring) + 1)
ring.radiation_off()
elemdata0, ringdata,elemdata=at.linopt6(ring,refpts,0.001)
......
This diff is collapsed.
This diff is collapsed.
......@@ -6,6 +6,7 @@
import at
import at.plot
import at.tracking
import numpy as np
import matplotlib.pyplot as plt
......@@ -76,7 +77,7 @@ p_in.shape
# In[8]:
get_ipython().run_line_magic('pinfo', 'ring.track')
#get_ipython().run_line_magic('pinfo', 'ring.track')
# In[9]:
......@@ -85,14 +86,14 @@ get_ipython().run_line_magic('pinfo', 'ring.track')
# Method 1, the output of the tracking is a big array with shape (6, N, R, T)
# where 6 is the particle coordinate, N is the particle index, R is the element index,
# and T is the turn number
pout, *_ = ring.track(p_in, refpts=np.arange(len(ring)), nturns=200)
pout, *_ = at.lattice_pass(ring,p_in, refpts=np.arange(len(ring)), nturns=200)
# In[10]:
tunex, tuney = ring.get_tune()
xdat = pout[0,0,0,:]
xdat = pout[0,0,:]
fig, (ax1,ax2) = plt.subplots(2,1)
ax1.plot(xdat)
ax2.plot(np.fft.rfftfreq(len(xdat)), np.abs(np.fft.rfft(xdat)))
......@@ -111,7 +112,7 @@ n_turns=200
x_data = np.zeros((p_in.shape[1], n_turns))
xp_data = np.zeros((p_in.shape[1], n_turns))
for i in np.arange(n_turns):
_ = ring.track(p_in, nturns=1, in_place=True, refpts=None) #in_place means modify input particle, refpts=None stops the track function from generating big arrays for unneeded output
_ = at.lattice_pass(ring,p_in, nturns=1, refpts=None) #in_place means modify input particle, refpts=None stops the track function from generating big arrays for unneeded output
x_data[:, i] = p_in[0,:]
xp_data[:, i] = p_in[1,:]
......@@ -162,7 +163,7 @@ plt.show()
# In[15]:
get_ipython().run_line_magic('pinfo', 'at.get_optics')
#get_ipython().run_line_magic('pinfo', 'at.get_optics')
# In[16]:
......@@ -192,7 +193,7 @@ plt.show()
# In[18]:
get_ipython().run_line_magic('pinfo', 'at.find_orbit4')
#get_ipython().run_line_magic('pinfo', 'at.find_orbit4')
# # Orbit Correction
......@@ -386,7 +387,7 @@ half_arc.plot_beta(twiss_in=ld0)
# In[34]:
get_ipython().run_line_magic('pinfo', 'at.Variable')
#get_ipython().run_line_magic('pinfo', 'at.Variable')
# In[35]:
......@@ -449,7 +450,7 @@ new_lat.plot_beta(twiss_in=ld0)
# In[41]:
get_ipython().run_line_magic('pinfo', 'constr.add')
#get_ipython().run_line_magic('pinfo', 'constr.add')
# ## Dynamic Aperture
......@@ -465,7 +466,7 @@ get_ipython().run_line_magic('pinfo', 'constr.add')
# In[42]:
get_ipython().run_line_magic('pinfo', 'at.get_acceptance')
#get_ipython().run_line_magic('pinfo', 'at.get_acceptance')
# In[43]:
......
No preview for this file type
No preview for this file type
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment