mcstasscript.instrument_diagram.canvas.DiagramCanvas
mcstasscript.instrument_diagram.canvas.DiagramCanvas¶
- class mcstasscript.instrument_diagram.canvas.DiagramCanvas(left_side_arrows, component_boxes, right_side_arrows, component_categories, colors, intensity_diagnostics=None, variable=None, limits=None)¶
- __init__(left_side_arrows, component_boxes, right_side_arrows, component_categories, colors, intensity_diagnostics=None, variable=None, limits=None)¶
Creates diagram of instrument file with given boxes and arrows
Makes diagram with column of boxes with arrows between them. The boxes are described by the ComponentBox class and arrows by Arrow class. Some arrows are drawn on the left side, AT and ROTATED relationships, while more advanced connections are on the right side. A legend is provided where the colors corresponding to component categories are shown along with the arrow colors used for different features. The right side arrows only show up in the legend when in use to reduce clutter. When using this diagram in matplotlib widget mode, it is possible get more information on each component by hovering the mouse of the beginning the component box.
If intensity_diagnostics is given with an IntensityDiagnostics object, a graph of the intensity and n rays throughout the instrument is generated instead of the right side arrows.
Methods
__init__
(left_side_arrows, component_boxes, ...)Creates diagram of instrument file with given boxes and arrows
make_legend
()plot
()