Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pyat
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
dt
exercises
pyat
Commits
a23eaa2a
Commit
a23eaa2a
authored
1 year ago
by
Claudio Scafuri
Browse files
Options
Downloads
Patches
Plain Diff
more and more
parent
d9d2ba6c
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
boosterubung.py
+3
-1
3 additions, 1 deletion
boosterubung.py
compare.py
+73
-0
73 additions, 0 deletions
compare.py
elettratest.py
+9
-8
9 additions, 8 deletions
elettratest.py
esrftest.py
+60
-0
60 additions, 0 deletions
esrftest.py
with
145 additions
and
9 deletions
boosterubung.py
+
3
−
1
View file @
a23eaa2a
...
...
@@ -12,6 +12,8 @@ refpts = range(len(ring) + 1)
#--- lionop needs radiation off
ring
.
radiation_off
()
elemdata0
,
tune
,
chrom
,
elemdata
=
at
.
linopt
(
ring
,
0.0001
,
list
(
refpts
))
tuneH
=
tune
[
0
]
tuneV
=
tune
[
1
]
s_pos
=
elemdata
[
'
s_pos
'
]
beta_x
=
elemdata
[
'
beta
'
][:,
0
]
...
...
@@ -52,5 +54,5 @@ mp.xlabel('s [m]')
mp
.
ylabel
(
'
m
'
)
mp
.
title
(
'
orb_x
'
)
mp
.
show
()
print
(
'
tune H:
'
,
tuneH
,
'
tune V:
'
,
tuneV
,
'
tune L:
'
,
tuneL
)
print
(
'
tune H:
'
,
tuneH
,
'
tune V:
'
,
tuneV
)
print
(
'
E:
'
,
e_eV
/
1e9
,
'
GeV
'
)
This diff is collapsed.
Click to expand it.
compare.py
0 → 100755
+
73
−
0
View file @
a23eaa2a
#!/usr/bin/python3
import
at
#import matplotlib.pylab as mp
ring1
=
at
.
load_lattice
(
"
../../machine/lattice/elettra/elettra.m
"
,
energy
=
2.0e9
)
ring2
=
at
.
load_lattice
(
"
../../machine/lattice/elettra/elettra_strS.m
"
,
energy
=
2.0e9
)
len1
=
ring1
.
circumference
len2
=
ring2
.
circumference
print
(
'
circonf. ring S.K.:
'
,
len1
)
print
(
'
circonf. ring hls :
'
,
len2
)
#print(len1,len2," delta: ", len2-len1, "relative delta:" , (len2-len1)/len2)
[
chromH1
,
chromV1
,
chromL1
]
=
ring1
.
get_chrom
()
[
tuneH1
,
tuneV1
,
tuneL1
]
=
ring1
.
get_tune
()
chromH2
,
chromV2
,
chromL2
=
ring2
.
get_chrom
()
tuneH2
,
tuneV2
,
tuneL2
=
ring2
.
get_tune
()
print
(
'
tune H ring S.K:
'
,
tuneH1
,
'
tune V ring S.K.:
'
,
tuneV1
)
print
(
'
tune H ring hls:
'
,
tuneH2
,
'
tune V ring hls.:
'
,
tuneV2
)
print
(
'
eta H ring S.K:
'
,
chromH1
,
'
eta V ring S.K.:
'
,
chromV1
)
print
(
'
eta H ring hls:
'
,
chromH2
,
'
eta V ring hls :
'
,
chromV2
)
#--- lionop needs radiation off
#--- lionop needs radiation off
#quad1refpts = ring1.get_refpts(at.Quadrupole)
#quad2refpts = ring2.get_refpts(at.Quadrupole)
#for ref1 in quad1refpts:
#print(ring1[ref1].FamName,ring1.get_s_pos(ref1)[0])
#print('--------------------------')
#for ref2 in quad2refpts:
#print(ring2[ref2].FamName,ring2.get_s_pos(ref2)[0])
#print('--------------------------')
#corr1refpts = ring1.get_refpts(at.Corrector)
#corr2refpts = ring2.get_refpts(at.Corrector)
#for ref1 in corr1refpts:
#print(ring1[ref1].FamName,ring1.get_s_pos(ref1)[0])
#print('--------------------------')
#for ref2 in corr2refpts:
#print(ring2[ref2].FamName,ring2.get_s_pos(ref2)[0])
#print('--------------------------')
#if len(quad1refpts) != len(quad1refpts):
#print('lattice desc. differ in number of quadrupoles')
#spos1=ring1.get_s_pos(quad1refpts)
#spos2=ring2.get_s_pos(quad2refpts)
#for index in range(len(quad1refpts)):
#s1=spos1[index]
#s2=spos2[index]
#ref1=quad1refpts[index]
#ref2=quad2refpts[index]
#print(s1,s2,s1-s2,ring1[ref1].FamName,ring2[ref2].FamName)
This diff is collapsed.
Click to expand it.
elettratest.py
+
9
−
8
View file @
a23eaa2a
...
...
@@ -3,15 +3,16 @@
import
at
import
matplotlib.pylab
as
mp
ring
=
at
.
load_lattice
(
"
../../machine/lattice/elettra/elettra.m
"
,
energy
=
2.0e9
)
ring
=
at
.
load_lattice
(
"
../../machine/lattice/elettra/elettra
_strS
.m
"
,
energy
=
2.0e9
)
refpts
=
range
(
len
(
ring
)
+
1
)
elemdata0
,
ringdata
,
elemdata
=
at
.
linopt6
(
ring
,
refpts
)
ring
.
radiation_off
()
elemdata0
,
ringdata
,
elemdata
=
at
.
linopt6
(
ring
,
refpts
,
0.001
)
[
chromH
,
chromV
]
=
ring
.
get_chrom
()
[
tuneH
,
tuneV
]
=
ring
.
get_tune
()
#--- lionop needs radiation off
#ring.radiation_off()
#elemdata0, tune, chrom, elemdata=at.linopt(ring,
0.0001,list(
refpts)
)
#elemdata0, tune, chrom, elemdata=at.linopt(ring,refpts)
s_pos
=
elemdata
[
'
s_pos
'
]
beta_x
=
elemdata
[
'
beta
'
][:,
0
]
...
...
@@ -31,8 +32,7 @@ closed_orbit_xp=elemdata['closed_orbit'][:,1]
closed_orbit_y
=
elemdata
[
'
closed_orbit
'
][:,
2
]
closed_orbit_yp
=
elemdata
[
'
closed_orbit
'
][:,
3
]
#[tuneH,tuneV,tuneL]=ring.get_tune()
#[chromH,chromV,chromL]=ring.get_chrom()
e_eV
=
ring
.
energy
...
...
@@ -52,5 +52,6 @@ mp.xlabel('s [m]')
mp
.
ylabel
(
'
m
'
)
mp
.
title
(
'
orb_x
'
)
mp
.
show
()
print
(
'
tune H:
'
,
tuneH
,
'
tune V:
'
,
tuneV
,
'
tune L:
'
,
tuneL
)
print
(
'
tune H:
'
,
tuneH
,
'
tune V:
'
,
tuneV
)
print
(
'
chrom H:
'
,
chromH
,
'
chromV:
'
,
chromV
)
print
(
'
E:
'
,
e_eV
/
1e9
,
'
GeV
'
)
This diff is collapsed.
Click to expand it.
esrftest.py
0 → 100755
+
60
−
0
View file @
a23eaa2a
#!/usr/bin/python3
import
at
import
matplotlib.pylab
as
mp
ring
=
at
.
load_lattice
(
"
../../machine/lattice/other/esrf.m
"
,
energy
=
6.0e9
)
refpts
=
range
(
len
(
ring
)
+
1
)
elemdata0
,
ringdata
,
elemdata
=
at
.
linopt6
(
ring
,
refpts
)
#--- lionop needs radiation off
#ring.radiation_off()
#elemdata0, tune, chrom, elemdata=at.linopt(ring,0.0001,list(refpts))
ring
.
radiation_off
()
[
chromH
,
chromV
]
=
ring
.
get_chrom
()
[
tuneH
,
tuneV
]
=
ring
.
get_tune
()
s_pos
=
elemdata
[
'
s_pos
'
]
beta_x
=
elemdata
[
'
beta
'
][:,
0
]
beta_y
=
elemdata
[
'
beta
'
][:,
1
]
alpha_x
=
elemdata
[
'
alpha
'
][:,
0
]
alpha_y
=
elemdata
[
'
alpha
'
][:,
1
]
dispersion_x
=
elemdata
[
'
dispersion
'
][:,
0
]
dispersion_xp
=
elemdata
[
'
dispersion
'
][:,
1
]
dispersion_y
=
elemdata
[
'
dispersion
'
][:,
2
]
dispersion_yp
=
elemdata
[
'
dispersion
'
][:,
3
]
closed_orbit_x
=
elemdata
[
'
closed_orbit
'
][:,
0
]
closed_orbit_xp
=
elemdata
[
'
closed_orbit
'
][:,
1
]
closed_orbit_y
=
elemdata
[
'
closed_orbit
'
][:,
2
]
closed_orbit_yp
=
elemdata
[
'
closed_orbit
'
][:,
3
]
#[tuneH,tuneV,tuneL]=ring.get_tune()
#[chromH,chromV,chromL]=ring.get_chrom()
e_eV
=
ring
.
energy
mp
.
figure
()
mp
.
subplot
(
211
)
mp
.
plot
(
s_pos
,
beta_x
)
mp
.
plot
(
s_pos
,
beta_y
)
mp
.
plot
(
s_pos
,
dispersion_x
)
mp
.
xlabel
(
'
s [m]
'
)
mp
.
ylabel
(
'
m
'
)
mp
.
title
(
'
beta_x beta_y disp_x
'
)
mp
.
subplot
(
212
)
mp
.
plot
(
s_pos
,
closed_orbit_x
)
mp
.
xlabel
(
'
s [m]
'
)
mp
.
ylabel
(
'
m
'
)
mp
.
title
(
'
orb_x
'
)
mp
.
show
()
print
(
'
tune H:
'
,
tuneH
,
'
tune V:
'
,
tuneV
)
print
(
'
chrom H:
'
,
chromH
,
'
chromV:
'
,
chromV
)
print
(
'
E:
'
,
e_eV
/
1e9
,
'
GeV
'
)
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment