GlazeClient
pyglaze.scanning.GlazeClient
Warning
Ensure that you are properly connected to the lock-in amp, have it selected, and a configuration is chosen.
Open a connection to and start continuously scanning using the Glaze device.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
DeviceConfiguration
|
Configuration to use for scans |
required |
initial_phase_estimate
|
float | None
|
Optional initial phase estimate in radians for lock-in detection. Use this to maintain consistent polarity across scanning sessions. |
None
|
__enter__()
Start the scanner and return the client.
__exit__(*args)
Stop the scanner and close the connection.
get_firmware_version()
Get the firmware version of the connected device.
get_phase_estimate()
Get the current phase estimate from the lock-in phase estimator.
Can be called even after the client has been stopped, allowing phase estimates to be extracted and reused for maintaining consistent polarity across sessions.
Returns:
| Type | Description |
|---|---|
float | None
|
float | None: The current phase estimate in radians, or None if not yet estimated. |
Raises:
| Type | Description |
|---|---|
SerialException
|
If the scanner was never started. |
get_serial_number()
Get the serial number of the connected device.
read(n_pulses)
Read a number of pulses from the Glaze system.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
n_pulses
|
int
|
The number of terahertz pulses to read from the CCS server. |
required |
Examples
- The config file should be valid JSON of the
DeviceConfigurationtype. See a list of configuration options under "API Reference > Device".