API reference¶
Subpackages¶
- contrast.detectors package
- Module contents
- Submodules
- contrast.detectors.Detector module
- contrast.detectors.Dummies module
- contrast.detectors.Pseudo module
- contrast.detectors.Eiger module
- contrast.detectors.Merlin module
- contrast.detectors.Xspress3 module
- contrast.detectors.Pilatus module
- contrast.detectors.Andor3 module
- contrast.detectors.AlbaEM module
- contrast.detectors.PandaBox module
- contrast.detectors.AdLink module
- contrast.detectors.DG645 module
- contrast.detectors.Lima module
- contrast.detectors.Ni6602 module
- contrast.detectors.TangoAttributeDetector module
- contrast.environment package
- contrast.motors package
- contrast.recorders package
- contrast.scans package
Submodules¶
contrast.Gadget module¶
-
class
contrast.Gadget.
Gadget
(name=None, userlevel=1)[source]¶ Bases:
object
Base class for motors, detectors, etc. Main purpose is to keep track of instances so that names can be mapped to objects.
This base class keeps a master class attribute holding references to all instances. The class method getinstances() on each subclass then filters and returns instances of that class or its children.
-
classmethod
getinstances
()[source]¶ Returns a generator over all instances of this class and its children.
[g.name for g in Gadget.getinstances()] - a list of all motors, detectors, etc. [m.name for m in Motor.getinstances()] - a list of all motors. [m.name for m in DummyMotor.getinstances()] - a list of all dummy motors.
-
classmethod
contrast.abbreviations module¶
Provides meanings of the Contrast acronym.
contrast.utils module¶
-
contrast.utils.
list_to_table
(lst, titles, margins=3, sort=True)[source]¶ Formats a table from a nested list, where the first index is the row.
-
contrast.utils.
dict_to_table
(dct, titles=('col1', 'col2'), margin=3, sort=True)[source]¶ Formats a dict where key:val is str:str into a two column table.
-
contrast.utils.
str_to_args
(line)[source]¶ Handy function which splits a list of arguments and keyword arguments, translates names of Gadget instances to actual objects, evaluates expressions that can be evaluated, and accepts the rest as strings. For example,
In [1]: from contrast.motors import DummyMotor In [2]: from contrast.utils import str_to_args In [3]: samx = DummyMotor(name='samx') In [4]: str_to_args("samx hej 1./20") Out[4]: ([<contrast.motors.Motor.DummyMotor at 0x7f6867697f90>, 'hej', 0.05], {})
-
class
contrast.utils.
SpecTable
[source]¶ Bases:
object
A dyamic table, for use when the column titles and one data row are known.
-
format_pair
(k, v)[source]¶ Return two title strings and a format string corresponding to the k:v pair.
-