Setting TGraphDelaunay interpolation for TGraph2D

Hi Rooters,

I have to questions about interpolation of TGraph2D using Delaunay tesselation.

First one:
I need to keep track of those points that I want to interpolate but are outside the convex hull defined by the TGRaph2D points, and therefore cannot be interpolated. For these points TGraphDelaunay::ComputeZ() returns theValue = fZout. Now, fZout can be set with TGraphDelaunay::SetMarginBinsContent(my_z) which gives me a tool identify out-of-hull points (i.e. setting for example -99999999.99 which is by far outside the range of my z-values I know that the (x,y) point can’t be interpolated). Here is the question: Does the method TGraph2D::SetMarginBinsContent() sets the same fZout variable that uses TGraphDelaunay::ComputeZ()?

Second question:
For those points outside the convex hull (call them: Xs) I need to find the closest triangle of the tesselation to that point. I can easily find the closest vertex of the tesselation to X, but not no easily the whole triangle. Is there any method to do this?

Thanks in advance.

Yes, thanks to the following lines in TGraph2D::GetHistogram

[...]
   // Add a TGraphDelaunay in the list of the fHistogram's functions
   TGraphDelaunay *dt = new TGraphDelaunay(this);
   dt->SetMaxIter(fMaxIter);
   dt->SetMarginBinsContent(fZout);
[...]

Nothing like that is implemented right now. If you implement something we can include it in the class.
May be you can make a second TGrap2D including these points and ComputeZ on them ?

[quote=“couet”][quote]
Does the method TGraph2D::SetMarginBinsContent() sets the same fZout variable that uses TGraphDelaunay::ComputeZ()?
[/quote]

Yes, thanks to the following lines in TGraph2D::GetHistogram

[...] // Add a TGraphDelaunay in the list of the fHistogram's functions TGraphDelaunay *dt = new TGraphDelaunay(this); dt->SetMaxIter(fMaxIter); dt->SetMarginBinsContent(fZout); [...] [/quote]

Thanks a lot, that saves me a lot of time.

[quote=“couet”][quote]
I can easily find the closest vertex of the tessellation to X, but not no easily the whole triangle. Is there any method to do this?
[/quote]

Nothing like that is implemented right now. If you implement something we can include it in the class[/quote]

I’ll make a try to implement that.

[quote=“couet”]
May be you can make a second TGrap2D including these points and ComputeZ on them ?[/quote]

I use a set of points to define the tesselation, and the interpolation of those points is compared against another set of points (which might lie outside the original tesselation). Unfortunately, I can’t use interpolation on the second set since the comparison is made point-to-tesselation, on a point-by-point basis.

Ok, let me know if you come with something.