rminstr.instruments.measurement_functionalities.state_models¶
State model definitions all intstruments inherit from.
Classes¶
A state model of an instrument that can only call setup commands. |
|
A state model of an instrument that can be armed and triggered. |
Module Contents¶
- class rminstr.instruments.measurement_functionalities.state_models.SetupOnly(log_path: str = None)¶
Bases:
abc.ABCA state model of an instrument that can only call setup commands.
- Attributes:
- stateslist(str)
List of possible states for the machine to be in.
- statestr
Current state of the machine.
- default_setup_settingsdict
Dictionary of the default setup values. Only runs in the initial_setup function. This is defined in each child class.
- initial_setup_settingsdict
Dictionary of most recent initial_setup arguments.
- setup_settingsdict
Dictionary of most recent setup arguments.
- info_dictdict
Dictionary of information about the instrument.
- acceptable_args¶
- states = ('uninit', 'init', 'unarmed')¶
- default_setup_settings = None¶
- initial_setup_settings¶
- setup_settings¶
- property state¶
State attribute, reflects current position in state model.
- info_dict¶
- close()¶
Close the instrument.
Good to call if the kernel will continue running after use.
- abstract initial_setup(*args, **kwargs)¶
Run the initial setup of the instrument.
This function is defined in the child classes. Keyword arguments passed in that are not part of the header are passed to the instrument as a raw command.
- Parameters:
- *argslist
The function may need arguments. Arguemnts on this parent function do nothing.
- **kwargsdict
Any keyword arguments the instrument should have.
- Returns:
- None.
- abstract setup(*args, **kwargs)¶
Run the setup function of the instrument.
Defined mainly in the child classes. Keyword arguments passed in that are not part of the header are passed to the instrument as a raw command.
- Parameters:
- *argslist
The function may need arguments. Arguemnts on this parent function do nothing.
- **kwargsdict
Any keyword arguments the instrument should have.
- Returns:
- None.
- query_state()¶
Check the state of the machine according to state model.
- Returns:
- str
Current state of the instrument.
- class rminstr.instruments.measurement_functionalities.state_models.Triggerable(log_path: str = None)¶
Bases:
SetupOnly,abc.ABCA state model of an instrument that can be armed and triggered.
- Attributes:
- arm_settings: dict
Dictionary of most recent arm arguments
- trigger_settings: dict
Dictionary of most recent trigger arguments
- fetch_data_settings: dict
Dictionary of most recent fetch_data arguments
- meas_start_time: float
Absolute time used for calculating measurement start times
- acceptable_args¶
- states¶
- arm_settings¶
- trigger_settings¶
- fetch_data_settings¶
- meas_start_time = 0¶
- wait_until_data_available(timeout: float = None)¶
Wait until the state attribute is data_available.
Raise an error after a timeout number of seconds if data_available is not detected.
- Parameters:
- timeoutfloat, optional
Seconds to wait before raising an error. If None, check settings for “timeout”. If timeout is not in settings, default to 2 seconds.
- Returns:
- None.
- Raises:
- InstrumentError
If timeout occurs waiting for data.
- abstract arm(*args, **kwargs)¶
Take arguments and keyword arguments that define the arming of the instrument.
Implemented in the child classes. Kwargs get passed as raw commands if they are not in the header of the function.
- Parameters:
- *argslist
The function may need arguments. Arguemnts on this parent function do nothing.
- **kwargsdict
Any keyword arguments the arm function should have.
- Returns:
- None.
- abstract trigger(*args, **kwargs)¶
Take arguments and keyword arguments that define the triggering of the instrument.
Implemented in the child classes. Kwargs get passed as raw commands if they are not in the header of the function.
- Parameters:
- *argslist
The function may need arguments. Arguemnts on this parent function do nothing.
- **kwargsdict
Any keyword arguments the arm trigger should have.
- Returns:
- None.
- abstract fetch_data(*args, **kwargs)¶
Take arguments and keyword arguments that definef fetching_data of the instrument.
Implemented in the child classes. Kwargs get passed as raw commands if they are not in the header of the function.
- Parameters:
- **kwargsdict
Any keyword arguments the fetch_data function should have.
- Returns:
- None.
- do_after_group_trigger()¶
Perform operations immediatley after a grouptrigger is called.
This function should take not arguments. Don’t override if nothing is required for the specific instrument.
- Returns:
- None.