ManzoniMatplotlibArtist#

class georges.vis.ManzoniMatplotlibArtist(tracks_color: str = 'b', **kwargs)[source]#

Bases: MatplotlibArtist

A matplotlib implementation of a Matplotlib artist.

Parameters:
  • ax (param) – the matplotlib ax used for plotting. If None it will be created with init_plot (kwargs are

  • forwarded).

  • tracks_color – color for the plotting of tracks

  • kwargs – forwarded to MatplotlibPlot and to init_plot.

Attributes Summary

tracks_color

The color for the rendering of the tracks.

Methods Summary

compute_halo(data, percentile)

Return a dataframe containing the 1st, 5th, 95th and 99th percentiles of each dimensions.

draw_ellipse(x, y)

draw_table(x, y, dim, unit_col_0, ...)

ellipse(ra, rb, angle, x0, y0, **kwargs)

Create an ellipse from beam parameters.

filled_plot(ax, x, y0, y, c[, fill])

five_spot_map(bl_track0, bl_track1, ...)

histogram_fit(data[, bounds_binning, ...])

All models are available on https://lmfit.github.io/lmfit-py/builtin_models.html#lmfit.models

losses([observer, log_scale])

Plot the losses along the beamline

phase_space([observer, element, location, ...])

param observer:

rotation_angle(e_val, evec)

symmetry([observer])

Plot the symmetry of the beam along the beamline

tracking([observer, plane, fill_between, ...])

Plot the beam envelopes from tracking data.

twiss([observer, with_beta, with_alpha, ...])

Plot the Twiss function along the beamline

Attributes Documentation

tracks_color#

The color for the rendering of the tracks.

Returns:

color as a string

Methods Documentation

static compute_halo(data, percentile)[source]#

Return a dataframe containing the 1st, 5th, 95th and 99th percentiles of each dimensions.

draw_ellipse(x, y)[source]#
draw_table(x, y, dim, unit_col_0, unit_col_1, element)[source]#
static ellipse(ra, rb, angle, x0, y0, **kwargs)[source]#

Create an ellipse from beam parameters. :param ra: semi-major axis :param rb: semi-minor axis :param angle: oritentation angle :param x0: center X coordinate :param y0: center Y coordinate :return: matplotlib.patches.Ellipse object

static filled_plot(ax, x, y0, y, c, fill=False, **kwargs)[source]#
five_spot_map(bl_track0, bl_track1, bl_track2, bl_track3, bl_track4)[source]#
static histogram_fit(data, bounds_binning=50, verbose=False, model=<class 'lmfit.models.GaussianModel'>)[source]#

All models are available on https://lmfit.github.io/lmfit-py/builtin_models.html#lmfit.models

losses(observer: LossesObserver | None = None, log_scale: bool = False, **kwargs)[source]#

Plot the losses along the beamline

Parameters:
  • observer – Observer used for the tracking

  • log_scale – Log scale for transmission

phase_space(observer: BeamObserver | None = None, element: str | None = None, location: str = 'OUT', dim=None, nbins=None, draw_ellipse: bool = True)[source]#
Parameters:
  • observer

  • element

  • location

  • dim

  • nbins

  • draw_ellipse

Returns:

static rotation_angle(e_val, evec)[source]#
symmetry(observer: LossesObserver | None = None, **kwargs)[source]#

Plot the symmetry of the beam along the beamline

Parameters:

observer – Observer used for the tracking

tracking(observer: Observer | None = None, plane: str = 'X', fill_between: bool = False, mean: bool = True, std: bool = False, halo: bool = True, **kwargs)[source]#

Plot the beam envelopes from tracking data.

Parameters:
  • observer – Observer used for the tracking

  • plane

  • fill_between

  • mean

  • std

  • halo

  • **kwargs

Returns:

twiss(observer: TwissObserver | None = None, with_beta: bool = True, with_alpha: bool = False, with_dispersion: bool = False, tfs_data: DataFrame | Table | None = None, relativistic_beta: float = 1.0, **kwargs)[source]#

Plot the Twiss function along the beamline

Parameters:
  • observer – Observer used for the tracking

  • with_beta – plot the beta

  • with_alpha – plot the alpha

  • with_dispersion – plot the dispersion

  • tfs_data – if provided, plot the data from MAD-X.

  • relativistic_beta (float) – Relativistic beta value to scale the dispersion. Default to 1.