ellipse module

Define specific functions to plot emittance ellipses.

Todo

Isometric view of emittance along the linac. Possibility to visualize a single particle trajectory along the emittance. Visualization of the acceptance.

class EllipseEqParams[source]

Bases: TypedDict

Holds all the parameters to compute an emittance ellipse.

..math:

Ax**2 + Bxy + Cy**2 + Dx + Ey + F = 0
A: float
B: float
C: float
D: float
E: float
F: float
class EllipseParams[source]

Bases: TypedDict

Hold the parameters to plot an ellipse.

a: float
b: float
x0: float
y0: float
theta: float
_compute_ellipse_parameters(ell_eq)[source]

Compute the ellipse parameters so as to plot the ellipse.

Parameters:

ell_eq (EllipseEqParams) – Holds ellipe equations parameters.

Returns:

Holds semi axis, center of ellipse, angle.

plot_ellipse(ax, ell_eq, **plot_kwargs)[source]

Plot the ellipse defined by ell_eq on ax.

Parameters:
plot_ellipse_emittance(ax, accelerator, idx, phase_space)[source]

Plot the emittance ellipse and highlight interesting data.

Parameters:
  • ax (Axes)

  • accelerator (Accelerator)

  • idx (int)

  • phase_space (Literal['phiw', 'phiw99', 't', 'x', 'x99', 'y', 'y99', 'z', 'zdelta'])