9.2.2.1. qumada.instrument.buffers.buffer
- class qumada.instrument.buffers.buffer.Buffer[source]
Bases:
ABCBase class for a general buffer interface for an instrument.
-
SETTING_NAMES:
set[str] = {'burst_duration', 'channel', 'delay', 'duration', 'grid_interpolation', 'num_bursts', 'num_points', 'sampling_rate', 'trigger_mode', 'trigger_threshold'}
-
TRIGGER_MODE_NAMES:
list[str] = ['continuous', 'edge', 'tracking_edge', 'pulse', 'tracking_pulse', 'digital']
- abstract is_finished()[source]
True, if measurement is done and data has finished reading from the buffer.
- Return type:
- abstract is_ready()[source]
True, if buffer is correctly initialized and ready to measure.
- Return type:
- abstract is_subscribed(parameter)[source]
True, if the parameter is subscribed and saved in buffer.
- Return type:
- abstract property num_points: int | None
Number of points to write into buffer for each burst. Required to setup qcodes datastructure and to compare with max. buffer length.
- abstract read()[source]
Read the buffer
Output is a dict with the following structure:
{ "timestamps": list[float], "param1": list[float], "param2": list[float], ... }
- Return type:
- settings_schema = {'additionalProperties': False, 'oneOf': [{'required': ['sampling_rate', 'duration'], 'not': {'required': ['num_points']}}, {'required': ['sampling_rate', 'num_points'], 'not': {'required': ['duration']}}, {'required': ['duration', 'num_points'], 'not': {'required': ['sampling_rate']}}], 'properties': {'burst_duration': {'type': 'number'}, 'channel': {'type': 'integer'}, 'delay': {'type': 'number'}, 'duration': {'type': 'number'}, 'grid_interpolation': {'enum': ['exact', 'nearest', 'linear'], 'type': 'string'}, 'num_bursts': {'type': 'integer'}, 'num_points': {'type': 'integer'}, 'sampling_rate': {'type': 'number'}, 'trigger_mode': {'enum': ['continuous', 'edge', 'tracking_edge', 'pulse', 'tracking_pulse', 'digital'], 'type': 'string'}, 'trigger_mode_polarity': {'enum': ['positive', 'negative', 'both'], 'type': 'string'}, 'trigger_threshold': {'type': 'number'}}, 'type': 'object'}
- abstract setup_buffer(settings)[source]
Sets instrument related settings for the buffer.
- Return type:
-
SETTING_NAMES:
- exception qumada.instrument.buffers.buffer.BufferException[source]
Bases:
ExceptionGeneral Buffer Exception
- qumada.instrument.buffers.buffer.is_bufferable(object)[source]
Checks if the instrument or parameter is bufferable using the qumada Buffer definition.
- qumada.instrument.buffers.buffer.is_triggerable(object)[source]
Checks if the instrument or parameter can be triggered by checking the corresponding flag in the mapping
- qumada.instrument.buffers.buffer.load_trigger_mapping(components, path)[source]
Loads json file with trigger mappings and tries to apply them to instruments in the components. Works only if the instruments have the same full_name as in the saved file!
- qumada.instrument.buffers.buffer.map_buffers(components, skip_mapped=True, **kwargs)[source]
Maps the bufferable instruments of gate parameters.
- Parameters:
components (Mapping[Any, Metadatable]) – Instruments/Components in QCoDeS
- Return type:
- qumada.instrument.buffers.buffer.map_triggers(components, skip_mapped=True, path=None, **kwargs)[source]
Maps the triggers of triggerable or bufferable components. Ignores already mapped triggers by default.
- Parameters:
components (Mapping[Any, Metadatable]) – Components of QCoDeS station (containing instruments to be mapped).
properties (dict) – Properties of measurement script/device. Currently only required for buffered instruments. TODO: Remove!
gate_parameters (Mapping[Any, Mapping[Any, Parameter] | Parameter]) – Parameters of measurement script/device. Currently only required for buffered instruments. TODO: Remove!
skip_mapped (Bool, optional) – If true already mapped parameters are skipped Set to false if you want to remap something. The default is True.
path (None|str, optional) – Provide path to a json file with trigger mapping. If not all instruments are covered in the file, you will be asked to map those. Works only if names in file match instrument.full_name of your current instruments. The default is None.
- Return type: