Skip to content

Profiles

A profile is the common shape of devices of one kind: the state fields, their units, and the actions. A driver says which profiles it follows (profiles = [PressureSensor]); the dashboard and scripts then know how to show and use it, whoever wrote the driver. Units are fixed per field: drivers convert to them. See also the device contract.

from laborchestra.profiles import PressureSensor

pressure_sensor, version 1. A vacuum gauge controller with one or more gauges.

State

Field Type Unit Meaning
channels list of PressureChannel one entry per channel

Each entry of channels (PressureChannel):

Field Type Unit Meaning
name str what the gauge is called (“Chamber”): the device’s option channel_names, else the driver’s default
pressure float | None mbar None unless the status is ok, never 0
status str “ok”, “underrange”, “overrange”, “error”, …

polarimeter, version 1. Polarization of a light beam: the ellipse (theta, eta), the degree of polarization and the power.

State

Field Type Unit Meaning
status str “ok”, or why the values are not valid (power too low, …)
theta float | None rad azimuth of the ellipse
eta float | None rad ellipticity angle
dop float | None 1 degree of polarization, 0 to 1
power float | None W

positioner, version 1. Motorized stages, one channel each: rotation (degrees), linear (micrometers), sliders (slot number). The unit of a channel is in its unit field and follows its type; the driver converts. A stage with modes (SmarAct) uses “percent” (scan range) or “steps” (open loop) while it is in such a mode.

State

Field Type Unit Meaning
channels list of PositionerChannel one entry per channel

Each entry of channels (PositionerChannel):

Field Type Unit Meaning
name str what the stage is called (“QWP”)
type Literal['rotation', 'linear', 'slider', 'unknown'] unknown: the controller has a channel that this driver cannot move
unit Literal['deg', 'um', 'slot', 'percent', 'steps', 'none'] follows the type (and the mode of a stage that has modes)
target_position float | None
actual_position float | None
status str “ok”, or why the position is not known

Actions

  • set_position(channel: int, position: float): Moves a channel to a position and returns when it is there.
  • stop(channel: int | None = None): Stops a move in progress (one channel, or all); the interrupted set_position fails with InterruptedError.

frequency_generator, version 1. An RF signal generator with one or more outputs.

State

Field Type Unit Meaning
channels list of FrequencyChannel one entry per channel

Each entry of channels (FrequencyChannel):

Field Type Unit Meaning
name str what the output is called (“Cavity detuning”)
frequency float Hz
power float dBm
is_on bool

Actions

  • set_frequency(channel: int, frequency: float): Hz.
  • set_power(channel: int, power: float): dBm.
  • set_on(channel: int, is_on: bool): Switches the output on or off.

oscilloscope, version 1. An oscilloscope that streams samples to a pipeline on the server (spectrum and trace as the display stream, raw channels into recordings). Its drivers are written in C# (the data rate does not allow a process in between), so the profile is declared there with [Profile("oscilloscope", 1)]; this class is the definition they are checked against.

State

Field Type Unit Meaning
running bool
recording bool
sample_rate float Hz
fft_frequency float Hz the top of the spectrum, half the sample rate
fft_length int
channels list of OscilloscopeChannel one entry per channel

Each entry of channels (OscilloscopeChannel):

Field Type Unit Meaning
channel_active bool
range_in_millivolts int mV the full range of the input
coupling Literal['AC', 'DC']

Actions

  • start(): Starts the acquisition.
  • stop(): Stops it.
  • set_range(channel: int, range_in_millivolts: int): The full range of an input, in millivolts.
  • set_channel_active(channel: int, active: bool): Switches an input on or off.
  • set_coupling(channel: int, coupling: str): AC or DC.
  • set_fft_frequency(frequency: float): The top of the spectrum in Hz; the sample rate is twice that.

turbo_pump, version 1. Turbo molecular pumps, one channel each (a controller per pump or several in one box).

State

Field Type Unit Meaning
channels list of TurboPumpChannel one entry per channel

Each entry of channels (TurboPumpChannel):

Field Type Unit Meaning
name str what the pump is called (“Turbo 1”): from the option channel_names, put there by the host
status str “ok”, or why the values are not valid (not connected, no answer, …)
is_running bool | None None unless the status is ok
is_standby bool | None the reduced speed some controllers offer
actual_speed float | None Hz
target_speed float | None Hz
current float | None A
power float | None W
voltage float | None V
operating_hours int | None h
error_code str | None the controller’s own error, None when it reports none

Actions

  • start(channel: int): Switches the pump on; the speed follows.
  • stop(channel: int): Switches the pump off; it runs down.
  • set_speed(channel: int, speed: float): The speed the pump runs at, in Hz.
  • set_standby(channel: int, is_standby: bool): Switches the reduced-speed mode on or off.