ThorLabs¶

PM100USB USB Power Meter¶

class instruments.thorlabs.PM100USB(filelike)[source]

Instrument class for the ThorLabs PM100USB power meter. Note that as this is an SCPI-compliant instrument, the properties and methods of SCPIInstrument may be used as well.

class MeasurementConfiguration[source]

Enum containing valid measurement modes for the PM100USB

current = 'CURR'
energy = 'ENER'
energy_density = 'EDEN'
frequency = 'FREQ'
power = 'POW'
power_density = 'PDEN'
resistance = 'RES'
temperature = 'TEMP'
voltage = 'VOLT'
class Sensor(parent)[source]

Class representing a sensor on the ThorLabs PM100USB

Warning

This class should NOT be manually created by the user. It is designed to be initialized by the PM100USB class.

calibration_message

Gets the calibration message of the sensor channel

Type: str
flags

Gets any sensor flags set on the sensor channel

name

Gets the name associated with the sensor channel

Type: str
serial_number

Gets the serial number of the sensor channel

Type: str
type

Gets the sensor type of the sensor channel

Type: str
class SensorFlags[source]

Enum containing valid sensor flags for the PM100USB

has_temperature_sensor = 256
is_energy_sensor = 2
is_power_sensor = 1
response_settable = 16
tau_settable = 64
wavelength_settable = 32
read(size=-1, encoding='utf-8')[source]

Reads a measurement from this instrument, according to its current configuration mode.

Parameters: size (int) – Number of bytes to read from the instrument. Default of -1 reads until a termination character is found. As specified by measurement_configuration. Quantity
averaging_count

Integer specifying how many samples to collect and average over for each measurement, with each sample taking approximately 3 ms.

cache_units

If enabled, then units are not checked every time a measurement is made, reducing by half the number of round-trips to the device.

Warning

Setting this to True may cause incorrect values to be returned, if any commands are sent to the device either by its local panel, or by software other than InstrumentKit.

Type: bool
measurement_configuration

Returns the current measurement configuration.

Return type: PM100USB.MeasurementConfiguration
sensor

Returns information about the currently connected sensor.

ThorLabsAPT ThorLabs APT Controller¶

class instruments.thorlabs.ThorLabsAPT(filelike)[source]

Generic ThorLabs APT hardware device controller. Communicates using the ThorLabs APT communications protocol, whose documentation is found in the thorlabs source folder.

class APTChannel(apt, idx_chan)[source]

Represents a channel within the hardware device. One device can have many channels, each labeled by an index.

enabled

Gets/sets the enabled status for the specified APT channel

Type: bool
identify()[source]

Causes a light on the APT instrument to blink, so that it can be identified.

channel

Gets the list of channel objects attached to the APT controller.

A specific channel object can then be accessed like one would access a list.

Type: tuple of APTChannel
destination

Gets the destination for the APT controller

Type: int
model_number

Gets the model number for the APT controller

Type: str
n_channels

Gets/sets the number of channels attached to the APT controller

Type: int
name

Gets the name of the APT controller. This is a human readable string containing the model, serial number, hardware version, and firmware version.

Type: str
serial_number

Gets the serial number for the APT controller

Type: str
class instruments.thorlabs.APTPiezoStage(filelike)[source]

Class representing a Thorlabs APT piezo stage

class PiezoChannel(apt, idx_chan)[source]

Class representing a single piezo channel within a piezo stage on the Thorlabs APT controller.

change_position_control_mode(closed, smooth=True)[source]

Changes the position control mode of the piezo channel

Parameters: closed (bool) – True for closed, False for open smooth (bool) – True for smooth, False for otherwise. Default is True.
output_position

Gets/sets the output position for the piezo channel.

Type: str
position_control_closed

Gets the status if the position control is closed or not.

True means that the position control is closed, False otherwise

Tyep: bool
class instruments.thorlabs.APTStrainGaugeReader(filelike)[source]

Class representing a Thorlabs APT strain gauge reader.

Warning

This is not currently implemented

class StrainGaugeChannel(apt, idx_chan)[source]

Class representing a single strain gauge channel attached to a APTStrainGaugeReader on the Thorlabs APT controller.

Warning

This is not currently implemented

class instruments.thorlabs.APTMotorController(filelike)[source]

Class representing a Thorlabs APT motor controller

class MotorChannel(apt, idx_chan)[source]

Class representing a single motor attached to a Thorlabs APT motor controller (APTMotorController).

go_home()[source]

move(pos, absolute=True)[source]

Instructs the specified motor channel to move to a specific location. The provided position can be either an absolute or relative position.

