def _unwrapx(input, output, repeat):
 pow2 = np.array([128, 64, 32, 16, 8, 4, 2, 1], dtype='uint8')
 nbytes = (((repeat - 1) // 8) + 1)
 for i in range(nbytes):
  _min = (i * 8)
  _max = min(((i + 1) * 8), repeat)
  for j in range(_min, _max):
   output[..., j] = np.bitwise_and(input[..., i], pow2[(j - (i * 8))])

def _unwrapx ( input , output , repeat ) : pow2 = np . array ( [ 128 , 64 , 32 , 16 , 8 , 4 , 2 , 1 ] , dtype = 'uint8' ) nbytes = ( ( ( repeat - 1 ) // 8 ) + 1 ) for i in range ( nbytes ) : _min = ( i * 8 ) _max = min ( ( ( i + 1 ) * 8 ) , repeat ) for j in range ( _min , _max ) : output [ ... , j ] = np . bitwise_and ( input [ ... , i ] , pow2 [ ( j - ( i * 8 ) ) ] )
unwrap the x format column into a boolean array .