@classmethod
def scale_and_calibrate_data(cls, data, min_voltage, max_voltage, calib):
    """
        Apply scaling and calibration to calculate voltages from raw data.
        :param data: the raw data (number or numpy array)
        :param min_voltage: selected minimum voltage of the AI channel
        :param max_voltage: selected maximum voltage of the AI channel
        :param calib: calibration slope and offset as a tuple
        (see get_calib_data)
        """
    slope, offset = calib
    full_scale = max_voltage - min_voltage
    cal_data = data * float(slope) + offset
    return cal_data / cls.max_counts * full_scale + min_voltage
