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

Handle arbitrary bunch count

parent 60212b60
No related branches found
No related tags found
No related merge requests found
......@@ -298,7 +298,7 @@ class LiberaBBBData(LiberaData):
:param h: the harmonic number of the RF system (number of bunches per turn)
:param b: the bunch index or None for an average
"""
wrap = lambda a: a.reshape(-1, h).mean(axis=1) if b is None else a[b::h]
wrap = lambda a: a[:(len(a)//h)*h].reshape(-1, h).mean(axis=1) if b is None else a[b::h]
return LiberaTBTData(t=wrap(self.t), x=wrap(self.x), y=wrap(self.y), s=wrap(self.s),
x_unit=self.x_unit, y_unit=self.y_unit, s_unit=self.s_unit)
......
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