Skip to content
Snippets Groups Projects
Commit 3cb93f68 authored by Philipp Niedermayer's avatar Philipp Niedermayer
Browse files

Add test

parent c629c29c
No related branches found
No related tags found
No related merge requests found
# 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
......
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()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment