2011-09-17 18:23:21 -07:00
|
|
|
import scipy.spatial
|
2011-03-21 15:55:45 -07:00
|
|
|
|
2011-09-17 18:23:21 -07:00
|
|
|
from interp.grid import grid as basegrid
|
2011-03-22 13:20:25 -07:00
|
|
|
|
2011-03-21 15:55:45 -07:00
|
|
|
|
2011-03-23 10:14:50 -07:00
|
|
|
class dgrid(basegrid):
|
2011-09-17 18:23:21 -07:00
|
|
|
def __init__(self, points, values):
|
|
|
|
self.points = points
|
|
|
|
self.values = values
|
|
|
|
self.triangulation = scipy.spatial.Delaunay(points)
|
2011-09-27 14:23:42 -07:00
|
|
|
self.simplices = self.triangulation.vertices
|
|
|
|
self.tree = scipy.spatial.KDTree(points)
|
2011-09-17 18:23:21 -07:00
|
|
|
|
2011-09-27 14:23:42 -07:00
|
|
|
def find_simplex(self, X):
|
|
|
|
return self.triangulation.find_simplex(X)
|