[GRASS-user] 4D radial basis function interpolation / extrapolation possible?

Hamish hamish_nospam at yahoo.com
Mon Oct 8 08:29:23 EDT 2007


Jian Chen wrote:
> I am new to Grass and wondered if Grass provides a radial basis
> function method to interpolate / extrapolate 4D data. Basically, I
> need to get (interpolate / extrapolate) a velocity field in a
> three-dimensional volume given several sampling data in the space. If
> written in a function format, it looks like
> 
> result_new = f(x[], y[], z[], result[], xnew, ynew, znew);
> 
> where, x[], y[], z[], and result[] are known.
> (xnew, ynew, znew) represent a point in space and result_new returns
> the result.
> 
> Can someone please advice? If Grass cannot handle this, can someone
> please point other libraries to me that might be able to do so.
> Matlab's griddata3 only does linear interpolation that doesn't help.


just an idea, probably applies just as well to matlab's griddata3 too.
(n.b. I am not sure if this is mathematically appropriate...)

First in matlab use the cart2sph function to convert velocity xyz vector
components into magnitude, azimuth angle, and elevation angle.

Then write a text file with:
x,y,z,magnitude,azimuth,elevation

Next load in your data into GRASS as 3D vector points with v.in.ascii.
Magnitude, azimuth, and elevation will be numerical attribute columns.
Next set 2D region settings with g.region.
Next interpolate each component with v.vol.rst into 3 different raster-3D
cubes.

Finally use a r3.mapcalc expression to create u,v,w components from
magnitude,az,elev.
  (2D trig hints for that can be found in the d.rast.arrow help page)

r3.out.ascii or r3.to.rast+r.out.mat back to matlab.


?
Hamish




More information about the grass-user mailing list