rminstr.instruments.measurement_functionalities

Submodules

Exceptions

VNAParamError

Error raised when bad VNA parameters are passed.

Classes

SetupOnly

A state model of an instrument that can only call setup commands.

Triggerable

A state model of an instrument that can be armed and triggered.

ABC_Ammeter

Abstraction of a ammeter as a state machine.

ABC_DCSubPowerMeter

Abstraction of a DC Substituted Power Meter as a state machine.

ABC_SignalGenerator

Abstraction of a signal generator as a SetupOnly state machine.

ABC_ArmedSignalGenerator

Abstraction of an signal generator as a Triggerable state machine.

ABC_SMUSourceSweep

Abstraction of an SMU that can sweep between a list of source values.

ABC_VoltageGenerator

Abstraction of a voltage generator as a state machine.

ABC_CurrentGenerator

Abstraction of a current generator as a state machine.

ABC_Voltmeter

Abstraction of a Voltmeter measurement functionality.

ABC_TemperatureController

Abstraction of a temperature controller.

ABC_EnvironmentLogger

Abstraction of an environment temperature/humidity logger.

ABC_RFPowerMeter

Abstraction of an rf powermeter measurement functionality.

ABC_VNA

Abstraction of a Vector Network Analyzer (VNA) measurement functionality.

Package Contents

class rminstr.instruments.measurement_functionalities.SetupOnly(log_path: str = None)

Bases: abc.ABC

A 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.Triggerable(log_path: str = None)

Bases: SetupOnly, abc.ABC

A 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.
class rminstr.instruments.measurement_functionalities.ABC_Ammeter(log_path: str = None)

Bases: rminstr.instruments.measurement_functionalities.state_models.Triggerable, abc.ABC

Abstraction of a ammeter as a state machine.

Parameters:
log_pathstr, optional

Path to save log of arguments passed to state model methods. No log if none saved. The default is None.

acceptable_args
class rminstr.instruments.measurement_functionalities.ABC_DCSubPowerMeter(log_path: str = None)

Bases: rminstr.instruments.measurement_functionalities.state_models.Triggerable, abc.ABC

Abstraction of a DC Substituted Power Meter as a state machine.

Parameters:
log_pathstr, optional

Path to save log of arguments passed to state model methods. No log if none saved. The default is None.

acceptable_args
close()

Close a dcsub power meter safely, should turn off the source.

class rminstr.instruments.measurement_functionalities.ABC_SignalGenerator(log_path: str = None)

Bases: rminstr.instruments.measurement_functionalities.state_models.SetupOnly, abc.ABC

Abstraction of a signal generator as a SetupOnly state machine.

The class tracks state of instrument, and automatically stores settings when initialized and when setup is called.

Parameters:
log_pathstr, optional

Path to save log of arguments passed to state model methods. No log if none saved. The default is None.

acceptable_args
close()

Turn of a SignalGenerator on close.

class rminstr.instruments.measurement_functionalities.ABC_ArmedSignalGenerator(log_path: str = None)

Bases: rminstr.instruments.measurement_functionalities.state_models.Triggerable, abc.ABC

Abstraction of an signal generator as a Triggerable state machine.

The class tracks state of instrument, and automatically stores settings when initialized and when setup is called.

Parameters:
log_pathstr, optional

Path to save log of arguments passed to state model methods. No log if none saved. The default is None.

acceptable_args
class rminstr.instruments.measurement_functionalities.ABC_SMUSourceSweep(log_path: str = None)

Bases: rminstr.instruments.measurement_functionalities.state_models.Triggerable, abc.ABC

Abstraction of an SMU that can sweep between a list of source values.

Parameters:
log_pathstr, optional

Path to save log of arguments passed to state model methods. No log if none saved. The default is None.

Attributes:
wiring_congfigurations: tuple(str)

Possible wiring options expected of an SMU. Use these as naming conventions for establishing the wiring setup on initializtion

