'**SUMMARY**
Fit a model to the data and then return
**PARAMETERS**
* *f* - a function of the form f(x_values, p0,p1, ... pn) where
p is parameter for the model.
* *p0* - a list of the initial guess for the model parameters.
**RETURNS**
The model parameters as a list. For example if you use a line
model y=mx+b the function returns the m and b values that fit
the data.
**EXAMPLE**
>>>> def aLine(x,m,b):
>>>>     return m*x+b
>>>> import matplotlib.pyplot as plt
>>>> img = Image(\'lenna\')
>>>> sl = img.getLineScan(y=128)
>>>> p = sl.getModelParameters(aLine)
>>>> print p'

def getModelParameters(self, f, p0=None):

    yvals = np.array(self, dtype='float32')
    xvals = range(0, len(yvals), 1)
    (popt, pcov) = spo.curve_fit(f, xvals, yvals, p0=p0)
    return popt
