[SciPy-user] scipy.interpolate.bisplrep MemoryError

n.l.o magnusp at astro.su.se
Mon Apr 27 13:59:28 EDT 2009


Hi,
I am trying to interpolate a 512x512 floating-point array with
scipy.interpolate.bisplrep and bisplev. 

First some info about the variables:

SIZE_X=SIZE_Y=512, a90.shape=(512,512)
dx90 and dy90 are sub-pixel,i.e floating-point shifts

Then the code:
x,y = mgrid[0:SIZE_X, 0:SIZE_Y]
tck = interpolate.bisplrep(x,y,a90)
xnew = x - dx90
ynew = x - dy90
a90new = interpolate.bisplev(xnew,ynew,tck)

BUT at tck = interpolate.bisplrep(x,y,a90) i get:

---------------------------------------------------------------------------
MemoryError                               Traceback (most recent call last)

/home/magnusp/msc/reduction/reduce.py in <module>()
    657 
    658 x,y = mgrid[0:SIZE_X, 0:SIZE_Y]
--> 659 tck = interpolate.bisplrep(x,y,a90)
    660 xnew = x - dx90
    661 ynew = x - dy90

/usr/lib/python2.6/dist-packages/scipy/interpolate/fitpack.py in bisplrep(x,
y, z, w, xb, xe, yb, ye, kx, ky, task, s, eps, tx, ty, full_output, nxest,
nyest, quiet)
    760     except OverflowError:
    761         raise OverflowError("Too many data points to interpolate")
--> 762     tx,ty,c,o =
_fitpack._surfit(x,y,z,w,xb,xe,yb,ye,kx,ky,task,s,eps,
    763                                   
tx,ty,nxest,nyest,wrk,lwrk1,lwrk2)
    764     _curfit_cache['tx']=tx

MemoryError: 
WARNING: Failure executing file: <reduce.py>


What can I do to make it work?

Cheers,
Magnus


-- 
View this message in context: http://www.nabble.com/scipy.interpolate.bisplrep-MemoryError-tp23261686p23261686.html
Sent from the Scipy-User mailing list archive at Nabble.com.




More information about the SciPy-User mailing list