pylablib.devices.OZOptics package

Submodules

pylablib.devices.OZOptics.base module

exception pylablib.devices.OZOptics.base.OZOpticsError[source]

Bases: pylablib.core.devio.base.DeviceError

Generic OZOptics devices error

args
with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception pylablib.devices.OZOptics.base.OZOpticsBackendError(exc)[source]

Bases: pylablib.devices.OZOptics.base.OZOpticsError, pylablib.core.devio.comm_backend.DeviceBackendError

Generic OZOptics backend communication error

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: pylablib.core.devio.comm_backend.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 is None, return the first reply line beginning with the given prefix value (or raise an error if not such line is present).

restart()[source]

Restart the device

get_config()[source]

Get device configuration

class NoParameterCaller(device, kind)

Bases: object

Class to simplify calling functions without a parameter

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, setting include=-10 queries all available variables, which is equivalent to include="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, setting include=-10 queries all available variables, which is equivalent to include="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, setting include=-10 queries all available variables, which is equivalent to include="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: pylablib.devices.OZOptics.base.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

home()[source]

Home the motor (needs to be called first after startup)

get_wavelength()[source]

Get the currently set wavelength (or None if unknown / not homed)

set_wavelength(wavelength)[source]

Set the current wavelength

Error

alias of OZOpticsError

class NoParameterCaller(device, kind)

Bases: object

Class to simplify calling functions without a parameter

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, setting include=-10 queries all available variables, which is equivalent to include="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, setting include=-10 queries all available variables, which is equivalent to include="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, setting include=-10 queries all available variables, which is equivalent to include="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 is None, 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: pylablib.devices.OZOptics.base.OZOpticsDevice

OZOptics DD100 variable attenuator.

Parameters:conn – serial connection parameters (usually port or a tuple containing port and baudrate)
home()[source]

Home the motor (needs to be called first after startup)

get_min_attenuation()[source]

Get the minimal possible attenuation (i.e., insertion loss)

get_max_attenuation()[source]

Get the maximal possible possible attenuation in dB

get_attenuation()[source]

Get the current attenuation in dB

set_attenuation(att)[source]

Set the current attenuation in dB

Error

alias of OZOpticsError

class NoParameterCaller(device, kind)

Bases: object

Class to simplify calling functions without a parameter

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, setting include=-10 queries all available variables, which is equivalent to include="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, setting include=-10 queries all available variables, which is equivalent to include="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, setting include=-10 queries all available variables, which is equivalent to include="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 is None, 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: pylablib.core.devio.comm_backend.ICommBackendWrapper

OZOptics EPC04 polarization controller.

Parameters:conn – serial connection parameters (usually port or a tuple containing port and baudrate)
Error

alias of OZOpticsError

query(comm)[source]
get_voltages()[source]

Get all voltages

set_voltage(channel, voltage)[source]

Set voltage at a given channel (0 through 3)

set_all_voltages(voltages)[source]

Set all channel voltages.

voltages is a list of size 4 containing the voltage values.

step_voltage(channel, step)[source]

Step voltage at the given channel by the given step

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).

get_frequencies()[source]

Get all scrambling frequencies

set_frequency(channel, frequency)[source]

Set scrambling frequency a given channel (0 through 3)

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).

save_preset()[source]

Save current state as a power-up preset

class NoParameterCaller(device, kind)

Bases: object

Class to simplify calling functions without a parameter

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, setting include=-10 queries all available variables, which is equivalent to include="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, setting include=-10 queries all available variables, which is equivalent to include="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, setting include=-10 queries all available variables, which is equivalent to include="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)

Module contents