[SciPy-User] [SciPy-user] mgrid format from unstructured data
Spiffalizer
joakim.asklund at gmail.com
Wed Feb 23 04:49:12 EST 2011
Hi
I am trying to write some code to find the interpolated value of some
specified points. My input is x,y,z values. Where the x,y value is the
coordinates in 2d and z is the value I am interested in.
My input is sort of unstructured. I get it from looping over some data that
I have. It is however constructed from a grid pattern to begin with. But i
am not certain in what order the points are in the loop.
example:
1: 0,0,1
2: 1,0,5
3: 2,0,12
4: 0,1,0
5: 1,1,10
6: 2,1,25
7: 0,3,9
8: 1,3,20
9: 2,3,11
the order point 1-9 comes is unknown to me.
I have found some examples that looks like this
x,y = np.mgrid[-1:1:10j,-1:1:10j]
z = (x+y)*np.exp(-6.0*(x*x+y*y))
xnew,ynew = np.mgrid[-1:1:3j,-1:1:3j]
tck = interpolate.bisplrep(x,y,z,s=0)
znew = interpolate.bisplev(xnew[:,0],ynew[0,:],tck)
So my question really is how to sort/convert my input to a format that can
be used by the interpolate function?
Thanks
Joakim
--
View this message in context: http://old.nabble.com/mgrid-format-from-unstructured-data-tp30993544p30993544.html
Sent from the Scipy-User mailing list archive at Nabble.com.
More information about the SciPy-User
mailing list