In [1]:
import phantasy
import matplotlib.pyplot as plt
import numpy as np
%matplotlib inline
In [2]:
mp = phantasy.MachinePortal(machine='FRIB_FLAME', segment='LINAC')
In [3]:
bpms = mp.get_elements(type='BPM')
In [4]:
orbit_x = np.array([elem.X for elem in bpms])
orbit_y = np.array([elem.Y for elem in bpms])
s = np.array([elem.sb for elem in bpms])
In [5]:
fig = plt.figure()
ax = fig.add_subplot(111)
ax.plot(s, orbit_x*1e3, '--o', ms=4, label='$x$')
ax.plot(s, orbit_y*1e3, '-o', ms=4, label='$y$')
ax.set_xlabel('$s [m]$')
ax.set_ylabel('$orbit [mm]$')
ax.legend()
Out[5]: