Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
mbtrack2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
PA
Collective Effects
mbtrack2
Commits
574eff6d
Commit
574eff6d
authored
7 months ago
by
Vadim Gubaidulin
Browse files
Options
Downloads
Patches
Plain Diff
bugfixes
parent
fd592ca3
No related branches found
No related tags found
2 merge requests
!28
0.8.0
,
!16
Nonlinear chromaticity
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
mbtrack2/tracking/element.py
+3
-3
3 additions, 3 deletions
mbtrack2/tracking/element.py
mbtrack2/tracking/synchrotron.py
+12
-7
12 additions, 7 deletions
mbtrack2/tracking/synchrotron.py
with
15 additions
and
10 deletions
mbtrack2/tracking/element.py
+
3
−
3
View file @
574eff6d
...
...
@@ -404,15 +404,15 @@ def transverse_map_sector_generator(ring, positions):
else
:
import
at
def
_compute_chro
(
ring
,
pos
,
dp
=
1e-
4
,
order
=
4
):
def
_compute_chro
(
ring
,
pos
,
dp
=
1e-
2
,
order
=
4
):
lat
=
deepcopy
(
ring
.
optics
.
lattice
)
lat
.
append
(
at
.
Marker
(
"
END
"
))
fit
,
dpa
,
tune
=
at
.
physics
.
nonlinear
.
chromaticity
(
lat
,
method
=
'
linopt
'
,
dpm
=
0.02
,
dpm
=
dp
,
n_points
=
100
,
order
=
order
)
Chrox
,
Chroy
=
fit
Chrox
,
Chroy
=
fit
[
0
,
1
:],
fit
[
1
,
1
:]
chrox
=
np
.
interp
(
pos
,
s
,
Chrox
)
chroy
=
np
.
interp
(
pos
,
s
,
Chroy
)
...
...
This diff is collapsed.
Click to expand it.
mbtrack2/tracking/synchrotron.py
+
12
−
7
View file @
574eff6d
...
...
@@ -388,15 +388,20 @@ class Synchrotron:
self
.
adts
=
[
coef_xx
,
coef_yx
,
coef_xy
,
coef_yy
]
def
get_chroma
(
self
,
order
=
4
,
dpm
=
0.02
,
n_points
=
100
):
"""
Compute and add chromaticity (linear and nonlinear) from AT lattice and update the property.
"""
import
at
fit
,
dpa
,
tune
=
at
.
physics
.
nonlinear
.
chromaticity
(
self
.
ring
.
optics
.
lattice
,
method
=
'
linopt
'
,
dpm
=
0.02
,
n_points
=
100
,
order
=
order
)
fit
,
dpa
,
tune
=
at
.
physics
.
nonlinear
.
chromaticity
(
self
.
optics
.
lattice
,
method
=
'
linopt
'
,
dpm
=
dpm
,
n_points
=
n_points
,
order
=
order
)
chrox
,
chroy
=
fit
return
chrox
,
chroy
self
.
chro
=
[
elem
for
pair
in
zip
(
chrox
[
1
:],
chroy
[
1
:])
for
elem
in
pair
]
return
chrox
[
1
:],
chroy
[
1
:]
def
get_mcf_order
(
self
,
add
=
True
,
show_fit
=
False
):
"""
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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