code: def _set_value(self, target, value, bitarray):
          ''' set given numeric value to target field in bitarray '''
          # derive raw value
          rng = target.find('range')
          rng_min = float(rng.find('min').text)
          rng_max = float(rng.find('max').text)
          scl = target.find('scale')
          scl_min = float(scl.find('min').text)
          scl_max = float(scl.find('max').text)
          raw_value = (value - scl_min) * (rng_max - rng_min) / (scl_max - scl_min) + rng_min
          # store value in bitfield
          return self._set_raw(target, int(raw_value), bitarrayf _set_value(self, target, value, bitarray):
          ''' set given numeric value to target field in bitarray '''
          # derive raw value
          rng = target.find('range')
          rng_min = float(rng.find('min').text)
          rng_max = float(rng.find('max').text)
          scl = target.find('scale')
          scl_min = float(scl.find('min').text)
          scl_max = float(scl.find('max').text)
          raw_value = (value - scl_min) * (rng_max - rng_min) / (scl_max - scl_min) + rng_min
          # store value in bitfield
          return self._set_raw(target, int(raw_value), bitarray)
docs: set given numeric value to target field in bitarray