georges_core.vis package

Submodules

georges_core.vis.artist module

Plotting module.

georges_core.vis.artist.PALETTE = {'solarized': {'BEND': '#268bd2', 'CIRCULARCOLLIMATOR': '#d33682', 'COLLIMATOR': '#d33682', 'DEGRADER': '#073642', 'ELEMENT': '#839496', 'ELLIPTICALCOLLIMATOR': '#cb4b16', 'HKICKER': '#d33682', 'MATRIX': '#2aa198', 'MULTIPOLE': '#002b36', 'OCTUPOLE': '#859900', 'QUADRUPOLE': '#dc322f', 'RECTANGULARCOLLIMATOR': '#1B8603', 'SCATTERER': '#073642', 'SEXTUPOLE': '#b58900', 'VKICKER': '#6c71c4', 'base0': '#839496', 'base00': '#657b83', 'base01': '#586e75', 'base02': '#073642', 'base03': '#002b36', 'base1': '#93a1a1', 'base2': '#eee8d5', 'base3': '#fdf6e3', 'blue': '#268bd2', 'cyan': '#2aa198', 'darkgreen': '#1B8603', 'goldenrod': '#fac205', 'gray': '#002b36', 'green': '#859900', 'magenta': '#d33682', 'orange': '#cb4b16', 'red': '#dc322f', 'violet': '#6c71c4', 'yellow': '#b58900'}}

Default color palette.

exception georges_core.vis.artist.ArtistException(m: str = '')[source]

Bases: Exception

Exception raised for errors in the beam plotting module.

class georges_core.vis.artist.Artist(palette: Dict[str, str] | str = 'solarized')[source]

Bases: object

TODO

georges_core.vis.gnuplot module

TODO

class georges_core.vis.gnuplot.GnuplotArtist(palette: Dict[str, str] | str = 'solarized')[source]

Bases: Artist

TODO

georges_core.vis.matplotlib module

TODO

class georges_core.vis.matplotlib.MatplotlibArtist(ax: Axes | None = None, **kwargs: Any)[source]

Bases: Artist

TODO

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

  • forwarded).

  • with_frames – draw the entry and exit frames of each element

  • with_centers – draw the center of each polar coordinate elements

  • kwargs – forwarded to Artist and to init_plot.

property ax2: Axes

Returns:

property figure: figure

Current Matplotlib figure.

Returns:

the Matplotlib figure.

property ax: Axes

Current Matplotlib ax.

Returns:

the Matplotlib ax.

init_plot(figsize: Tuple[int, int] = (12, 8), subplots: int = 111) None[source]

Initialize the Matplotlib figure and ax.

Parameters:
  • subplots – number of subplots

  • figsize – figure size

plot(*args: Any, **kwargs: Any) None[source]

Proxy for matplotlib.pyplot.plot

Same as matplotlib.pyplot.plot, forwards all arguments.

static beamline_get_ticks_locations(o: DataFrame) List[float][source]
static beamline_get_ticks_labels(o: DataFrame) List[str][source]
plot_cartouche(beamline: DataFrame | None = None, print_label: bool = False, labels: DataFrame | None = None, vertical_position: float = 1.15) None[source]
Parameters:
  • beamline

  • print_label

  • labels

Returns:

plot_beamline(beamline: DataFrame | None = None, print_label: bool = False, with_aperture: bool = True, labels: DataFrame | None = None, **kwargs: Any) None[source]
Parameters:
  • () (**kwargs) –

  • ()

  • ()

  • ()

  • ()

Returns:

draw_aperture(bl: DataFrame, **kwargs: Any) None[source]
draw_quad(e: DataFrame) None[source]
draw_coll(e: DataFrame) None[source]
draw_bend(e: DataFrame) None[source]
static draw_chamber(ax: Axes, e: DataFrame) None[source]

georges_core.vis.plotly module

TODO

class georges_core.vis.plotly.PlotlyArtist(config: Dict[str, Any] | None = None, layout: Dict[str, Any] | None = None, width: float | None = None, height: float | None = None, **kwargs: Any)[source]

Bases: Artist

TODO

Parameters:
  • config

  • layout

  • width

  • height

  • **kwargs

property fig: Dict[str, Any]

Provides the plotly figure.

property config: Dict[str, Any]
property data: List[Any]
property layout: Dict[str, Any]
property shapes: List[Any]
__iadd__(other: Any) PlotlyArtist[source]

Add a trace to the figure.

add_axis(title: str = '', axis: Dict[str, Any] | None = None) None[source]
Parameters:
  • title

  • axis

Returns:

add_secondary_axis(title: str = '', axis: Dict[str, Any] | None = None) None[source]
Parameters:
  • title

  • axis

Returns:

render() None[source]
save(file: str, file_format: str = 'png') None[source]
save_html(file: str) Any[source]
histogram(*args: Any, **kwargs: Any) None[source]

A proxy for plotly.graph_objs.Histogram

uproot_histogram(histogram: Any, **kwargs: Any) None[source]
histogram2d(*args: Any, **kwargs: Any) None[source]

A proxy for plotly.graph_objs.Histogram2d

bar(*args: Any, **kwargs: Any) None[source]
scatter(*args: Any, **kwargs: Any) None[source]

A proxy for plotly.graph_objs.Scatter .

scatter3d(*args: Any, **kwargs: Any) None[source]

A proxy for plotly.graph_objs.Scatter3d .

surface(*args: Any, **kwargs: Any) None[source]

A proxy for plotly.graph_objs.Surface .

heatmap(*args: Any, **kwargs: Any) None[source]

A proxy for plotly.graph_objs.Surface .

plot_cartouche(beamline_survey: _pd.DataFrame, vertical_position: float = 1.2, unsplit_bends: bool = True, skip_elements: List[str] | None = None) None[source]
Parameters:
  • beamline_survey

  • vertical_position

  • unsplit_bends

  • skip_elements

Returns:

georges_core.vis.vtk_utils module

georges_core.vis.vtk_utils.expand_values_for_paraview(histogram3d)[source]
georges_core.vis.vtk_utils.histogram3d_to_vtk(histogram3d, filename='histogram.vti', path='.', name='Flux', origin_from_file=True, origin=None, expand_for_paraview=False)[source]
georges_core.vis.vtk_utils.beam_to_vtk(filename, output='beam', option_iso=False, option_not_iso=False, option_primaries=False, option_secondaries=False)[source]

Module contents