wiki:FitAsciiData
def readxy(filename=None):
     f = file(filename,'r')
     x = []
     y = []
     lines = f.readlines()
     f.close()
     for l in lines:
         vals = l.split()
         x.append(float(vals[0]))
         y.append(float(vals[1]))
     return x,y
x,y=readxy("spec.txt")
f =fitter()
f.set_data(x,y)
f.set_function(gauss=1)
f.fit()
f.plot()

Last modified 18 years ago Last modified on 05/17/07 12:10:09
Note: See TracWiki for help on using the wiki.