availble solutions for 2D interpolation on non monotonic scattered data
5 views (last 30 days)
Show older comments
Laura on 8 Nov 2012
I have been reading many posts regarding the interpolation of data of the form Z(x,y), being x y scattered data points which can not be transformed to monotonic vectors. However I still have some questions. My data are vectors of X, Y (coordinates), and associated Z, R.... of property values. Moreover the domain defined by X, Y vectors is not square. In this situation:
1. when I triangulate the data the triangles in the borders (actually in one border in my particular case) are sliver-like and connect points that are remote from each other. But also when creating an equi-spaciated grid in which to interpolate, I get quite a lot of NaNs for those triangles out of my triangulated region.
For getting rid of those problems I could: define a triangle shape factor criteria to eliminate "bad triangles", still have to figure out how. (the NaNs values I do not see it a real problem so far, one I know their reason)
2. Regarding the interpolation methods available I would like to know is there are more than the three available in TriScatteredInterp (linear, nearest and natural), or the 'cubic' available in griddata. I am referring mainly to the use of splines.
I would really appreciate any information on how I could optimize the use of those tools for my particular case, of if there is any other option that I am missing
Dr. Seis on 8 Nov 2012
Edited: Dr. Seis on 8 Nov 2012
I posted this a while back, perhaps it could be useful here:
It should be parameterized similar to interp2 (except you won't be giving it input data on a regular grid)... but, like any interpolation algorithm, it might behave oddly in the same areas you are getting NaNs (since it is not good at extrapolation).
Yeah... it looks like John's gridfit does a much better job at handling extrapolation (among other things) than the 2D biharmonic spline. Not sure why the BH spline is able to produce coefficients when input is both coarse and fine grids, but not when it is one or the other. I would be interested to see a picture of the X/Y locations of the fine grid compared to the coarse grid. What is the avg. spacing of the fine grid?
More Answers (1)
Laura on 9 Nov 2012
Ah yes... repeated data will do that. The BH spline will put the surface it creates exactly through the data you input... so if you have overlapping data in X/Y and they are associated with different Z values, then it will blow up. In that case John's gridfit will definitely be the choice to use. If you still want to use BH spline (for comparison) you would need to eliminate repeated data (maybe by throwing away data or some sort of average between the two or ... ?).
Find more on Interpolation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!