2d spline interpolation with periodic boundaries

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

2d spline interpolation with periodic boundaries

Andreas Hilboll
Hi there,

I want to do 2d interpolation with periodic boundary conditions.
Basically, I have data on a global (as in Earth) rectangular (as in
degrees latitude/longitude) grid, and I'd like to interpolate to arbitrary
points on the Earth's surface. So I need periodic boundary conditions in
the zonal direction.

Now, I'd like to look into ``scipy.interpolate.interp2d`` and
``scipy.interpolate.RectBivariateSpline``. Now my question is: Is it
enough to give an Western boundary at 360° in addition to the Eastern
values at 0° to really give me period boundary conditions?

Another question is: How does RectBivariateSpline work? There's not much
info in the docs as to what the function actually does, math-wise.

Any help is greatly appreciated :)

Cheers,
Andreas.

_______________________________________________
SciPy-User mailing list
[hidden email]
http://mail.scipy.org/mailman/listinfo/scipy-user
Reply | Threaded
Open this post in threaded view
|

Re: 2d spline interpolation with periodic boundaries

Jerome Kieffer
On Tue, 30 Aug 2011 11:29:34 +0200
[hidden email] wrote:

> Another question is: How does RectBivariateSpline work? There's not much
> info in the docs as to what the function actually does, math-wise.
>
> Any help is greatly appreciated :)

Hi,

it is a wrapper for "FITPACK" from Dierckx
http://www.netlib.org/dierckx/

Have a look at Fitpack's documentation to understand how it works (control points have to be ordered and other oddities  ...)

Cheers
--
ESRF <[hidden email]>
_______________________________________________
SciPy-User mailing list
[hidden email]
http://mail.scipy.org/mailman/listinfo/scipy-user
Reply | Threaded
Open this post in threaded view
|

Re: 2d spline interpolation with periodic boundaries

Andreas Hilboll
Hi Jerome,

>> Another question is: How does RectBivariateSpline work? There's not much
>> info in the docs as to what the function actually does, math-wise.
>
> it is a wrapper for "FITPACK" from Dierckx
> http://www.netlib.org/dierckx/
>
> Have a look at Fitpack's documentation to understand how it works (control
> points have to be ordered and other oddities  ...)

RectBivariateSpline is defined in scipy/interpolate/fitpack2.py, where all
I can find is a call to dfitpack.regrid_smth. However, in the FITPACK
library, I cannot find a function by that name -- and I couldn't really
find the source code to dfitpack.so to check how FITPACK actually gets
called ...

Any ideas?

Cheers,
Andreas.

_______________________________________________
SciPy-User mailing list
[hidden email]
http://mail.scipy.org/mailman/listinfo/scipy-user
Reply | Threaded
Open this post in threaded view
|

Re: 2d spline interpolation with periodic boundaries

josef.pktd
On Wed, Aug 31, 2011 at 8:17 AM, Andreas H. <[hidden email]> wrote:

> Hi Jerome,
>
>>> Another question is: How does RectBivariateSpline work? There's not much
>>> info in the docs as to what the function actually does, math-wise.
>>
>> it is a wrapper for "FITPACK" from Dierckx
>> http://www.netlib.org/dierckx/
>>
>> Have a look at Fitpack's documentation to understand how it works (control
>> points have to be ordered and other oddities  ...)
>
> RectBivariateSpline is defined in scipy/interpolate/fitpack2.py, where all
> I can find is a call to dfitpack.regrid_smth. However, in the FITPACK
> library, I cannot find a function by that name -- and I couldn't really
> find the source code to dfitpack.so to check how FITPACK actually gets
> called ...
>
> Any ideas?

dfitpack is created by f2py

regrid_smth is defined in
"scipy\interpolate\src\fitpack.pyf"

and points to
fortranname regrid

"\scipy\interpolate\fitpack\regrid.f"

Josef
>
> Cheers,
> Andreas.
>
> _______________________________________________
> SciPy-User mailing list
> [hidden email]
> http://mail.scipy.org/mailman/listinfo/scipy-user
>
_______________________________________________
SciPy-User mailing list
[hidden email]
http://mail.scipy.org/mailman/listinfo/scipy-user