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
1313ca40
Commit
1313ca40
authored
2 years ago
by
Alexis GAMELIN
Browse files
Options
Downloads
Plain Diff
Merge branch 'Courant-Snyder' into develop
parents
f427a152
1bae2f53
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
mbtrack2/tracking/monitors/plotting.py
+27
-2
27 additions, 2 deletions
mbtrack2/tracking/monitors/plotting.py
with
27 additions
and
2 deletions
mbtrack2/tracking/monitors/plotting.py
+
27
−
2
View file @
1313ca40
...
@@ -21,11 +21,12 @@ def plot_beamdata(filenames, dataset="mean", dimension="tau", stat_var="mean",
...
@@ -21,11 +21,12 @@ def plot_beamdata(filenames, dataset="mean", dimension="tau", stat_var="mean",
----------
----------
filenames : str or list of str
filenames : str or list of str
Names of the HDF5 files to be plotted.
Names of the HDF5 files to be plotted.
dataset : {
"
current
"
,
"
emit
"
,
"
mean
"
,
"
std
"
}
dataset : {
"
current
"
,
"
emit
"
,
"
mean
"
,
"
std
"
,
"
cs_invariant
"
}
HDF5 file
'
s dataset to be plotted. The default is
"
mean
"
.
HDF5 file
'
s dataset to be plotted. The default is
"
mean
"
.
dimension : str
dimension : str
The dimension of the dataset to plot:
The dimension of the dataset to plot:
for
"
emit
"
, dimension = {
"
x
"
,
"
y
"
,
"
s
"
},
for
"
emit
"
, dimension = {
"
x
"
,
"
y
"
,
"
s
"
},
for
"
cs_invariant
"
, dimension = {
"
x
"
,
"
y
"
},
for
"
mean
"
and
"
std
"
, dimension = {
"
x
"
,
"
xp
"
,
"
y
"
,
"
yp
"
,
"
tau
"
,
"
delta
"
}.
for
"
mean
"
and
"
std
"
, dimension = {
"
x
"
,
"
xp
"
,
"
y
"
,
"
yp
"
,
"
tau
"
,
"
delta
"
}.
not used if
"
current
"
.
not used if
"
current
"
.
The default is
"
tau
"
.
The default is
"
tau
"
.
...
@@ -76,6 +77,15 @@ def plot_beamdata(filenames, dataset="mean", dimension="tau", stat_var="mean",
...
@@ -76,6 +77,15 @@ def plot_beamdata(filenames, dataset="mean", dimension="tau", stat_var="mean",
elif
stat_var
==
"
std
"
:
elif
stat_var
==
"
std
"
:
y
=
np
.
nanstd
(
data
[
axis
,
bunch_index
,:],
0
)
y
=
np
.
nanstd
(
data
[
axis
,
bunch_index
,:],
0
)
y_label
=
stat_var
+
"
"
+
label
[
axis
]
y_label
=
stat_var
+
"
"
+
label
[
axis
]
elif
dataset
==
"
cs_invariant
"
:
dimension_dict
=
{
"
x
"
:
0
,
"
y
"
:
1
}
axis
=
dimension_dict
[
dimension
]
label
=
[
'
$J_x$ (m)
'
,
'
$J_y$ (m)
'
]
if
stat_var
==
"
mean
"
:
y
=
np
.
nanmean
(
data
[
axis
,
bunch_index
,:],
0
)
elif
stat_var
==
"
std
"
:
y
=
np
.
nanstd
(
data
[
axis
,
bunch_index
,:],
0
)
y_label
=
stat_var
+
"
"
+
label
[
axis
]
elif
dataset
==
"
mean
"
or
dataset
==
"
std
"
:
elif
dataset
==
"
mean
"
or
dataset
==
"
std
"
:
dimension_dict
=
{
"
x
"
:
0
,
"
xp
"
:
1
,
"
y
"
:
2
,
"
yp
"
:
3
,
"
tau
"
:
4
,
dimension_dict
=
{
"
x
"
:
0
,
"
xp
"
:
1
,
"
y
"
:
2
,
"
yp
"
:
3
,
"
tau
"
:
4
,
"
delta
"
:
5
}
"
delta
"
:
5
}
...
@@ -112,6 +122,12 @@ def plot_beamdata(filenames, dataset="mean", dimension="tau", stat_var="mean",
...
@@ -112,6 +122,12 @@ def plot_beamdata(filenames, dataset="mean", dimension="tau", stat_var="mean",
"
$
\\
epsilon_{s}$ (m.rad)
"
]
"
$
\\
epsilon_{s}$ (m.rad)
"
]
y
=
data
[
axis
,:,
idx
]
y
=
data
[
axis
,:,
idx
]
y_label
=
label
[
axis
]
y_label
=
label
[
axis
]
elif
dataset
==
"
cs_invariant
"
:
dimension_dict
=
{
"
x
"
:
0
,
"
y
"
:
1
}
axis
=
dimension_dict
[
dimension
]
label
=
[
'
$J_x$ (m)
'
,
'
$J_y$ (m)
'
]
y
=
data
[
axis
,:,
idx
]
y_label
=
label
[
axis
]
elif
dataset
==
"
mean
"
or
dataset
==
"
std
"
:
elif
dataset
==
"
mean
"
or
dataset
==
"
std
"
:
dimension_dict
=
{
"
x
"
:
0
,
"
xp
"
:
1
,
"
y
"
:
2
,
"
yp
"
:
3
,
"
tau
"
:
4
,
dimension_dict
=
{
"
x
"
:
0
,
"
xp
"
:
1
,
"
y
"
:
2
,
"
yp
"
:
3
,
"
tau
"
:
4
,
"
delta
"
:
5
}
"
delta
"
:
5
}
...
@@ -144,11 +160,12 @@ def streak_beamdata(filename, dataset="mean", dimension="tau", cm_lim=None):
...
@@ -144,11 +160,12 @@ def streak_beamdata(filename, dataset="mean", dimension="tau", cm_lim=None):
----------
----------
filename : str
filename : str
Name of the HDF5 file that contains the data.
Name of the HDF5 file that contains the data.
dataset : {
"
current
"
,
"
emit
"
,
"
mean
"
,
"
std
"
}
dataset : {
"
current
"
,
"
emit
"
,
"
mean
"
,
"
std
"
,
"
cs_invariant
"
}
HDF5 file
'
s dataset to be plotted. The default is
"
mean
"
.
HDF5 file
'
s dataset to be plotted. The default is
"
mean
"
.
dimension : str
dimension : str
The dimension of the dataset to plot:
The dimension of the dataset to plot:
for
"
emit
"
, dimension = {
"
x
"
,
"
y
"
,
"
s
"
},
for
"
emit
"
, dimension = {
"
x
"
,
"
y
"
,
"
s
"
},
for
"
cs_invariant
"
, dimension = {
"
x
"
,
"
y
"
},
for
"
mean
"
and
"
std
"
, dimension = {
"
x
"
,
"
xp
"
,
"
y
"
,
"
yp
"
,
"
tau
"
,
"
delta
"
}.
for
"
mean
"
and
"
std
"
, dimension = {
"
x
"
,
"
xp
"
,
"
y
"
,
"
yp
"
,
"
tau
"
,
"
delta
"
}.
not used if
"
current
"
.
not used if
"
current
"
.
The default is
"
tau
"
.
The default is
"
tau
"
.
...
@@ -184,6 +201,13 @@ def streak_beamdata(filename, dataset="mean", dimension="tau", cm_lim=None):
...
@@ -184,6 +201,13 @@ def streak_beamdata(filename, dataset="mean", dimension="tau", cm_lim=None):
z
=
np
.
array
(
data
[
"
emit
"
][
axis
,:,:]).
T
z
=
np
.
array
(
data
[
"
emit
"
][
axis
,:,:]).
T
z_label
=
label
[
axis
]
z_label
=
label
[
axis
]
title
=
z_label
title
=
z_label
elif
dataset
==
"
cs_invariant
"
:
dimension_dict
=
{
"
x
"
:
0
,
"
y
"
:
1
}
axis
=
dimension_dict
[
dimension
]
label
=
[
'
$J_x$ (m)
'
,
'
$J_y$ (m)
'
]
z
=
np
.
array
(
data
[
"
cs_invariant
"
][
axis
,:,:]).
T
z_label
=
label
[
axis
]
title
=
z_label
else
:
else
:
dimension_dict
=
{
"
x
"
:
0
,
"
xp
"
:
1
,
"
y
"
:
2
,
"
yp
"
:
3
,
"
tau
"
:
4
,
dimension_dict
=
{
"
x
"
:
0
,
"
xp
"
:
1
,
"
y
"
:
2
,
"
yp
"
:
3
,
"
tau
"
:
4
,
"
delta
"
:
5
}
"
delta
"
:
5
}
...
@@ -237,6 +261,7 @@ def plot_bunchdata(filenames, bunch_number, dataset, dimension="x",
...
@@ -237,6 +261,7 @@ def plot_bunchdata(filenames, bunch_number, dataset, dimension="x",
The dimension of the dataset to plot. Use
"
None
"
for
"
current
"
,
The dimension of the dataset to plot. Use
"
None
"
for
"
current
"
,
otherwise use the following :
otherwise use the following :
for
"
emit
"
, dimension = {
"
x
"
,
"
y
"
,
"
s
"
},
for
"
emit
"
, dimension = {
"
x
"
,
"
y
"
,
"
s
"
},
for
"
cs_invariant
"
, dimension = {
"
x
"
,
"
y
"
},
for
"
mean
"
and
"
std
"
, dimension = {
"
x
"
,
"
xp
"
,
"
y
"
,
"
yp
"
,
"
tau
"
,
"
delta
"
},
for
"
mean
"
and
"
std
"
, dimension = {
"
x
"
,
"
xp
"
,
"
y
"
,
"
yp
"
,
"
tau
"
,
"
delta
"
},
for
"
action
"
, dimension = {
"
x
"
,
"
y
"
}.
for
"
action
"
, dimension = {
"
x
"
,
"
y
"
}.
legend : list of str, optional
legend : list of str, optional
...
...
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