pyopticon.majumdar_lab_widgets.thorlabs_light_meter_widget module

class pyopticon.majumdar_lab_widgets.thorlabs_light_meter_widget.ThorlabsLightMeterWidget(parent_dashboard, name, nickname, wavelength, scale_factor, device_index=0)

Bases: GenericWidget

This widget represents a Thorlabs optical power meter, e.g. a PM100D. The Thorlabs driver library (one .py and two .dll’s) needs to be in a folder labeled ‘thorlabs’ next to the widget. You may have to go into TLPM.py and edit the .dll file paths (listed as strings) if it’s having trouble loading them.

Parameters:
  • parent_dashboard (richardview.dashboard.RichardViewDashboard) – The dashboard object to which this device will be added

  • name (str) – The name that the widget will be labeled with, and under which its data will be logged, e.g. “Methane Mass Flow Controller”

  • nickname (str) – A shortened nickname that can be used to identify the widget in automation scripts, e.g. “CH4 MFC”

  • wavelength (int) – The wavelength of light assumed, in nm. Relevant for photodiode sensors.

  • scale_factor (float) – A float constant by which to multiply the measured power to get an irradiance - usually 1/(collector area).

  • device_index (int) – The index of the Thorlabs device this widget represents, according to the Thorlabs driver’s list of compatible devices. Defaults to 0, but you may set to 1, 2, etc. if you have more than one Thorlabs power meter connected to your computer. With multiple devices, find the indices by trial and error.

on_failed_serial_open()

If serial open failed, set readouts to ‘No Reading’

on_handshake()

Connect to the power meter and conduct a handshake.

on_update()

Query the device and update the fields with the responses.

on_serial_close()

When serial is closed, set all readouts to ‘None’.