toptica.lasersdk.utils package

Submodules

toptica.lasersdk.utils.dlcpro module

class toptica.lasersdk.utils.dlcpro.DataBlock(id, payload)

Bases: tuple

id: str

Alias for field number 0

payload: memoryview

Alias for field number 1

exception toptica.lasersdk.utils.dlcpro.DataFormatError[source]

Bases: ValueError

Exception raised for format errors in binary data.

class toptica.lasersdk.utils.dlcpro.SignalChannel(value)[source]

Bases: IntEnum

An enum of the IDs of a DLC pro signal channel.

AMP_CC_ANALOG_IN = 60
AMP_CURRENT_ACT = 64
AMP_CURRENT_SET = 63
AMP_POWER = 62
AMP_SEED_POWER = 61
CC_ANALOG_IN1 = 52
CC_ANALOG_IN2 = 53
CTL_ERROR_SIGNAL = 73
CTL_INTENSITY = 75
CTL_MODE_CONTROL = 72
CTL_MOTOR_POSITION = 71
CTL_NORMALIZE_SIGNAL = 74
CTL_PHOTODIODE = 69
CTL_POWER = 70
CTL_TONIC_I = 77
CTL_TONIC_Q = 76
CTL_WAVELENGTH_ACT = 79
CTL_WAVELENGTH_SET = 78
DEBUG = -4
DL_CURRENT = 51
DL_EOM_VOLTAGE = 58
DL_PHOTODIODE = 54
DL_PIEZO_VOLTAGE = 50
DL_TEMP_ACT = 57
DL_TEMP_SET = 56
EXTERNAL_POWER = 55
FAST_IN3 = 2
FAST_IN3B = 3
FAST_IN4 = 4
FAST_IN4B = 5
FHG_CAVITY_ERROR_SIGNAL = 110
FHG_CAVITY_PIEZO_VOLTAGE_FAST = 121
FHG_CAVITY_PIEZO_VOLTAGE_SLOW = 120
FHG_CAVITY_REJECTION_SIGNAL = 111
FHG_INTRA_CAVITY_SIGNAL = 112
FHG_POWER = 113
FINE_IN1 = 0
FINE_IN2 = 1
FREQUENCY = -1
LOCKIN_OUTPUT = 30
LOCK_INPUT_ALIAS = 100
NLO_AMP_POWER = 84
NLO_FIBER_POWER = 86
NLO_SEED_POWER = 85
NONE = -3
OPO_CAVITY_PIEZO_VOLTAGE_FAST = 151
OPO_CAVITY_PIEZO_VOLTAGE_SLOW = 150
OPO_DEPLETED_PUMP_POWER = 145
OPO_IDLER_POWER = 147
OPO_PUMP_POWER = 144
OPO_SIGNAL_POWER = 146
OUTPUT_A = 20
OUTPUT_B = 21
PDH1_ERROR1 = 40
PDH1_ERROR2 = 42
PDH1_IN1 = 41
PDH1_IN2 = 43
PDH2_ERROR1 = 44
PDH2_ERROR2 = 46
PDH2_IN1 = 45
PDH2_IN2 = 47
PID1_OUTPUT = 31
PID2_OUTPUT = 32
POWERLOCK_INPUT_ALIAS = 102
SCAN_AUX_OUTPUT = 35
SCAN_AUX_OUTPUT_ALIAS = 103
SCAN_OUTPUT = 34
SCAN_OUTPUT_ALIAS = 101
SHG_CAVITY_ERROR_SIGNAL = 80
SHG_CAVITY_PIEZO_VOLTAGE_FAST = 91
SHG_CAVITY_PIEZO_VOLTAGE_SLOW = 90
SHG_CAVITY_REJECTION_SIGNAL = 81
SHG_INPUT_POWER = 87
SHG_INTRA_CAVITY_SIGNAL = 82
SHG_POWER = 83
TIME = -2
UV_SHG_POWERSTAB_SETPOINT = 130
toptica.lasersdk.utils.dlcpro.extract_float_arrays(blockids: str, data: bytes) Dict[str, array][source]

Extracts float arrays from raw scope, background trace, and recorder zoom binary data (block ids a, A, b, B, x, y, Y in the DLC pro ‘Scope, Lock, and Recorder Binary Data’ format).

Parameters:
  • blockids – String of requested block id letters. Block ids not

  • ignored. (available in the input data or in the above list are) –

  • data – Input byte sequence.

Returns:

Dictionary with found block ids as keys and arrays of floats (typecode ‘f’) as values.

Raises:
  • DataFormatError – If the contents of data are not conform to the

  • 'Scope, Lock, and Recorder Binary Data' format.

toptica.lasersdk.utils.dlcpro.extract_lock_points(blockids: str, data: bytes) Dict[str, Dict[str, Iterable]][source]

Extracts lock points from raw lock point data (block ids l, c, t in the DLC pro ‘Scope, Lock, and Recorder Binary Data’ format).

Parameters:
  • blockids – String of requested block id letters. Block ids not

  • ignored. (available in the input data or in the above list are) –

  • data – Input byte sequence.

Returns:

Dictionary with found block ids as keys with nested dicts as values. The nested dicts contain the keys x, y, t and lists of the respective field contents as values (float for keys x,y, str for key t).

Raises:
  • DataFormatError – If the contents of data are not conform to the

  • 'Scope, Lock, and Recorder Binary Data' format.

toptica.lasersdk.utils.dlcpro.extract_lock_state(data: bytes) int | None[source]

Extracts the state of the locking module from raw lock point data (block id s in the DLC pro ‘Scope, Lock, and Recorder Binary Data’ format).

Parameters:

data – Input byte sequence.

Returns:

Lock module’s state as integer if available, otherwise None.

Raises:
  • DataFormatError – If the contents of data are not conform to the

  • 'Scope, Lock, and Recorder Binary Data' format.

Module contents