pylablib.devices.OZOptics package
Submodules
pylablib.devices.OZOptics.base module
- exception pylablib.devices.OZOptics.base.OZOpticsError[source]
Bases:
DeviceError
Generic OZOptics devices error
- add_note()
Exception.add_note(note) – add a note to the exception
- args
- with_traceback()
Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
- exception pylablib.devices.OZOptics.base.OZOpticsBackendError(exc)[source]
Bases:
OZOpticsError
,DeviceBackendError
Generic OZOptics backend communication error
- add_note()
Exception.add_note(note) – add a note to the exception
- args
- with_traceback()
Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
- class pylablib.devices.OZOptics.base.OZOpticsDevice(conn, timeout=20.0)[source]
Bases:
ICommBackendWrapper
Generic OZOptics device.
- Parameters:
conn – serial connection parameters (usually port or a tuple containing port and baudrate)
- Error
alias of
OZOpticsError
- query(comm, prefix=None, prefix_line=None, timeout=None)[source]
Query the device.
If prefix is not
None
, it can specify a string which should be at the beginning of the prefix_line line of the reply. If it is present, it is removed and the rest of that line is returned; otherwise, an error is raised. If prefix_line isNone
, return the first reply line beginning with the given prefix value (or raise an error if not such line is present).
- apply_settings(settings)
Apply the settings.
settings is the dict
{name: value}
of the device available settings. Non-applicable settings are ignored.
- close()
Close the backend
- get_device_variable(key)
Get the value of a settings, status, or full info parameter
- get_full_info(include=0)
Get dict
{name: value}
containing full device information (including status and settings).include specifies either a list of variables (only these variables are returned), a priority threshold (only values with the priority equal or higher are returned), or
"all"
(all available variables). Since the lowest priority is -10, settinginclude=-10
queries all available variables, which is equivalent toinclude="all"
.
- get_full_status(include=0)
Get dict
{name: value}
containing the device status (including settings).include specifies either a list of variables (only these variables are returned), a priority threshold (only values with the priority equal or higher are returned), or
"all"
(all available variables). Since the lowest priority is -10, settinginclude=-10
queries all available variables, which is equivalent toinclude="all"
.
- get_settings(include=0)
Get dict
{name: value}
containing all the device settings.include specifies either a list of variables (only these variables are returned), a priority threshold (only values with the priority equal or higher are returned), or
"all"
(all available variables). Since the lowest priority is -10, settinginclude=-10
queries all available variables, which is equivalent toinclude="all"
.
- is_opened()
Check if the device is connected
- lock(timeout=None)
Lock the access to the device from other threads/processes (isn’t necessarily implemented)
- locking(timeout=None)
Context manager for lock & unlock
- open()
Open the backend
- set_device_variable(key, value)
Set the value of a settings parameter
- unlock()
Unlock the access to the device from other threads/processes (isn’t necessarily implemented)
- class pylablib.devices.OZOptics.base.TF100(conn, timeout=20.0)[source]
Bases:
OZOpticsDevice
OZOptics TF100 tunable filter.
- Parameters:
conn – serial connection parameters (usually port or a tuple containing port and baudrate)
- get_wavelength_correction()[source]
Get the current wavelength correction parameters
(shift, scale)
.The relation between the set/get wavelength and the wavelength set to the device is calculated as
device_wavelength = set_wavelength*scale + shift
- set_wavelength_correction(shift=0.0, scale=1.0)[source]
Set the wavelength correction parameters.
The relation between the set/get wavelength and the wavelength set to the device is calculated as
device_wavelength = set_wavelength*scale + shift
- Error
alias of
OZOpticsError
- apply_settings(settings)
Apply the settings.
settings is the dict
{name: value}
of the device available settings. Non-applicable settings are ignored.
- close()
Close the backend
- get_config()
Get device configuration
- get_device_variable(key)
Get the value of a settings, status, or full info parameter
- get_full_info(include=0)
Get dict
{name: value}
containing full device information (including status and settings).include specifies either a list of variables (only these variables are returned), a priority threshold (only values with the priority equal or higher are returned), or
"all"
(all available variables). Since the lowest priority is -10, settinginclude=-10
queries all available variables, which is equivalent toinclude="all"
.
- get_full_status(include=0)
Get dict
{name: value}
containing the device status (including settings).include specifies either a list of variables (only these variables are returned), a priority threshold (only values with the priority equal or higher are returned), or
"all"
(all available variables). Since the lowest priority is -10, settinginclude=-10
queries all available variables, which is equivalent toinclude="all"
.
- get_settings(include=0)
Get dict
{name: value}
containing all the device settings.include specifies either a list of variables (only these variables are returned), a priority threshold (only values with the priority equal or higher are returned), or
"all"
(all available variables). Since the lowest priority is -10, settinginclude=-10
queries all available variables, which is equivalent toinclude="all"
.
- is_opened()
Check if the device is connected
- lock(timeout=None)
Lock the access to the device from other threads/processes (isn’t necessarily implemented)
- locking(timeout=None)
Context manager for lock & unlock
- open()
Open the backend
- query(comm, prefix=None, prefix_line=None, timeout=None)
Query the device.
If prefix is not
None
, it can specify a string which should be at the beginning of the prefix_line line of the reply. If it is present, it is removed and the rest of that line is returned; otherwise, an error is raised. If prefix_line isNone
, return the first reply line beginning with the given prefix value (or raise an error if not such line is present).
- restart()
Restart the device
- set_device_variable(key, value)
Set the value of a settings parameter
- unlock()
Unlock the access to the device from other threads/processes (isn’t necessarily implemented)
- class pylablib.devices.OZOptics.base.DD100(conn, timeout=20.0)[source]
Bases:
OZOpticsDevice
OZOptics DD100 variable attenuator.
- Parameters:
conn – serial connection parameters (usually port or a tuple containing port and baudrate)
- Error
alias of
OZOpticsError
- apply_settings(settings)
Apply the settings.
settings is the dict
{name: value}
of the device available settings. Non-applicable settings are ignored.
- close()
Close the backend
- get_config()
Get device configuration
- get_device_variable(key)
Get the value of a settings, status, or full info parameter
- get_full_info(include=0)
Get dict
{name: value}
containing full device information (including status and settings).include specifies either a list of variables (only these variables are returned), a priority threshold (only values with the priority equal or higher are returned), or
"all"
(all available variables). Since the lowest priority is -10, settinginclude=-10
queries all available variables, which is equivalent toinclude="all"
.
- get_full_status(include=0)
Get dict
{name: value}
containing the device status (including settings).include specifies either a list of variables (only these variables are returned), a priority threshold (only values with the priority equal or higher are returned), or
"all"
(all available variables). Since the lowest priority is -10, settinginclude=-10
queries all available variables, which is equivalent toinclude="all"
.
- get_settings(include=0)
Get dict
{name: value}
containing all the device settings.include specifies either a list of variables (only these variables are returned), a priority threshold (only values with the priority equal or higher are returned), or
"all"
(all available variables). Since the lowest priority is -10, settinginclude=-10
queries all available variables, which is equivalent toinclude="all"
.
- is_opened()
Check if the device is connected
- lock(timeout=None)
Lock the access to the device from other threads/processes (isn’t necessarily implemented)
- locking(timeout=None)
Context manager for lock & unlock
- open()
Open the backend
- query(comm, prefix=None, prefix_line=None, timeout=None)
Query the device.
If prefix is not
None
, it can specify a string which should be at the beginning of the prefix_line line of the reply. If it is present, it is removed and the rest of that line is returned; otherwise, an error is raised. If prefix_line isNone
, return the first reply line beginning with the given prefix value (or raise an error if not such line is present).
- restart()
Restart the device
- set_device_variable(key, value)
Set the value of a settings parameter
- unlock()
Unlock the access to the device from other threads/processes (isn’t necessarily implemented)
- class pylablib.devices.OZOptics.base.EPC04(conn, timeout=20.0)[source]
Bases:
ICommBackendWrapper
OZOptics EPC04 polarization controller.
- Parameters:
conn – serial connection parameters (usually port or a tuple containing port and baudrate)
- Error
alias of
OZOpticsError
- set_all_voltages(voltages)[source]
Set all channel voltages.
voltages is a list of size 4 containing the voltage values.
- get_mode()[source]
Get current operating mode.
Can be
"dc"
(constant voltage) or"ac"
(scrambling).
- set_mode(mode='dc')[source]
Set current operating mode.
Can be
"dc"
(constant voltage) or"ac"
(scrambling).
- set_all_frequencies(frequencies)[source]
Set all channel scrambling frequencies.
frequencies is a list of size 4 containing the frequency values.
- get_waveform()[source]
Get current scrambling waveform.
Can be
"sin"
(sine wave) or"tri"
(triangle wave).
- set_waveform(waveform)[source]
Set current scrambling waveform.
Can be
"sin"
(sine wave) or"tri"
(triangle wave).
- apply_settings(settings)
Apply the settings.
settings is the dict
{name: value}
of the device available settings. Non-applicable settings are ignored.
- close()
Close the backend
- get_device_variable(key)
Get the value of a settings, status, or full info parameter
- get_full_info(include=0)
Get dict
{name: value}
containing full device information (including status and settings).include specifies either a list of variables (only these variables are returned), a priority threshold (only values with the priority equal or higher are returned), or
"all"
(all available variables). Since the lowest priority is -10, settinginclude=-10
queries all available variables, which is equivalent toinclude="all"
.
- get_full_status(include=0)
Get dict
{name: value}
containing the device status (including settings).include specifies either a list of variables (only these variables are returned), a priority threshold (only values with the priority equal or higher are returned), or
"all"
(all available variables). Since the lowest priority is -10, settinginclude=-10
queries all available variables, which is equivalent toinclude="all"
.
- get_settings(include=0)
Get dict
{name: value}
containing all the device settings.include specifies either a list of variables (only these variables are returned), a priority threshold (only values with the priority equal or higher are returned), or
"all"
(all available variables). Since the lowest priority is -10, settinginclude=-10
queries all available variables, which is equivalent toinclude="all"
.
- is_opened()
Check if the device is connected
- lock(timeout=None)
Lock the access to the device from other threads/processes (isn’t necessarily implemented)
- locking(timeout=None)
Context manager for lock & unlock
- open()
Open the backend
- set_device_variable(key, value)
Set the value of a settings parameter
- unlock()
Unlock the access to the device from other threads/processes (isn’t necessarily implemented)