devctrl.devices.lock_in.impl.dummy.DummyLockInAmp#
- class DummyLockInAmp[source]#
Bases:
LockInAmp,DummyDeviceMethods
Manually add a specific device.
allow_only_dummy_devicesauto_gainRetrieve data from the buffer
Get the maximum buffer size
Get the number of points currently in the buffer
Check if the target number of points are in the buffer
Configure buffer settings for data acquisition
Start a buffer measurement that was previously configured with
buffer_setup()Stop the current buffer measurement
Check for overload conditions
This function should be overridden by device implementations only, and is not intended to be used directly.
Connect an instance of the device's dummy implementation
Return a flat dictionary of all base classes below this class :param recurse: If True, recursively search for base classes :return: dict of {class name: class}
Get the current filter slope
get_frequency_HzGet the closest valid sample rate
Get the current reference mode
Get the current reference trigger mode
Get the current reserve mode
Get the current sensitivity setting
Query the status of the device and return a string describing errors.
Get the current sync filter setting
Get the current time constant
Calculate wait time to reach 99% of final value
Query whether the device is (still) connected
Get a list of all devices for this type.
queryGet the wait time required to reach 99% of the final value
Read a single value from the lock-in amplifier
resetrunset_filter_slopeset_frequency_Hzset_referenceset_reference_triggerset_reserveset_sensitivity_voltset_sync_filterset_time_constant_sAcquire a snapshot of multiple instrument values
start_check_overloadstry_recover_from_communication_errorAttributes
BUFFER_MAX_LENGTHSRATVALID_FILTER_SLOPEVALID_REFERENCEVALID_SYNC_FILTER- classmethod add_device(connect_info)#
Manually add a specific device. The device will show up when list_devices() is called for the device type. Call this from the device class implementation, e.g. use ModelXYZ9000.add_device(‘GPIB:1234:5678’) to add a specific device with a fixed GPIB address. This is useful when automatic discovery is undesired/impossible, either because it is not implemented or it disturbs other devices which can’t handle a identification request. :param cls: The device implementation class :param connect_info: A string argument that is passed to the connect() method of the device implementation, when the device is being connected.
- buffer_get_data(start=0, n_points: int | None = None)[source]#
Retrieve data from the buffer
Generates simulated data for testing purposes.
- Parameters:
start – Starting index for data retrieval
n_points – Number of points to retrieve. None for all available
- Returns:
NumPy array of shape [Q, N] where Q is number of quantities and N is number of points
- buffer_get_max_size(n_values: int) int[source]#
Get the maximum buffer size
- Parameters:
n_values – Number of values stored per sample
- Returns:
Maximum buffer size in samples
- buffer_get_n_points(dont_log=True) int[source]#
Get the number of points currently in the buffer
- Parameters:
dont_log – If False, log the operation
- Returns:
Number of points in buffer
- buffer_setup(what=['R', 'theta'], length=None, sample_rate_Hz=512)[source]#
Configure buffer settings for data acquisition
Sets up the buffer to store measurements of the specified quantities.
- Parameters:
what – List of quantities to measure (e.g., [‘R’, ‘theta’])
length – Number of samples to acquire. None for maximum
sample_rate_Hz – Sample rate in Hz
- buffer_start_fill()[source]#
Start a buffer measurement that was previously configured with
buffer_setup()
- check_overloads() str[source]#
Check for overload conditions
- Returns:
Empty string (no overloads in dummy implementation)
- classmethod connect(device_type_name: str, device_name: str | None, **kwargs) Device#
- Parameters:
device_type_name – The name of the device class
device_name – The name of the device class
- classmethod connect_device(device_name)#
This function should be overridden by device implementations only, and is not intended to be used directly. Instead, use list_devices() to get a list of devices, and pass the selected device type and name to connect() :param device_name: The name of the device class
- classmethod connect_dummy(**kwargs) Device#
Connect an instance of the device’s dummy implementation
- classmethod get_base_classes(recurse=True) dict[str, type[Device]]#
Return a flat dictionary of all base classes below this class :param recurse: If True, recursively search for base classes :return: dict of {class name: class}
- classmethod get_device_name() str#
- Returns:
The specific type name of the device, e.g., SR830 or Keithly2600
- classmethod get_device_type_name() str#
- Returns:
The general type name of the device, e.g., Lock-In Amplifier or Voltmeter
- get_next_valid_sample_rate_Hz(target_sample_rate_Hz: int | float) int | float[source]#
Get the closest valid sample rate
Returns the sample rate from the supported list that is closest to the target, but not higher.
- Parameters:
target_sample_rate_Hz – Desired sample rate in Hz
- Returns:
Closest valid sample rate ≤ target
- get_reference() str[source]#
Get the current reference mode
- Returns:
Current reference mode (e.g., ‘External’, ‘Internal’)
- get_reference_trigger()[source]#
Get the current reference trigger mode
- Returns:
Current reference trigger mode
- get_sensitivity_volt()[source]#
Get the current sensitivity setting
- Returns:
Current sensitivity in volts
- get_status() str#
Query the status of the device and return a string describing errors. If everything is ok, empty string must be returned :return: String of device status
- get_sync_filter()[source]#
Get the current sync filter setting
- Returns:
Current sync filter state (0 or 1)
- get_time_constant_s()[source]#
Get the current time constant
- Returns:
Current time constant in seconds
- classmethod get_wait_time_s(time_const: float, filter_slope: int)#
Calculate wait time to reach 99% of final value
This method implements the SR830 filter slope timing rules. Subclasses with different filter slopes must override this method.
- Parameters:
time_const – Time constant in seconds
filter_slope – Filter slope in dB/octave (6, 12, 18, or 24)
- Returns:
Wait time in seconds
- Raises:
ValueError – If filter_slope is invalid
- is_connected() bool#
Query whether the device is (still) connected
- classmethod list_devices() list[tuple[str, str]]#
Get a list of all devices for this type. The list made up of: - Manually added devices - Available devices (those returned by _enumerate_devices) - A dummy device (if a dummy implementation exists) - List of all devices of child classes
- Returns:
list of available devices
- read_get_wait_time_s(time_const: float | None = None, filter_slope: int | None = None)#
Get the wait time required to reach 99% of the final value
Uses the rule of thumb from SR830 manual to wait 5 time constants (page 6-35) depending on the filter slope. See SR830 Manual 3-21.
- Parameters:
time_const – Time constant in seconds. If None, read from device
filter_slope – Filter slope in dB/octave. If None, read from device
- Returns:
Wait time in seconds to reach 99% of final value