def nearest_data(self, pt, k=<NUM_LIT:2>, n_jobs=-<NUM_LIT:1>):
pt = np.asarray(pt, dtype=np.float32)<EOL>if len(pt.shape) == <NUM_LIT:1>:<EOL><INDENT>r = self.nearest_data([pt], k=k, n_jobs=n_jobs)[<NUM_LIT:0>];<EOL>return (r[<NUM_LIT:0>][<NUM_LIT:0>], r[<NUM_LIT:1>][<NUM_LIT:0>], r[<NUM_LIT:2>][<NUM_LIT:0>])<EOL><DEDENT>pt = pt.T if pt.shape[<NUM_LIT:0>] == self.coordinates.shape[<NUM_LIT:0>] else pt<EOL>try:              (d, near) = self.face_hash.query(pt, k=k, n_jobs=n_jobs)<EOL>except Exception: (d, near) = self.face_hash.query(pt, k=k)<EOL>ids = [tri_no if tri_no is not None else self._find_triangle_search(x, <NUM_LIT:2>*k, set(near_i))<EOL>for (x, near_i) in zip(pt, near)<EOL>for tri_no in [next((k for k in near_i if self.is_point_in_face(k, x)), None)]]<EOL>pips = [self.point_in_plane(i, p) if i is not None else (<NUM_LIT:0>, None)<EOL>for (i,p) in zip(ids, pt)]<EOL>return (np.asarray(ids),<EOL>np.asarray([d[<NUM_LIT:0>] for d in pips]),<EOL>np.asarray([d[<NUM_LIT:1>] for d in pips]))<EOL>
mesh.nearest_data(pt) yields a tuple (k, d, x) of the matrix x containing the point(s)
nearest the given point(s) pt that is/are in the mesh; a vector d if the distances between
the point(s) pt and x; and k, the face index/indices of the triangles containing the 
point(s) in x.
Note that this function and those of this class are made for spherical meshes and are not
intended to work with other kinds of complex topologies; though they might work 
heuristically.