[SciPy-user] Fwd: interpolation question

Michael Hearne mhearne@usgs....
Tue Oct 23 14:32:24 CDT 2007


Haven't heard any discussion on this issue since I posted last week -  
are these in fact bugs or am I not using the module correctly?

I also found that if I modify the code in fitpack2.py (see below) to  
compare dimension[0] with Y and dimension[1] with X, I still get back  
interpolated results whose dimensions are opposite of what was  
specified (rows => columns, columns=> rows).

If this is a persistent or low-priority issue, does anyone have any  
suggestions for workaround options for 2d interpolation of regularly  
spaced data?

Thanks,

Mike Hearne

Begin forwarded message:

> From: Michael Hearne <mhearne@usgs.gov>
> Date: October 17, 2007 2:46:31 PM MDT
> To: SciPy Users List <scipy-user@scipy.org>
> Subject: Re: [SciPy-user] interpolation question
>
> John - Thanks very much, this is great!
>
> I do have one more question - when I use the code with a non-square  
> grid, I get an error saying that my x data does not match the x  
> dimension of my z data.
>
> In looking at the following code, it seems like x is being compared  
> with the number of rows of Z data, and y being compared with the  
> number of columns:
>
> if not x.size == z.shape[0]:
>             raise TypeError,\
>                   'x dimension of z must have same number of  
> elements as x'
>         if not y.size == z.shape[1]:
>             raise TypeError,\
>                   'y dimension of z must have same number of  
> elements as y'
>
> Isn't numpy row-major like Matlab?  I.e, The first dimension is  
> that of rows, the second is that of columns?
>
> Thanks,
>
> Mike Hearne
>
> On Oct 17, 2007, at 1:17 PM, John Travers wrote:
>
>> from scipy.interpolate import RectBivariateSpline
>
>
>
>
> ------------------------------------------------------
> Michael Hearne
> mhearne@usgs.gov
> (303) 273-8620
> USGS National Earthquake Information Center
> 1711 Illinois St. Golden CO 80401
> Senior Software Engineer
> Synergetics, Inc.
> ------------------------------------------------------
>
>




------------------------------------------------------
Michael Hearne
mhearne@usgs.gov
(303) 273-8620
USGS National Earthquake Information Center
1711 Illinois St. Golden CO 80401
Senior Software Engineer
Synergetics, Inc.
------------------------------------------------------


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/scipy-user/attachments/20071023/e405d2bd/attachment.html 


More information about the SciPy-user mailing list