lightonopu.device

class AcqState[source]

Bases: enum.Enum

Acquisition state (see common/include/opu_types.hpp)

exception OpuAlreadyUsedException[source]

Bases: Exception

Exception raised when hardware resources for an OPU are already taken

class OpuDevice(opu_type: str, frametime_us: int, exposure_us: int, sequence_nb_prelim=0, output_roi: Tuple[Tuple[int, int], Tuple[int, int]] = None, verbose=False, name='opu')[source]

Bases: object

Class for hardware interface with a LightOn OPU.

Implements a context manager interface for acquiring access to the OPU, but most properties are gettable and settable even though the OPU isn’t active.

active

bool, whether the hardware resources have been acquired

exposure_us

exposure for output, in microseconds

Type

int

frametime_us

time for which each input display, in microseconds

Type

int

gain_dB

Gain of the output (not implemented in every device)

input_shape

tuple(int), Shape of the input, in elements and cartesian coordinates

input_size

Input size, in bytes

Type

int

nb_features

Total number of features supported by the OPU

Type

int

open()[source]

Acquires hardware resource.

Do nothing if the resource is already acquired in the current object. If the resource isn’t available, do 4 retries until it is available, or raise a OPUUsedByOther exception

Equivalent is to use context manager interface:

with opu:
    outs = opu.transform(ins)
Raises

self.OPUUsedByOther – if hardware has already been acquired in another process or object

output_readout_us

time given for readout, in microseconds

Type

int

output_roi

offset and size of the current output ROI

Type

tuple(list(int))

output_shape

Shape of the current output ROI, in elements and cartesian coordinates

Type

list(int)

output_shape_max

Shape of the whole output (no ROI), in elements and cartesian coordinates

Type

tuple(int)

reserve(n_images)[source]

Does internal allocation of a number of images, necessary for transform2 calls

versions()[source]

Returns multi-line string with device and libraries versions