Index: /issm/trunk-jpl/src/m/interp/holefiller.py
===================================================================
--- /issm/trunk-jpl/src/m/interp/holefiller.py	(revision 17866)
+++ /issm/trunk-jpl/src/m/interp/holefiller.py	(revision 17867)
@@ -2,9 +2,10 @@
 from scipy.spatial import cKDTree
 
-def nearestneighbors(md,data,goodids,badids,knn):
+def nearestneighbors(x,y,data,goodids,badids,knn):
 	'''
 	fill holes using nearest neigbors.  Arguments include:
 
-	md:		the model
+
+	x,y:		the coordinates of data to be filled 
 	data:		the data field to be filled (full field, including holes)
 	goodids:	id's into the vertices that have good data
@@ -15,8 +16,8 @@
 
 	Usage:
-		filleddata=nearestneighbors(md,goodids,badids,knn)
+		filleddata=nearestneighbors(x,y,data,goodids,badids,knn)
 
 	Example:
-		filledthickness=nearestneighbors(md,goodids,badids,5)
+		filledthickness=nearestneighbors(x,y,data,goodids,badids,5)
 	'''
 
@@ -24,11 +25,11 @@
 		raise TypeError('nearestneighbors error: knn should be an integer>1')
 
-	if len(data) != md.mesh.numberofvertices:
-		raise StandardError('nearestneighbors error: "data" should have length md.mesh.numberofvertices')
+	if len(x) != len(data) or len(y) != len(data):
+		raise StandardError('nearestneighbors error: x and y should have the same length as "data"')
 
 	filled=data
 	
-	XYGood=npy.dstack([md.mesh.x[goodids],md.mesh.y[goodids]])[0]
-	XYBad=npy.dstack([md.mesh.x[badids],md.mesh.y[badids]])[0]
+	XYGood=npy.dstack([x[goodids],y[goodids]])[0]
+	XYBad=npy.dstack([x[badids],y[badids]])[0]
 	tree=cKDTree(XYGood)
 	nearest=tree.query(XYBad,k=knn)[1]
