qmi.instruments.wl_photonics.wltf_n
Instrument driver for the WL Photonics tunable narrowband wavelength filter (WLTF-N).
Classes
|
Instrument driver for the WL Photonics tunable narrowband wavelength filter. |
- class qmi.instruments.wl_photonics.wltf_n.WlPhotonics_WltfN(context: QMI_Context, name: str, transport: str)
Instrument driver for the WL Photonics tunable narrowband wavelength filter.
- NOTE:: Before using the other commands after open, you have to call get_idn first to
update instrument wavelength and step ranges.
The instrument moves at limited speed. At power-up the instrument might start from motor position being 0, meaning that at this initial position the motor will be outside the (calibrated) wavelength range and reading the wavelength simply returns ‘Wavelength:Unknown’. Similarly, going to zero position will move the motor outside the wavelength range. Note that the wavelength and step ranges are inverse: Min steps value is max wavelength and vice versa.
The default baudrate is 115200 for serial connections.
- DEFAULT_RESPONSE_TIMEOUT
Timeout value for waiting responses.
- ZEROING_WAIT
Time to wait for the motor to go to zero.
- CMD_TERMINATOR
The terminator added for sending commands.
- RESPONSE_TERMINATOR
The terminator expected for end of one response.
- 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 info and return QMI_InstrumentIdentification instance. The instrument returns several
lines of data, example from the documentation: ‘WL200: SN(201307374), MD(2018-11-23)
- ‘,
‘WL Range: 1021.509~1072.505nm(Step: 4654~556)
- ‘,
‘OK
- ‘.
This is processed to create the QMI_InstrumentIdentification object and also to update the wavelength and step range class attributes: - self._wavelength_range: Updates the instrument wavelength range min and max. - self._steps_range: Updates the instrument step range min and max.
- Returns:
QMI_InstrumentIdentification: Data with e.g. idn.vendor = WL Photonics, idn.model = WL200, idn.serial = 201307374, idn.version = 2018-11-23.
- set_center_wavelength(wavelength: float) None
Set the center wavelength in nanometers.
- Parameters:
wavelength – The target wavelength in nanometers.
- Raises:
QMI_InstrumentException – If the wavelength is not in the instrument range.
- get_center_wavelength() float
Get the center wavelength. Default unit is nanometers.
- Returns:
The instrument wavelength in nanometers.
- Return type:
- get_minimum_wavelength() float
Get the minimum wavelength.
- Returns:
The instrument wavelength minimum in nanometers.
- Return type:
self._wavelength_range.min
- get_maximum_wavelength() float
Get the maximum wavelength.
- Returns:
The instrument wavelength maximum in nanometers.
- Return type:
self._wavelength_range.max
- reverse_motor(steps: int) None
Reverse the motor by input steps. This can be used to fine-tune the center wavelength.
- Parameters:
steps – Number of steps the motor should reverse.
- Raises:
ValueError – If calculated new motor position is not in the correct range.
- forward_motor(steps: int) None
Move the motor forward by input steps. This can be used to fine-tune the center wavelength.
- Parameters:
steps – Number of steps the motor should move forward.
- Raises:
ValueError – If calculated new motor position is not in the correct range.
- get_motor_position() int
Get the current step motor position.
- self._motor_position
Updates the current motor position step value.
- Returns:
The current motor position step value.
- Return type:
- get_minimum_steps() int
Get the minimum steps.
- Returns:
The instrument steps minimum.
- Return type:
self._steps_range.min
- get_maximum_steps() int
Get the maximum steps.
- Returns:
The instrument steps maximum.
- Return type:
self._steps_range.max
- go_to_zero()
Move the motor to ‘zero’ position. This can take up to 3 seconds.
The motor moves to zero, where the wavelength value cannot be read anymore as the motor position is outside the instrument’s wavelength range. Reading the wavelength here gives “wavelength:Unknown” as response. This probably can be used as a calibration step for checking drift on absolute wavelength.
- 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.