structure module
Define helper functions to visualize elements.
Todo
Information on the objective under the cursor (hover).
- patch_kwargs(elt, x_axis, idx=None, color=None, alpha=None, pos='in')[source]
Give kwargs for the patch function.
In particular: position and color.
- Parameters:
elt (
Element) – The element corresponding to thepatch.x_axis (
Literal['z_abs','elt_idx']) – Nature of current x axis.color (
tuple[float,float,float] |str|tuple[float,float,float,float] |tuple[tuple[float,float,float] |str,float] |tuple[tuple[float,float,float,float],float] |None, default:None) – Color thepatch.alpha (
float|None, default:None) – Transparency of thepatch.pos (
Literal['in','out'], default:'in') – Where the patch should start. Set it to"out"to mark anObjectiveposition, which are generally evaluated at the exit of anElement.
- Return type:
- _limits(elts, x_axis)[source]
Give the limits of the plot.
- Parameters:
elts (
ListOfElements)x_axis (
Literal['z_abs','elt_idx'])
- Return type:
- plot_structure(elts, ax, x_axis='z_abs')[source]
Plot structure of the linac under study.
- Parameters:
elts (
ListOfElements)ax (
Axes)x_axis (
Literal['z_abs','elt_idx'], default:'z_abs')
- Return type: