smbinterp/interp/grid/delaunay.py

16 lines
430 B
Python
Raw Normal View History

import scipy.spatial
from interp.grid import grid as basegrid
2011-03-23 10:14:50 -07:00
class dgrid(basegrid):
def __init__(self, points, values):
self.points = points
self.values = values
self.triangulation = scipy.spatial.Delaunay(points)
self.simplices = self.triangulation.vertices
self.tree = scipy.spatial.KDTree(points)
def find_simplex(self, X):
return self.triangulation.find_simplex(X)