Parameters: pos (Quantity) – The position to move to. Provided value will be converted to encoder counts. absolute (bool) – Specify if the position is a relative or absolute position. True means absolute, while False is for a relative move. As specified, or assumed to of units encoder counts
set_scale(motor_model)[source]

Sets the scale factors for this motor channel, based on the model of the attached motor and the specifications of the driver of which this is a channel.

Parameters: motor_model (str) – Name of the model of the attached motor, as indicated in the APT protocol documentation (page 14, v9).
motion_timeout
motor_model

Gets or sets the model name of the attached motor. Note that the scale factors for this motor channel are based on the model of the attached motor and the specifications of the driver of which this is a channel, such that setting a new motor model will update the scale factors accordingly.

Type: str or None
position

Gets the current position of the specified motor channel

Type: Quantity
position_encoder

Gets the position of the encoder of the specified motor channel

Type: Quantity Encoder counts
scale_factors = (array(1) * dimensionless, array(1) * dimensionless, array(1) * dimensionless)

Sets the scale between the encoder counts and physical units for the position, velocity and acceleration parameters of this channel. By default, set to dimensionless, indicating that the proper scale is not known.

In keeping with the APT protocol documentation, the scale factor is multiplied by the physical quantity to get the encoder count, such that scale factors should have units similar to microsteps/mm, in the example of a linear motor.

Encoder counts are represented by the quantities package unit “ct”, which is considered dimensionally equivalent to dimensionless. Finally, note that the “/s” and “/s**2” are not included in scale factors, so as to produce quantities of dimension “ct/s” and “ct/s**2” from dimensionful input.

For more details, see the APT protocol documentation.

status_bits

Gets the status bits for the specified motor channel.

Type: dict

SC10 Optical Beam Shutter Controller¶

class instruments.thorlabs.SC10(filelike)[source]

The SC10 is a shutter controller, to be used with the Thorlabs SH05 and SH1. The user manual can be found here: http://www.thorlabs.com/thorcat/8600/SC10-Manual.pdf

class Mode[source]

Enum containing valid output modes of the SC10

auto = 2
external = 5
manual = 1
repeat = 4
single = 3
default()[source]

Restores instrument to factory settings.

Returns 1 if successful, zero otherwise.

Return type: int
restore()[source]

Returns 1 if successful, zero otherwise.

Return type: int
save()[source]

Stores the parameters in static memory

Returns 1 if successful, zero otherwise.

Return type: int
save_mode()[source]

Stores output trigger mode and baud rate settings in memory.

Returns 1 if successful, zero otherwise.

Return type: int
baud_rate

Gets/sets the instrument baud rate.

Valid baud rates are 9600 and 115200.

Type: int
closed

Gets the shutter closed status.

True represents the shutter is closed, and False for the shutter is open.

Return type: bool
enable

Gets/sets the shutter enable status, False for disabled, True if enabled

If output enable is on (True), there is a voltage on the output.

Return type: bool
interlock

Gets the interlock tripped status.

Returns True if the interlock is tripped, and False otherwise.

Return type: bool
mode

Gets/sets the output mode of the SC10

Return type: SC10.Mode
name

Gets the name and version number of the device.

Returns: Name and verison number of the device str
open_time

Gets/sets the amount of time that the shutter is open, in ms

Units: As specified (if a Quantity) or assumed to be of units milliseconds. Quantity
out_trigger

Gets/sets the out trigger source.

0 trigger out follows shutter output, 1 trigger out follows controller output

Type: int
repeat

Gets/sets the repeat count for repeat mode. Valid range is [1,99] inclusive.

Type: int
shut_time

Gets/sets the amount of time that the shutter is closed, in ms

Units: As specified (if a Quantity) or assumed to be of units milliseconds. Quantity
trigger

Gets/sets the trigger source.

0 for internal trigger, 1 for external trigger

Type: int

LCC25 Liquid Crystal Controller¶

class instruments.thorlabs.LCC25(filelike)[source]

The LCC25 is a controller for the thorlabs liquid crystal modules. it can set two voltages and then oscillate between them at a specific repetition rate.

The user manual can be found here: http://www.thorlabs.com/thorcat/18800/LCC25-Manual.pdf

class Mode[source]

Enum containing valid output modes of the LCC25

normal = 0
voltage1 = 1
voltage2 = 2
default()[source]

Restores instrument to factory settings.

Returns 1 if successful, 0 otherwise

Return type: int
get_settings(slot)[source]

Gets the current settings to memory.

Returns 1 if successful, zero otherwise.

Parameters: slot (int) – Memory slot to use, valid range [1,4] int
save()[source]

