Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
PythonControl
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
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
PA
Operation
PythonControl
Commits
c83447ed
Commit
c83447ed
authored
3 weeks ago
by
Vadim Gubaidulin
Browse files
Options
Downloads
Patches
Plain Diff
Improved logging for beam current scan
parent
5d731b88
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
pythoncontrol/measurements/beam_current_scan.py
+13
-5
13 additions, 5 deletions
pythoncontrol/measurements/beam_current_scan.py
with
13 additions
and
5 deletions
pythoncontrol/measurements/beam_current_scan.py
+
13
−
5
View file @
c83447ed
...
@@ -93,28 +93,34 @@ class InstabilityThresholdMeasurement:
...
@@ -93,28 +93,34 @@ class InstabilityThresholdMeasurement:
raise
ValueError
(
'
max_emittance must to be specified if
\
raise
ValueError
(
'
max_emittance must to be specified if
\
stop_at_max_emit is True
'
)
stop_at_max_emit is True
'
)
FBT_gain
=
self
.
fbt
.
get_gain
()
FBT_gain
=
self
.
fbt
.
get_gain
()
logger
.
info
(
f
"
FBT gain is
{
FBT_gain
}
"
)
# Measurement loop
# Measurement loop
count
=
0
count
=
0
max_current
=
0
max_current
=
0
logger
.
info
(
"
Starting beam current increase
"
)
while
self
.
beam_parameters
.
get_dcct
()
<
goal_current
:
while
self
.
beam_parameters
.
get_dcct
()
<
goal_current
:
if
FBT_on_off
:
if
FBT_on_off
:
self
.
fbt
.
set_gain
(
FBT_gain
)
self
.
fbt
.
set_gain
(
FBT_gain
)
logger
.
info
(
f
"
Current
:
{
self
.
beam_parameters
.
get_dcct
()
}
mA
"
)
logger
.
info
(
f
"
Current
before injection is
{
self
.
beam_parameters
.
get_dcct
()
}
mA
"
)
inject_beam
(
booster_cav
)
inject_beam
(
booster_cav
)
inject_beam
(
booster_cav
)
inject_beam
(
booster_cav
)
sleep
(
3
)
sleep
(
3
)
logger
.
info
(
f
"
Current after injection is
\
{
self
.
beam_parameters
.
get_dcct
()
}
ma
"
)
if
FBT_on_off
:
if
FBT_on_off
:
if
measurement_plane
==
"
V
"
:
if
measurement_plane
==
"
V
"
:
logger
.
info
(
f
"
Setting vertical FBT gain to 0
"
)
self
.
fbt
.
set_gain
(
0
,
FBT_gain
[
1
])
self
.
fbt
.
set_gain
(
0
,
FBT_gain
[
1
])
elif
measurement_plane
==
"
H
"
:
elif
measurement_plane
==
"
H
"
:
logger
.
info
(
f
"
Setting horizontal FBT gain to 0
"
)
self
.
fbt
.
set_gain
(
FBT_gain
[
0
],
0
)
self
.
fbt
.
set_gain
(
FBT_gain
[
0
],
0
)
else
:
else
:
raise
ValueError
(
"
FBT_plane must be
'
V
'
or
'
H
'
.
"
)
raise
ValueError
(
"
FBT_plane must be
'
V
'
or
'
H
'
.
"
)
logger
.
info
(
'
Recording intermediate measurement data
'
)
self
.
beam_parameters
.
record_data
(
self
.
filename
)
self
.
beam_parameters
.
record_data
(
self
.
filename
)
self
.
tune
.
record_data
(
self
.
filename
)
self
.
tune
.
record_data
(
self
.
filename
)
...
@@ -145,6 +151,7 @@ class InstabilityThresholdMeasurement:
...
@@ -145,6 +151,7 @@ class InstabilityThresholdMeasurement:
logger
.
info
(
"
Emittance blow-up detected, exiting loop.
"
)
logger
.
info
(
"
Emittance blow-up detected, exiting loop.
"
)
return
True
return
True
return
False
return
False
def
scan_vs_chromaticity
(
self
,
chromaticities
,
booster_cav
,
def
scan_vs_chromaticity
(
self
,
chromaticities
,
booster_cav
,
FBT_on_off
=
False
,
measurement_plane
=
"
V
"
):
FBT_on_off
=
False
,
measurement_plane
=
"
V
"
):
"""
"""
...
@@ -166,7 +173,8 @@ class InstabilityThresholdMeasurement:
...
@@ -166,7 +173,8 @@ class InstabilityThresholdMeasurement:
measurement_plane
=
measurement_plane
,
measurement_plane
=
measurement_plane
,
N_current_increase
=
5
,
N_current_increase
=
5
,
chro_measurement
=
False
)
chro_measurement
=
False
)
logger
.
info
(
"
Completed threshold current measurement for chromaticity %s
"
,
chro
)
logger
.
info
(
f
"
Completed threshold current measurement for
\
chromaticity
{
chro
}
"
,)
# def beam_current_scan_step(file,
# def beam_current_scan_step(file,
...
...
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