Skip to content

Scanner

pyglaze.scanning.Scanner

A synchronous scanner for Glaze terahertz devices.

config property writable

Configuration used in the scan.

disconnect()

Close serial connection.

get_firmware_version()

Get the firmware version of the connected device.

Returns:

Name Type Description
str str

The firmware version of the connected device.

get_serial_number()

Get the serial number of the connected device.

Returns:

Name Type Description
str str

The serial number of the connected device.

scan()

Perform a scan.

Returns:

Name Type Description
UnprocessedWaveform UnprocessedWaveform

A raw waveform.

update_config(new_config)

Update the DeviceConfiguration used in the scan.

Parameters:

Name Type Description Default
new_config DeviceConfiguration

New configuration for scanner

required

Examples

Initialize a Scanner and perform a scan

The config file should be valid JSON conforming to the specific DeviceConfiguration type. See e.g. a definition here. Be sure to replace mock_device and mock_delay with suitable values.

1
2
3
4
5
6
from pyglaze.device import LeDeviceConfiguration
from pyglaze.scanning import Scanner

device_config = LeDeviceConfiguration(amp_port="mock_device")
scanner = Scanner(config=device_config)
scan_result = scanner.scan()