qmi.instruments.imagine_eyes.mirao52e

Instrument driver for the Imagine Eyes Mirao52e deformable mirror.

Functions

read_mirao_file(filename)

Read a set of mirror actuator values from an MRO file.

Classes

ImagineEyes_Mirao52e(context, name[, bridge_dir])

Instrument driver for the Imagine Eyes Mirao52e deformable mirror.

MirrorStatus(psu_temp, locked)

class qmi.instruments.imagine_eyes.mirao52e.MirrorStatus(psu_temp, locked)
count(value, /)

Return number of occurrences of value.

index(value, start=0, stop=9223372036854775807, /)

Return first index of value.

Raises ValueError if the value is not present.

locked: bool

Alias for field number 1

psu_temp: float

Alias for field number 0

qmi.instruments.imagine_eyes.mirao52e.read_mirao_file(filename: str) List[float]

Read a set of mirror actuator values from an MRO file.

The MRO files can be generated with the MroEdit tool.

Parameters:

filename – File name of the MRO file.

Returns:

List of 52 floating point values.

class qmi.instruments.imagine_eyes.mirao52e.ImagineEyes_Mirao52e(context: QMI_Context, name: str, bridge_dir: str = '/home/docs/mirao')

Instrument driver for the Imagine Eyes Mirao52e deformable mirror.

Note that the deformable mirror will only hold its actuator positions while the connection to the instrument is open. Closing the connection will automatically return the mirror to its free state (which is not flat).

This driver communicates with the deformable mirror via a helper program “mirao_bridge.exe”.

The helper program is a command-line Windows application. On Linux, it can run under Wine.

open() None

Connect to the instrument hardware.

When this method returns, the instrument must be ready for interaction via calls to instrument-specific methods.

Subclasses can extend this method to implement instrument-specific initialization. If they do, they should call super().open() as a last statement.

close() None

Close the connection to the instrument hardware and release associated resources.

When this method returns, the instrument must not be used again unless it is first re-opened by calling the open() method.

Subclasses can extend this method if they have specific resources to close. If they do, they should call super().close() as a last statement.

get_idn() QMI_InstrumentIdentification

Read instrument type and version and return QMI_InstrumentIdentification instance.

apply(actuators: List[float]) None

Apply actuator values.

Parameters:

actuators – List of 52 floating point values.

get_mirror_status() MirrorStatus

Return the mirror status.

Returns:

Named tuple (psu_temperature, locked) where psu_temperature is the PSU temperature in Celsius; locked is True if the mirror is locked due to an error condition.

force_unlock() None

Forcefully unlock the remote object.

This unlocks the object, regardless of who owns the lock. This allows you to unlock an object if the locking proxy has been destroyed without unlocking.

Use this with care.

Do not override this stub method in subclasses. It has already been implemented in QMI_RpcProxy.

classmethod get_category() str | None

Return the optional name of the category this object belongs to.

A category name is a free-form string that has no special significance. Its purpose is to distinguish between groups of RPC objects that fulfill similar roles.

get_name() str

Return the name of this object.

Returns:

name attribute.

get_signals() list[SignalDescription]

Return a list of signals that can be published by this object.

Returns:

List consisting of qmi_signals attributes.

is_locked() bool

Query if the remote object is locked.

Do not override this stub method in subclasses. It has already been implemented in QMI_RpcProxy.

is_open() bool

Return True if the instrument is open (ready for interaction).

lock(timeout: float = 0.0, lock_token: str | None = None) bool

Lock the remote object. If timeout is given, try every 0.1s within the given timeout value. The remote object can be locked with an optional custom lock token by giving a string into lock_token keyword argument.

If successful, this proxy is the only proxy that can invoke RPC methods on the remote object; other proxies will receive an “object is locked” response. The return value indicates if the lock was granted; a denied lock means the object was already locked by another proxy.

Do not override this stub method in subclasses. It has already been implemented in QMI_RpcProxy.

release_rpc_object() None

Give a warning if the instrument is removed while still open.

unlock(lock_token: str | None = None) bool

Unlock the remote object.

Without optional parameters, this is only allowed by the proxy that initially locked the object. By giving the lock token as an input parameter, the specific object locked by this token can be unlocked. The return value indicates if the unlocking was successful.

Do not override this stub method in subclasses. It has already been implemented in QMI_RpcProxy.