def compress_array(array, compress):
   if len(array) % compress != 0:
      print( 'Warning compress must be integer divisor of array length')
      return None

   temp = np.resize(array, (len(array)/compress, compress))
   return np.sum(temp, 1)/compress
Compresses an 1-D array by the integer factor "compress".
dataset/ETHPy150Open xraypy/xraylarch/plugins/xrf/xrf_bgr.py/compress_array