[SciPy-user] Fwd: scipy.interpolate.Rbf() MemoryError for more than 4000 (x, y) pairs ?
Jim Vickroy
Jim.Vickroy@noaa....
Fri Apr 3 12:08:44 CDT 2009
Thanks for this valuable information, Josef. -- jv
josef.pktd@gmail.com wrote:
> send again, previous message bounced
>
>
> ---------- Forwarded message ----------
> From: <josef.pktd@gmail.com>
> Date: Fri, Apr 3, 2009 at 12:36 PM
> Subject: Re: [SciPy-user] scipy.interpolate.Rbf() MemoryError for more
> than 4000 (x, y) pairs ?
> To: SciPy Users List <scipy-user@scipy.org>
>
>
> On Fri, Apr 3, 2009 at 12:22 PM, <josef.pktd@gmail.com> wrote:
>
>> On Fri, Apr 3, 2009 at 11:40 AM, Jim Vickroy <Jim.Vickroy@noaa.gov> wrote:
>>
>>> Hello Group,
>>>
>>> I'm a radial basis functions novice so I may be making a mistake; however,
>>> it seems that scipy.interpolate.Rbf() can handle a maximum of ~4000 (x,y)
>>> points. Is that correct?
>>>
>>> Here is a sample output from the attached script (rbf-demo.py) for 5000
>>> (x,y) points:
>>>
>>> <output>
>>> DOS>rbf-demo.py
>>> Python version: 2.5.4 (r254:67916, Dec 23 2008, 15:10:54) [MSC v.1310 32 bit
>>> (Intel)]
>>> numpy version: 1.2.1
>>> scipy version: 0.7.0
>>> multiquadric in-painting required 200 seconds for 5000 points
>>> Traceback (most recent call last):
>>> File "rbf-demo.py", line 28, in <module>
>>> rbf = scipy.interpolate.Rbf(x, y, z, function=function)
>>> File "C:\Python25\lib\site-packages\scipy\interpolate\rbf.py", line 132, in
>>> __init__
>>> r = self._call_norm(self.xi, self.xi)
>>> File "C:\Python25\lib\site-packages\scipy\interpolate\rbf.py", line 147, in
>>> _call_norm
>>> return self.norm(x1, x2)
>>> File "C:\Python25\lib\site-packages\scipy\interpolate\rbf.py", line 100, in
>>> _euclidean_norm
>>> return sqrt( ((x1 - x2)**2).sum(axis=0) )
>>> MemoryError
>>>
>>> DOS>
>>> </output>
>>>
>>> Thanks,
>>> -- jv
>>>
>>> P.S.
>>> I'm considering using Rbf to replace a horizontal band of bad-pixel values
>>> in 512x512 images obtained from a damaged detector.
>>>
>>>
>> Besides the memory error, I don't think rbf can do this, rbf uses all
>> points to do the interpolation, the kernel is number of observation
>> squared. In some examples, that I tried, if the number of points is to
>> large, then you don't get a smooth solution, the interpolation has too
>> much variation (like fitting a very high order polynomial).
>>
>> From my experimentation with rbf, it only works well with a small
>> number of points, so the best is to run rbf on a local neighborhood of
>> the missing points.
>>
>> For 1d, I have the script somewhere but I never tried the 2d version.
>>
>> Josef
>>
>>
>
> here is the script, it produces 12 graphs to illustrate this
>
> Josef
>
> ------------------------------------------------------------------------
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> SciPy-user mailing list
> SciPy-user@scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/scipy-user/attachments/20090403/20a714ad/attachment-0001.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/png
Size: 60550 bytes
Desc: not available
Url : http://mail.scipy.org/pipermail/scipy-user/attachments/20090403/20a714ad/attachment-0001.png
More information about the SciPy-user
mailing list