irrad_control/gui/widgets/plot_widgets.py
def convert_to_unit(self, data, unit):
        """Method to convert raw data between Volt and Ampere"""

        res = OrderedDict()

        # Loop over data and overwrite
        for ch in data:
            _idx = self.channels.index(ch)
            # Get data, scale and type of channel
            val, scale, _type = data[ch], self.daq_setup['devices']['adc']['ro_scales'][_idx], self.daq_setup['devices']['adc']['types'][_idx]
            # Adjust scale in case we're looking at SEM's sum signal; in this case current is multiplied by factor of 4
            scale *= 1 if _type != 'sem_sum' else 4

            res[ch] = val / 5.0 * scale * 1e-9 if unit == 'A' else val * 5.0 / 1e-9 / scale

        return res
Method to convert raw data between Volt and Ampere
Method to convert raw data between Volt and Ampere
Method to convert raw data between Volt and Ampere
def convert_to_unit(self, data, unit):
        res = OrderedDict()
        for ch in data:
            _idx = self.channels.index(ch)
            val, scale, _type = data[ch], self.daq_setup['devices']['adc']['ro_scales'][_idx], self.daq_setup['devices']['adc']['types'][_idx]
            scale *= 1 if _type != 'sem_sum' else 4
            res[ch] = val / 5.0 * scale * 1e-9 if unit == 'A' else val * 5.0 / 1e-9 / scale
        return res
def convert_to_unit ( self , data , unit ) : res = OrderedDict ( ) for ch in data : _idx = self . channels . index ( ch ) val , scale , _type = data [ ch ] , self . daq_setup [ 'devices' ] [ 'adc' ] [ 'ro_scales' ] [ _idx ] , self . daq_setup [ 'devices' ] [ 'adc' ] [ 'types' ] [ _idx ] scale *= 1 if _type != 'sem_sum' else 4 res [ ch ] = val / 5.0 * scale * 1e-9 if unit == 'A' else val * 5.0 / 1e-9 / scale return res
Method to convert raw data between Volt and Ampere
Method to convert raw data between Volt and Ampere
"""Method to convert raw data between Volt and Ampere""" # Loop over data and overwrite # Get data, scale and type of channel # Adjust scale in case we're looking at SEM's sum signal; in this case current is multiplied by factor of 4
self
data
unit