Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
BEA data analysis utils
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Model registry
Analyze
Contributor analytics
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
Philipp Niedermayer
BEA data analysis utils
Commits
3cb93f68
Commit
3cb93f68
authored
2 years ago
by
Philipp Niedermayer
Browse files
Options
Downloads
Patches
Plain Diff
Add test
parent
c629c29c
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitignore
+10
-0
10 additions, 0 deletions
.gitignore
test/test.py
+51
-0
51 additions, 0 deletions
test/test.py
with
61 additions
and
0 deletions
.gitignore
+
10
−
0
View file @
3cb93f68
# Data files
*.bin
*.tdf
# Created by https://www.toptal.com/developers/gitignore/api/python,jupyternotebooks
# Edit at https://www.toptal.com/developers/gitignore?templates=python,jupyternotebooks
...
...
This diff is collapsed.
Click to expand it.
test/test.py
0 → 100644
+
51
−
0
View file @
3cb93f68
import
sys
import
os
sys
.
path
.
append
(
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
))
+
'
/..
'
)
from
common.utils
import
*
import
matplotlib
as
mpl
from
matplotlib
import
pyplot
as
plt
# https://arxiv.org/abs/2107.02270
CB_color_cycle
=
[
"
#3f90da
"
,
"
#ffa90e
"
,
"
#bd1f01
"
,
"
#94a4a2
"
,
"
#832db6
"
,
"
#a96b59
"
,
"
#e76300
"
,
"
#b9ac70
"
,
"
#717581
"
,
"
#92dadd
"
]
cmap
=
mpl
.
colors
.
ListedColormap
(
CB_color_cycle
,
'
Petroff10
'
)
mpl
.
rcParams
[
'
axes.prop_cycle
'
]
=
mpl
.
cycler
(
color
=
CB_color_cycle
)
fig
,
ax
=
plt
.
subplots
(
5
,
1
,
sharex
=
'
col
'
,
figsize
=
(
5
,
8
))
data
=
LassieSpillData
.
from_file
(
'
test_2022-05-04_13 16 50_asl340.acc.gsi.de_GS01DT_ML_pniederm_test_42c_00014.tdf
'
,
from_event
=
CMD_BEAM_INJECTION
)
ax
[
0
].
plot
(
data
.
t
,
data
.
v
)
ax
[
0
].
set
(
title
=
'
BCT
'
,
ylabel
=
data
.
unit
)
data
=
LiberaBBBData
.
from_file
(
'
test_20220504-151238_sdlibera223_bpm2_bbb_.bin
'
)
ax
[
1
].
plot
(
data
.
t
,
data
.
x
,
label
=
f
'
x /
{
data
.
x_unit
}
'
)
ax
[
1
].
plot
(
data
.
t
,
data
.
y
,
label
=
f
'
y /
{
data
.
y_unit
}
'
)
ax
[
1
].
legend
()
ax
[
1
].
set
(
title
=
'
BPM
'
,
ylabel
=
data
.
x_unit
)
ax
[
2
].
plot
(
data
.
t
,
data
.
s
)
ax
[
2
].
set
(
title
=
'
BPM sum
'
,
ylabel
=
data
.
s_unit
)
ax
[
3
].
plot
(
*
avg
(
data
.
t
,
data
.
f
,
n
=
1000
))
ax
[
3
].
set
(
title
=
'
BPM bunch frequency
'
,
ylabel
=
data
.
f_unit
)
ax
[
-
1
].
set
(
xlabel
=
'
time / s
'
)
plt
.
show
()
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