qmi.instruments.boston_micromachines.multidm
Instrument driver for Boston Micromachines Multi-DM series deformable mirror.
This driver depends on a custom helper program to access the deformable mirror. The helper program is written in C and links with the Boston Micromachines libraries to access the mirror via USB.
See qmi/toolage/boston_micromachines_multidm/ for the source code of this helper program.
Functions
|
Read a mirror shape from a file. |
|
Write mirror shape to a file. |
Classes
|
Instrument driver for the Boston Micromachines Multi-DM series deformable mirrors. |
- qmi.instruments.boston_micromachines.multidm.read_mirror_shape(file_name: str) List[float]
Read a mirror shape from a file.
This function expects the file in the same format used by the Boston Micromachines software: a plain text file containing one line per actuator, each line containing a single floating point number.
- Parameters:
file_name – Name of the file to read.
- Returns:
List of actuator values in the range 0.0 to 1.0.
- qmi.instruments.boston_micromachines.multidm.write_mirror_shape(file_name: str, shape: List[float]) None
Write mirror shape to a file.
- Parameters:
file_name – Name of file to write.
shape – List of 140 floating point values describing the displacement of each actuator as a value in the range 0.0 to 1.0.
- class qmi.instruments.boston_micromachines.multidm.BostonMicromachines_MultiDM(context: QMI_Context, name: str, serial_number: str, set_shape_prog: str)
Instrument driver for the Boston Micromachines Multi-DM series deformable mirrors.
This driver was developed for the DM140A, but is expected to also work with other Multi-DM models with 140 actuators.
This drives communicates with the deformable mirror via an external helper program boston_micromachines_multidm_set_shape.
- 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.
- apply(shape: List[float]) None
Apply actuator values.
- Parameters:
shape – List of 140 floating point values describing the displacement of each actuator as a value in the range 0.0 to 1.0.
Note that the shape values represent the raw, uncalibrated values sent to the mirror actuators. The actual shape of the mirror will be affected by offset mismatch and by interaction between neighbouring actuators.
- 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.
- 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.