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


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





--
------------------------------------
Roberto Vidmar Registered Linux User 61871

 ___  __  __    OCEANOGRAFIA
/  / /__ /__    GEOFISICA
/__/ /__/ __/    SPERIMENTALE
Istituto Nazionale di Oceanografia e
di Geofisica Sperimentale
34010 Sgonico (TS) ITALY

Research Group: CARS
(Cartography And Remote Sensing)
CARS Group is certified ISO 9001:2000

Tel. +39 040 2140 336 direct
Tel. +39 040 2140 1  operator

E-mail: [email protected]
------------------------------------


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

Reply via email to