spvctrl.data.util.adc_conversion_from_raw_config#

adc_conversion_from_raw_config(acquisition_config: dict, channel_config: dict) → tuple[float, float][source]#

Compute the ADC-to-volt conversion parameters from a raw Gage CompuScope configuration dump.

This is the inverse of the conversion applied by devctrl.devices.Oscilloscope.get_waveform_V(): U = (SampleOffset - raw) / SampleResolution * (InputRange / 2000) + DcOffset / 1000.

Parameters:
  • acquisition_config – Acquisition configuration dict with the keys ‘SampleOffset’ and ‘SampleResolution’

  • channel_config – Channel configuration dict with the keys ‘InputRange’ (mV) and ‘DcOffset’ (mV)

Returns:

(gain_V_per_count, offset_V) with U = raw * gain_V_per_count + offset_V