cohesivm.measurements
This Module contains the Measurement Abstract Base Class and the implemented measurements
(standalone modules) which follow this ABC. The main responsibility is to perform the measurement procedure by calling
the corresponding Channel methods and to return the acquired data. Therefore, the
Measurement issues a list of channels which are required to run the measurement procedure.
- class Measurement(settings: DatabaseDict, output_shape: tuple)[source]
Bases:
ABCThe implementation of a child class should hold the properties which are needed for correct database integration and interface/device compatibility. A method for running the measurement procedure must be implemented as well.
- Parameters:
settings – A dictionary which holds the settings of the measurement which may be provided by the child class.
output_shape – The expected Numpy shape of the measurement result.
Required properties
- _interface_type:
The
InterfaceTypewhich needs to correspond to theInterface.- _required_channels:
A list of
Channelclasses (not objects) which are required to run the measurement procedure.- _output_type:
The expected data type of the measurement result.
- property interface_type: InterfaceType
The type of interface which is used to check the compatibility with the
Interface.
- property required_channels: List[Tuple]
A list of required channels given as tuple of possible channel classes which will be checked against the
channelsof theDevice.
- property output_shape: np.ndarray.shape
The expected shape of the measurement result.
- property settings: DatabaseDict
A dictionary which holds the settings of the measurement and is generated at object initialization.
- abstract run(device: Device, data_stream: Queue) ndarray[source]
Actual implementation of the measurement procedure which returns the measurement results and optionally sends them to the
data_stream.- Parameters:
device – An instance of a class which inherits the
Deviceand complies with therequired_channels.data_stream – A queue-like object where the measurement results can be sent to, e.g., for real-time plotting of the measurement.
- Returns:
A Numpy structured array with tuples of datapoints according to the
output_shape.
Implemented Measurements