lightonopu.device

class OpuDevice(opu_type: str, frametime_us: int, exposure_us: int, sequence_nb_prelim=0, cam_ROI: Tuple[Union[List[int], numpy.ndarray], Union[List[int], numpy.ndarray]] = None, verbose=False)[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

cam_ROI

offset and size of the current camera ROI

Type

tuple(list(int))

cam_readout_us

time given by camera for one image readout, in microseconds

Type

int

cam_shape

Shape of the current camera ROI, in pixels and cartesian coordinates

Type

list(int)

cam_shape_max

Shape of the whole camera sensor, in pixels and cartesian coordinates

Type

list(int)

dmd_shape

list(int), Shape of the DMD, in pixels and cartesian coordinates

exposure_us

exposure of the camera, in microseconds

Type

int

frametime_us

time for which each DMD frame is displayed, in microseconds

Type

int

gain_dB

Gain of the camera output (not implemented in every camera)

input_size

Input size of the DMD, 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

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