def convert_bits_to_volts(config, data):
"""Convert bit-valued data to volts.
- >>> config = _config._ChannelConfig()
+ >>> config = _config.ChannelConfig()
>>> config['conversion-coefficients'] = [1, 2, 3]
>>> config['conversion-origin'] = -1
>>> convert_bits_to_volts(config, -1)
def convert_volts_to_bits(config, data):
"""Convert bit-valued data to volts.
- >>> config = _config._ChannelConfig()
+ >>> config = _config.ChannelConfig()
>>> config['inverse-conversion-coefficients'] = [1, 2, 3]
>>> config['inverse-conversion-origin'] = -1
>>> convert_volts_to_bits(config, -1)
def convert_volts_to_meters(config, data):
"""Convert volt-valued data to meters.
- >>> config = _config._AxisConfig()
+ >>> config = _config.AxisConfig()
>>> config['gain'] = 20.0
>>> config['sensitivity'] = 8e-9
>>> convert_volts_to_meters(config, 1)
def convert_meters_to_volts(config, data):
"""Convert bit-valued data to volts.
- >>> config = _config._AxisConfig()
+ >>> config = _config.AxisConfig()
>>> config['gain'] = 20.0
>>> config['sensitivity'] = 8e-9
>>> convert_meters_to_volts(config, 1.6e-7)
def convert_bits_to_meters(channel_config, axis_config, data):
"""Convert bit-valued data to meters.
- >>> channel_config = _config._ChannelConfig()
+ >>> channel_config = _config.ChannelConfig()
>>> channel_config['conversion-coefficients'] = [1, 2, 3]
>>> channel_config['conversion-origin'] = -1
- >>> axis_config = _config._AxisConfig()
+ >>> axis_config = _config.AxisConfig()
>>> axis_config['gain'] = 20.0
>>> axis_config['sensitivity'] = 8e-9
>>> convert_bits_to_meters(channel_config, axis_config, 1)
def convert_meters_to_bits(channel_config, axis_config, data):
"""Convert meter-valued data to volts.
- >>> channel_config = _config._ChannelConfig()
+ >>> channel_config = _config.ChannelConfig()
>>> channel_config['inverse-conversion-coefficients'] = [1, 2, 3]
>>> channel_config['inverse-conversion-origin'] = -1
- >>> axis_config = _config._AxisConfig()
+ >>> axis_config = _config.AxisConfig()
>>> axis_config['gain'] = 20.0
>>> axis_config['sensitivity'] = 8e-9
>>> convert_meters_to_bits(channel_config, axis_config, 1.6e-7)
>>> for chan in [axis_channel, monitor_channel]:
... chan.range = chan.find_range(unit=UNIT.volt, min=-10, max=10)
- >>> axis_config = _config._AxisConfig()
+ >>> axis_config = _config.AxisConfig()
>>> axis_config.update({'gain':20, 'sensitivity':8e-9})
- >>> axis_channel_config = _config._ChannelConfig()
- >>> monitor_channel_config = _config._ChannelConfig()
+ >>> axis_channel_config = _config.ChannelConfig()
+ >>> monitor_channel_config = _config.ChannelConfig()
>>> monitor_channel_config['device'] = '/dev/comediX'
>>> p = PiezoAxis(axis_config=axis_config,
>>> channel = s.channel(0, factory=AnalogChannel, aref=AREF.diff)
>>> channel.range = channel.find_range(unit=UNIT.volt, min=-10, max=10)
- >>> channel_config = _config._ChannelConfig()
+ >>> channel_config = _config.ChannelConfig()
>>> c = InputChannel(channel_config=channel_config, channel=channel)
>>> c.setup_config()
>>> for chan in [axis_channel, monitor_channel, input_channel]:
... chan.range = chan.find_range(unit=UNIT.volt, min=-10, max=10)
- >>> axis_config = _config._AxisConfig()
+ >>> axis_config = _config.AxisConfig()
>>> axis_config.update({'gain':20, 'sensitivity':8e-9})
- >>> axis_channel_config = _config._ChannelConfig()
- >>> monitor_channel_config = _config._ChannelConfig()
- >>> input_channel_config = _config._ChannelConfig()
+ >>> axis_channel_config = _config.ChannelConfig()
+ >>> monitor_channel_config = _config.ChannelConfig()
+ >>> input_channel_config = _config.ChannelConfig()
>>> a = PiezoAxis(axis_config=axis_config,
... axis_channel_config=axis_channel_config,