Stores the parameters in static memory

Returns 1 if successful, zero otherwise.

Return type: int
set_settings(slot)[source]

Saves the current settings to memory.

Returns 1 if successful, zero otherwise.

Parameters: slot (int) – Memory slot to use, valid range [1,4] int
test_mode()[source]

Puts the LCC in test mode - meaning it will increment the output voltage from the minimum value to the maximum value, in increments, waiting for the dwell time

Returns 1 if successful, zero otherwise.

Return type: int
dwell

Gets/sets the dwell time for voltages for the test mode.

Units: As specified (if a Quantity) or assumed to be of units milliseconds. Quantity
enable

Gets/sets the output enable status.

If output enable is on (True), there is a voltage on the output.

Return type: bool
extern

Gets/sets the use of the external TTL modulation.

Value is True for external TTL modulation and False for internal modulation.

Return type: bool
frequency

Gets/sets the frequency at which the LCC oscillates between the two voltages.

Units: As specified (if a Quantity) or assumed to be of units Hertz. Quantity
increment

Gets/sets the voltage increment for voltages for the test mode.

Units: As specified (if a Quantity) or assumed to be of units Volts. Quantity
max_voltage

Gets/sets the maximum voltage value for the test mode. If the maximum voltage is less than the minimum voltage, nothing happens.

Units: As specified (if a Quantity) or assumed to be of units Volts. Quantity
min_voltage

Gets/sets the minimum voltage value for the test mode.

Units: As specified (if a Quantity) or assumed to be of units Volts. Quantity
mode

Gets/sets the output mode of the LCC25

Return type: LCC25.Mode
name

Gets the name and version number of the device

Return type: str
remote

Gets/sets front panel lockout status for remote instrument operation.

Value is False for normal operation and True to lock out the front panel buttons.

Return type: bool
voltage1

Gets/sets the voltage value for output 1.

Units: As specified (if a Quantity) or assumed to be of units Volts. Quantity
voltage2

Gets/sets the voltage value for output 2.

Units: As specified (if a Quantity) or assumed to be of units Volts. Quantity

TC200 Temperature Controller¶

class instruments.thorlabs.TC200(filelike)[source]

The TC200 is is a controller for the voltage across a heating element. It can also read in the temperature off of a thermistor and implements a PID control to keep the temperature at a set value.

The user manual can be found here: http://www.thorlabs.com/thorcat/12500/TC200-Manual.pdf

class Mode[source]

Enum containing valid output modes of the TC200.

cycle = 1
normal = 0
class Sensor[source]

Enum containing valid temperature sensor types for the TC200.

ntc10k = 'ntc10k'
ptc100 = 'ptc100'
ptc1000 = 'ptc1000'
th10k = 'th10k'
name()[source]

Gets the name and version number of the device

Returns: the name string of the device str
beta

Gets/sets the beta value of the thermistor curve.

Value within [2000, 6000]

Returns: the gain (in nnn) int
d

Gets/sets the d-gain. Valid numbers are [0, 250]

Returns: the d-gain (in nnn) int
degrees

Gets/sets the units of the temperature measurement.

Returns: The temperature units (degC/F/K) the TC200 is measuring in UnitTemperature
enable

Gets/sets the heater enable status.

If output enable is on (True), there is a voltage on the output.

Type: bool
i

Gets/sets the i-gain. Valid numbers are [1,250]

Returns: the i-gain (in nnn) int
max_power

Gets/sets the maximum power

Returns: The maximum power Watts (linear units) Quantity
max_temperature

Gets/sets the maximum temperature

Returns: the maximum temperature (in deg C) As specified or assumed to be degree Celsius. Returns with units degC. Quantity
mode

Gets/sets the output mode of the TC200

Type: TC200.Mode
p

Gets/sets the p-gain. Valid numbers are [1,250].

Returns: the p-gain (in nnn) int
pid

Gets/sets all three PID values at the same time. See TC200.p, TC200.i, and TC200.d for individual restrictions.

If None is specified then the corresponding PID value is not changed.

Returns: List of integers of PID values. In order [P, I, D]. list or tuple list
sensor

Gets/sets the current thermistor type. Used for converting resistances to temperatures.

Returns: The thermistor type TC200.Sensor
status

Gets the the status code of the TC200

Return type: int
temperature

Gets the actual temperature of the sensor

Units: As specified (if a Quantity) or assumed to be of units degrees C. Quantity or int the temperature (in degrees C) Quantity
temperature_set

Gets/sets the actual temperature of the sensor

Units: As specified (if a Quantity) or assumed to be of units degrees C. Quantity or int the temperature (in degrees C) Quantity