I'm trying to do a simple 2nd degree polynomial fit to two arrays of 5
entries. I get a runtime error:
RuntimeError: more argument specifiers than keyword list entries (remaining
format:'|:calc_lwork.gelss')  in the lstsq module inside numpy.polyfit.

Here's the code snippet:
def findPeak(self, ydex, xdex):
        # take a vertical slice
        vslice = []
        for i in range(-1,10,1) :
            vslice.append(arcImage[ydex+i][xdex])
        vdex = n.where(vslice == max(vslice))
        ymax = ydex -1 + vdex[0][0]
        # approximate gaussian fit by parabolic fit to logs
        yvalues = n.array([ymax-2, ymax-1, ymax, ymax+1, ymax+2])
        
svalues=n.array([arcImage[ymax-2][xdex],arcImage[ymax-1][xdex],arcImage[ymax
][xdex],arcImage[ymax+1][xdex], arcImage[ymax+2][xdex]])
        avalues = n.log(svalues)
        ypoly = n.polyfit(yvalues, avalues, 2)

And the traceback:
File "/Users/williamcarithers/BOSS/src/calibrationModel.py", line 345, in
findPeak
    ypoly = n.polyfit(yvalues, avalues, 2)
  File 
"/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/
numpy/lib/polynomial.py", line 503, in polyfit
    c, resids, rank, s = _lstsq(v, y, rcond)
  File 
"/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/
numpy/lib/polynomial.py", line 46, in _lstsq
    return lstsq(X, y, rcond)
  File 
"/Library/Python/2.6/site-packages/scipy-0.7.1-py2.6-macosx-10.6-universal.e
gg/scipy/linalg/basic.py", line 545, in lstsq
    lwork = calc_lwork.gelss(gelss.prefix,m,n,nrhs)[1]
RuntimeError: more argument specifiers than keyword list entries (remaining
format:'|:calc_lwork.gelss')

This is such a simple application of polyfit and the error occurs in the
guts of lstsq, so I'm completely stumped. Any help would be greatly
appreciated.

Thanks,
Bill Carithers


_______________________________________________
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to