lightlab.equipment.abstract_drivers.electrical_sources module

Summary

Classes:

MultiChannelSource This thing basically holds a dict state and provides some critical methods
MultiModalSource Checks modes for sources with multiple ways to specify.

Reference

class MultiModalSource[source]

Bases: object

Checks modes for sources with multiple ways to specify.

Also checks ranges

Default class constants come from NI PCI source array

supportedModes = {'baseunit', 'wattperohm', 'milliamp', 'volt', 'amp', 'mwperohm'}
baseUnitBounds = [0, 1]
baseToVoltCoef = 10
v2maCoef = 4
exceptOnRangeError = False
classmethod enforceRange(val, mode)[source]

Returns clipped value. Raises RangeError

classmethod val2baseUnit(value, mode)[source]

Converts to the voltage value that will be applied at the PCI board Depends on the current mode state of the instance

Args:
value (float or dict)
classmethod baseUnit2val(baseVal, mode)[source]

Converts the voltage value that will be applied at the PCI board back into the units of th instance This is useful for bounds checking

Args:
baseVal (float or dict)
class MultiChannelSource(useChans=None, **kwargs)[source]

Bases: object

This thing basically holds a dict state and provides some critical methods

There is no mode

Checks for channel compliance. Handles range exceptions

maxChannel = None
elChans

Returns the blocked out channels as a list

setChannelTuning(chanValDict)[source]

Sets a number of channel values and updates hardware

Parameters:
  • chanValDict (dict) – A dictionary specifying {channel: value}
  • waitTime (float) – time in ms to wait after writing, default (None) is defined in the class
Returns:

was there a change in value

Return type:

(bool)

getChannelTuning()[source]

The inverse of setChannelTuning

Parameters:mode (str) – units of the value in (‘mwperohm’, ‘milliamp’, ‘volt’)
Returns:the full state of blocked out channels in units determined by mode argument
Return type:(dict)
off(*setArgs)[source]

Turn all voltages to zero, but maintain the session