SimulationFramework.Modules.plotting package
Submodules
SimulationFramework.Modules.plotting.latticeDraw module
- class latticeDraw(element_positions)[source]
Bases:
object- colorwidths = {'aperture': ('k', 0.3), 'beam_position_monitor': ((100, 100, 100), 0.2), 'cavity': ('g', 0.35), 'collimator': ('k', 0.2), 'dipole': ('b', 0.5), 'kicker': ('m', 0.25), 'line': ('k', 0.05), 'quadrupole': ('r', 0.6), 'screen': ((150, 150, 100), 0.3), 'solenoid': ('c', 0.4), 'wall_current_monitor': ((100, 100, 200), 0.2)}
- property offset
- property scale
- class lineElement(start, end, color='g', width=1, scale=1)[source]
Bases:
GraphicsObject
SimulationFramework.Modules.plotting.multiAxisPlot module
- class multiAxisPlotWidget(**kwargs)[source]
Bases:
QWidgetQWidget containing pyqtgraph plot showing beam parameters
- colors = [<PyQt5.QtGui.QColor object>, <PyQt5.QtGui.QColor object>, <PyQt5.QtGui.QColor object>, <PyQt5.QtGui.QColor object>, <PyQt5.QtGui.QColor object>, 'r', 'k', 'm', 'g']
- plotParams = []
- removeCurve(directory, filename=None)[source]
finds all multiaxis curves based on a set of names, and removes them
- styles = [1, 2, 3, 4, 5]
SimulationFramework.Modules.plotting.multiPlot module
- class multiPlotWidget(xmin=None, ymin=None, xlabel=None, xlabelunits=None, setTitles=True, **kwargs)[source]
Bases:
QWidgetQWidget containing various Twiss plots
- colors = [<PyQt5.QtGui.QColor object>, <PyQt5.QtGui.QColor object>, <PyQt5.QtGui.QColor object>, <PyQt5.QtGui.QColor object>, <PyQt5.QtGui.QColor object>, 'r', 'k', 'm', 'g']
- highlightCurveSignal
int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- Type:
pyqtSignal(*types, name
- Type:
str = …, revision
- multiPlotLattice
[individual plotItems for each twiss plot,]}
- Type:
curves - a dictionary containing {directory
- multiPlotWidgets
multiPlotLattice - holds the lattice items for each Twiss plot
- plotParams = []
- styles = [1, 2, 3, 4, 5]
- unHighlightCurveSignal
int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- Type:
pyqtSignal(*types, name
- Type:
str = …, revision
SimulationFramework.Modules.plotting.plotting module
- add_fieldmaps_to_axes(lattice, axes, bounds=None, sections='All', fields=['cavity', 'solenoid'], include_labels=True, verbose=False)[source]
Adds fieldmaps to an axes.
- add_magnets_to_axes(lattice, axes, bounds=None, sections='All', magnets=['quadrupole', 'dipole', 'sextupole', 'beam_position_monitor', 'screen'], include_labels=True, kinetic_energy=None, verbose=False)[source]
Adds magnets to an axes.
- fieldmap_data(element)[source]
Loads the fieldmap in absolute coordinates.
If a fieldmaps dict is given, these will be used instead of loading the file.
- general_plot(framework_object, ykeys=[], ykeys2=[], xkey='z', limits=None, nice=True, include_layout=False, include_labels=True, include_legend=True, include_particles=False, fields=['cavity', 'solenoid'], magnets=['quadrupole', 'dipole', 'beam_position_monitor', 'screen', 'wall_current_monitor', 'aperture'], grid=False, **kwargs)[source]
- load_elements(lattice, bounds=None, sections='All', types=['cavity', 'solenoid'], kinetic_energy=None, verbose=False, scale=1)[source]
- plot(framework_object, ykeys=['sigma_x', 'sigma_y'], ykeys2=['sigma_z'], xkey='z', limits=None, nice=True, include_layout=False, include_labels=True, include_legend=True, include_particles=False, fields=['cavity', 'solenoid'], magnets=['quadrupole', 'dipole', 'beam_position_monitor', 'screen', 'wall_current_monitor', 'aperture'], grid=False, **kwargs)[source]
Plots stat output multiple keys.
If a list of ykeys2 is given, these will be put on the right hand axis. This can also be given as a single key.
- Logical switches, all default to True:
nice: a nice SI prefix and scaling will be used to make the numbers reasonably sized.
include_legend: The plot will include the legend
include_layout: the layout plot will be displayed at the bottom
include_labels: the layout will include element labels.
Copied almost verbatim from lume-impact’s Impact.plot.plot_stats_with_layout