microscope.lasers.toptica module

class microscope.lasers.toptica.TopticaiBeam(port: str, **kwargs)[source]

Bases: microscope.devices.LaserDevice

Toptica iBeam smart laser.

Control of laser power is performed by setting the power level on the normal channel (#2) only. The bias channel (#1) is left unmodified and so defines the lowest level power.

disable() → None[source]

Disable the device for a short period for inactivity.

enable() → None[source]

Enable the device.

get_is_on() → bool[source]

Return True if the laser is currently able to produce light.

get_max_power_mw() → float[source]

Return the max. power in mW.

get_min_power_mw() → float[source]

Return the min power in mW.

get_power_mw() → float[source]

“” Return the current power in mW.

get_status() → List[str][source]

Query and return the laser status.

initialize() → None[source]

Initialize the device.

microscope.lasers.toptica._get_table_value(table: bytes, key: bytes) → bytes[source]

Get the value for a key in a table/multiline output.

Some commands return something like a table of key/values. There may be even empty lines on this table. This searches for the first line with a specific key (hopefully there’s only one line with such key) and returns the associated value.

class microscope.lasers.toptica._iBeamConnection(port: str)[source]

Bases: object

Connection to a specific Toptica iBeam smart laser.

This class wraps the serial connection to the device, and provides access to some of its commands performing most of the parsing and validation.

Parameters:port (str) – port name (Windows) or path to port (everything else) to connect to. For example, /dev/ttyS1, COM1, or /dev/cuad1.
command(command: bytes) → bytes[source]

Run command and return answer after minimal validation.

The output of a command has the format:

ANSWER[OK]

The returned bytes only include ANSWER without its own final `
`. This means that the return value might be an empty
array of bytes.
laser_off() → None[source]

Deactivate LD driver.

laser_on() → None[source]

Activate LD driver.

set_normal_channel_power(power: float) → None[source]

Set power in mW for channel 2 (normal operating level channel).

We don’t have channel number as an argument because we only want to be setting the power via channel 2 (channel 1 is the bias and we haven’t seen a laser with a channel 3 yet).

show_bias_power() → float[source]

Return power level for the bias (channel 1) in mW.

show_max_power() → float[source]
show_power_uW() → float[source]

Returns actual laser power in µW.

status_laser() → bytes[source]

Returns actual status of the LD driver (ON or OFF).