source_measure_configurations: tuple(str)

Possible source-measure configurations, use these as naming conventions for establishing the source-measure configurations on initialization

acceptable_args
wiring_configurations = ('2W', '4W')
source_measure_configurations = ('SVMV', 'SVMI', 'SIMI', 'SIMV')
class rminstr.instruments.measurement_functionalities.ABC_VoltageGenerator(log_path: str = None)

Bases: rminstr.instruments.measurement_functionalities.state_models.SetupOnly, abc.ABC

Abstraction of a voltage generator as a state machine.

A voltage generator just outputs voltage. It does not measure anything. More complex behaviors should be modeled by another functionality.

The class tracks state of instrument, and automatically stores settings when initialized and when setup is called.

Parameters:
log_pathstr, optional

Path to save log of arguments passed to state model methods. No log if none saved. The default is None.

acceptable_args
close()

Turn off a VoltageGenerator on close.

class rminstr.instruments.measurement_functionalities.ABC_CurrentGenerator(log_path: str = None)

Bases: rminstr.instruments.measurement_functionalities.state_models.Triggerable, abc.ABC

Abstraction of a current generator as a state machine.

A current generator just outputs current. It does not measure anything.

The class tracks state of instrument, and automatically stores settings when initialized and when setup is called.

Parameters:
log_pathstr, optional

Path to save log of arguments passed to state model methods. No log if none saved. The default is None.

acceptable_args
close()

Turn off a current-generator on close.

class rminstr.instruments.measurement_functionalities.ABC_Voltmeter(log_path: str = None)

Bases: rminstr.instruments.measurement_functionalities.state_models.Triggerable, abc.ABC

Abstraction of a Voltmeter measurement functionality.

Parameters:
log_pathstr, optional

Path to save log of arguments passed to state model methods. No log if none saved. The default is None.

acceptable_args
class rminstr.instruments.measurement_functionalities.ABC_TemperatureController(log_path: str = None)

Bases: rminstr.instruments.measurement_functionalities.state_models.SetupOnly, abc.ABC

Abstraction of a temperature controller.

Parameters:
log_pathstr, optional

Path to save log of arguments passed to state model methods. No log if none saved. The default is None.

acceptable_args
class rminstr.instruments.measurement_functionalities.ABC_EnvironmentLogger(log_path: str = None)

Bases: rminstr.instruments.measurement_functionalities.state_models.Triggerable, abc.ABC

Abstraction of an environment temperature/humidity logger.

An environment logger records ambient humidity and temperature, and has fetchable data.

Parameters:
log_pathstr, optional

Path to save log of arguments passed to state model methods. No log if none saved. The default is None.

acceptable_args
class rminstr.instruments.measurement_functionalities.ABC_RFPowerMeter(log_path: str = None)

Bases: rminstr.instruments.measurement_functionalities.state_models.Triggerable, abc.ABC

Abstraction of an rf powermeter measurement functionality.

Parameters:
log_pathstr, optional

Path to save log of arguments passed to state model methods. No log if none saved. The default is None.

acceptable_args
exception rminstr.instruments.measurement_functionalities.VNAParamError(message)

Bases: ValueError

Error raised when bad VNA parameters are passed.

Initialize self. See help(type(self)) for accurate signature.

message
class rminstr.instruments.measurement_functionalities.ABC_VNA(log_path: str = None)

Bases: rminstr.instruments.measurement_functionalities.state_models.Triggerable, abc.ABC

Abstraction of a Vector Network Analyzer (VNA) measurement functionality.

acceptable_args
valid_first = ['a', 'b', 'S']
w2p_params(vna_port1: int, vna_port2: int) list[str]

Generate 2-port wave parameter strings.

Parameters:
port1int

VNA port number connected to device port 1.

port2int

VNA port number connected to device port 2..

Returns:
list[str]

List of parameters.

validate_param(param: str)

Check a VNA parameter matches expectations.