Welcome to Pyglaze
Source Code: https://github.com/GlazeTech/pyglaze
Documentation Version: 0.4.2
This is the Pyglaze API documentation. Pyglaze is a python library used to operate the devices of Glaze Technologies. If you have a feature request or discover a bug, please create an issue here and we will look at it ASAP!
Usage
Pyglaze provides two main interfaces for operating Glaze devices: The Scanner
and the The GlazeClient
, where Scanner
is a synchronous scanner, only scanning when requested, and GlazeClient
is an asynchronous scanner, continuously scanning in the background.
GlazeClient
Using the GlazeClient
is the preferred way to acquire scans. Before starting the scanner, a device configuration must be created. Depending on the type of device, different configurations are required, see e.g. a definition here. Be sure to replace mock_device
and mock_delay
with suitable values. Here, we will use a LeDeviceConfiguration
.
scan_intervals
is set, determining which parts of the available timewindow should be scanned. Here, we scan a triangular waveform. Next, let's perform a scan.
The client returns a list of UnprocessedWaveform
, which can have many shapes and forms depending on the scan_intervals
. Here, we extract the part of the waveforms corresponding to the down-ramp of the triangular waveform, then we perform a reconstruction to ensure we have pulses with equidistant times. Finally, having preprocessed the waveforms, we convert it to a list ofPulse
. The pulse has attributes such as pulse.time
, pulse.signal
, pulse.frequency
and pulse.fft
in addition to many different convenience methods such as pulse.filter()
for applying low- and highpass fitlers, pulse.spectrum_dB()
for calculating the spectrum on a dB-scale and pulse.to_native_dict()
for e.g. saving the pulse. Finally, we'll use the latter to save the results to disk
Scanner
Much like the GlazeClient
, a Scanner
is instantiated by first defining a configuration. Once instantiated, scans can be acquired by calling the scanner.scan()
method.