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: ABC

The 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 InterfaceType which needs to correspond to the Interface.

_required_channels:

A list of Channel classes (not objects) which are required to run the measurement procedure.

_output_type:

The expected data type of the measurement result.

property name: str

The Name of the measurement procedure which is the name of the class.

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 channels of the Device.

property output_type: List[Tuple[str, Type]]

The expected data type of the measurement result.

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 Device and complies with the required_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.