plesty.pm100d.device

Concrete device class for the Thorlabs PM100D optical power and energy meter.

Classes

Device

Thorlabs PM100D optical power and energy meter.

Module Contents

class plesty.pm100d.device.Device(address: str = 'USB::0x1313::0x8078::INSTR', timeout: int = 200)

Bases: plesty.pm100d.base_device.BaseDevice

Thorlabs PM100D optical power and energy meter.

Extends BaseDevice with composite orchestration methods that combine multiple schema operations and parameter reads into higher-level workflows.

All measurement functions (measure_power, measure_energy, etc.) and sensor utility functions (get_sensor_info, zero_sensor) are registered automatically from schema_func.json and do not need to be overridden here.

Parameters:
  • address (str) – VISA resource string for the instrument. See BaseDevice for details.

  • timeout (int) – VISA communication timeout in milliseconds; the default is derived from measured latency, see BaseDevice.

Initialise the Device with a VISA address and timeout.

Parameters:
  • address (str) – VISA resource string for the PM100D.

  • timeout (int) – VISA communication timeout in milliseconds.

configure_and_measure_power(wavelength: float, averaging: int = 1) dict

Set wavelength and averaging, then perform a power measurement.

This composite method writes the two configuration parameters before triggering a fresh power reading. It is safe to call repeatedly in a measurement loop.

Parameters:
  • wavelength (float) – Operating wavelength in nm. Must be within the sensor’s supported range (typically 185–25000 nm).

  • averaging (int) – Number of samples to average. Must be 1–3000. Default is 1.

Returns:

  • 'wavelength' – confirmed wavelength setting (nm, float).

  • 'averaging' – confirmed averaging count (int).

  • 'power' – measured optical power in Watts (float).

Return type:

Dictionary with keys

zero_and_measure_power() dict

Zero the sensor and then perform a power measurement.

Useful before a precision measurement session to eliminate dark-current offset.

Returns:

  • 'zero_success'True if zeroing completed within timeout.

  • 'power' – measured optical power in Watts after zeroing (float).

Return type:

Dictionary with keys