code: def centroids(self, window_size=5):
          
          self.sortByMass()
          mzs = _cffi_buffer(self.masses, 'd')
          intensities = _cffi_buffer(self.intensities, 'f')
          n = self.size
          p = ims.spectrum_new_from_raw(n, mzs.ptr, intensities.ptr, int(window_size))
          return _new_spectrum(CentroidedSpectrum, p)
docs: Detects peaks in raw data.
  
          :param mzs: sorted array of m/z values
          :param intensities: array of corresponding intensities
          :param window_size: size of m/z averaging window
  
          :returns: isotope pattern containing the centroids
          :rtype: CentroidedSpectrum