Skip to content

LeDeviceConfiguration

pyglaze.device.LeDeviceConfiguration

Bases: DeviceConfiguration

Represents a configuration that can be sent to a Le-type lock-in amp for scans.

Parameters:

Name Type Description Default
amp_port str

The name of the serial port the amp is connected to.

required
use_ema bool

Whether to use en exponentially moving average filter during lockin detection.

True
n_points int

The number of points to scan.

1000
scan_intervals list[Interval]

The intervals to scan.

(lambda: [Interval(0.0, 1.0)])()
integration_periods int

The number of integration periods per datapoint to use.

10
amp_timeout_seconds float

The timeout for the connection to the amp in seconds.

0.2

from_dict(amp_config) classmethod

Create a LeDeviceConfiguration from a dict.

Parameters:

Name Type Description Default
amp_config dict

An amp configuration in dict form.

required

Raises:

Type Description
ValueError

If the dictionary is empty.

Returns:

Name Type Description
DeviceConfiguration LeDeviceConfiguration

A DeviceConfiguration object.

load(file_path) classmethod

Load a LeDeviceConfiguration from a file.

Parameters:

Name Type Description Default
file_path Path

The path to the file to load.

required

Returns:

Name Type Description
DeviceConfiguration LeDeviceConfiguration

A DeviceConfiguration object.

save(path)

Save a LeDeviceConfiguration to a file.

Parameters:

Name Type Description Default
path Path

The path to save the configuration to.

required

Returns:

Name Type Description
str str

Final path component of the saved file, without the extension.

Examples

Make a device configuration

Depending on which device is used, a matching device configuration must be used.

1
2
3
4
5
from pyglaze.device import LeDeviceConfiguration

config = LeDeviceConfiguration(
    amp_port="mock_device", use_ema=True
)

Be sure to use the correct port and delayunit! The mock_device and mock_delay are only for testing purposes