Dnia 2009-10-08, czw o godzinie 10:02 +0200, Roberto Vidmar pisze:
> Let me explain better my problem:
> 
> I have n (many millions) laser points data in a numpy array:
> 
> laser_points.shape = (10000000, 3)
> 
> the columns are the x, y, z coordinates of these points in 3D space. 
> These points are irregularly spaced and are the result of a survey on a 
> real world object (e.g. a city).
> 
> What I need is a new numpy array interp of shape
> interp.shape = (1000, 2000)
> so that  interp[i, j] is the "best" approximation of the real world. In 
> other words interp is a new bidimensional array containing the 
> approximated heights evaluated on a regular grid of given size.
> 
> The PYCUDA function I need is like griddata:
> 
> from matplotlib.mlab import griddata
> help(griddata)
> griddata(x, y, z, xi, yi)
>     ``zi = griddata(x,y,z,xi,yi)`` fits a surface of the form *z* =
>     *f*(*x*, *y*) to the data in the (usually) nonuniformly spaced
>     vectors (*x*, *y*, *z*).  :func:`griddata` interpolates this
>     surface at the points specified by (*xi*, *yi*) to produce
>     *zi*. *xi* and *yi* must describe a regular grid, can be either 1D
>     or 2D, but must be monotonically increasing.
> ...
> 
> Thanks to all
> Roberto
> 

I do not know this package, but I think there is currently nothing
like that in PyCUDA. You must get to know how griddata function works
and write code in CUDA language.

> 
> Tomasz Rybak wrote:
> > Dnia 2009-10-07, śro o godzinie 10:41 +0200, Roberto Vidmar pisze:
> >   
> >> Hello Andreas,
> >>
> >>   I have (many)  millions of point coordinated (X, y, z) in 3D space 
> >> (easting, westing, height) like these:
> >>
> >> import numpy as np
> >>
> >> x = np.random.random(10000)
> >> y = np.random.random(10000)
> >> z = x * np.exp(-x**2-y**2)
> >>
> >> So the points are:
> >> p = (x, y, z)
> >>
> >>     
> >
> > Do you know function that has been used to calculate those points?
> > So is there some f(x, y) -> z, or (similar to your example above):
> > z = np.random(10000)?
> >
> >   
> >> I need to interpolate them to a regular grid (n x m).
> >> Any help will be appreciated.
> >>     
> >
> > The easiest way will be to use one thread to calculate value
> > of one point:
> >
> > function = pycuda.compiler.SourceModule("""
> > __global__ void Call(float *dest)
> > {
> >   const int x = threadIdx.x;
> >   const int x = threadIdx.y;
> >   dest[y*15+x] = x * exp(-x*x-y*y) ;
> > }
> > """).get_function("Call")
> >
> > function.call(pycuda.driver.Out(array), block=(15, 15, 1))
> > for calculating for [15 x 15]
> >
> >
> > If this is not what are you asking, please be more specific
> > with your problem.
> >
> >   
> >> Roberto
> >>
> >> Andreas Klöckner wrote:
> >>
> >> ...snip
> >>     
> >>> As usual, if something is possible with CUDA in general, it's also 
> >>> possible 
> >>> with PyCUDA. In this specific case, I'm not sure what you mean by 
> >>> gridding--
> >>> making a grid-based histogram, binning, or perhaps something entirely 
> >>> different? Nonetheless, it seems likely that what you want can be (and 
> >>> likely 
> >>> has been) done with CUDA.
> >>>
> >>> Andreas
> >>>
> >>>
> >>>
> >>> Email secured by **CeSIT** Check Point gateway
> >>>
> >>>   
> >>> ------------------------------------------------------------------------
> >>>
> >>> _______________________________________________
> >>> PyCUDA mailing list
> >>> [email protected]
> >>> http://tiker.net/mailman/listinfo/pycuda_tiker.net
> >>>   
> >>>       
> >>     
> >
> >
> >
> >   
> 
> 



-- 
Tomasz Rybak <[email protected]> GPG key ID: F22C D870
Fingerprint 93BC FEEC A426 3765 799F  10EE FAC1 9A2C F22C D870
http://member.acm.org/~tomaszrybak

Attachment: signature.asc
Description: To jest część wiadomości podpisana cyfrowo

_______________________________________________
PyCUDA mailing list
[email protected]
http://tiker.net/mailman/listinfo/pycuda_tiker.net

Reply via email to