spvctrl.data.util.volts_to_raw#
- volts_to_raw(U_V: ndarray, gain_V_per_count: float, offset_V: float) ndarray[source]#
Convert voltages to raw ADC counts, the inverse of
raw_to_volts().The counts are rounded to the nearest integer ADC value. Converting voltages that were themselves converted from ADC counts (legacy files) may be off by ±1 count, since the rounding of the original conversion can not be undone.
- Returns:
int16 array with the raw ADC counts