title: Peak finding and analysis on python
body: <p>I have written a code that reads in my data file and plots it and then fits it and finds the peaks however I have 6 peaks and the code is only currently fitting 2 of the peaks and isn't returning any data on them by code is as follows: </p>
  
  <pre><code> from scipy.optimize import curve_fit
   import numpy as np
   import matplotlib.pyplot as plt
   from scipy.signal import find_peaks
  
   data = np.genfromtxt("C:\\Users\\lenovo laptop\\practice_data_ll16ame1.dat", skip_header = 15)
   x = data[: , 0]
   y = data[: , 1]
  
   plt.plot(x,y)
   plt.show()
  
   def func(x, *params):
     y = np.zeros_like(x)
     for i in range(0, len(params), 3):
      ctr = params[i]
      amp = params[i+1]
      wid = params[i+2]
      y = y + amp * np.exp( -((x - ctr)/wid)**2)
  return y
  
  guess = [0, 60000, 80, 1000, 60000, 80]
  for i in range(12):
  guess += [60+80*i, 46000, 25]   
  
  popt, pcov = curve_fit(func, x, y, p0=guess)
  fit = func(x, *popt)
  
  plt.plot(x, y)
  plt.plot(x, fit , 'r-')
  plt.show()
  </code></pre>