// drop points that are further than search range from any initial point
max_dist = np.atleast_2d(self.search_range)
kdtree = cKDTree(coords / max_dist, 30)
found = kdtree.query_ball_point((pos - origin) / max_dist, 1.)
if len(found) > 0:
coords = coords[list(set([i for sl in found for i in sl]))]
else:
After Change
dists = np.sqrt(np.sum((coord_rescaled - pos_rescaled)**2, axis=1))
if np.any(dists <= self.search_range):
coords_ok.append(coord)
if len(coords_ok) == 0:
return None, None
coords = np.array(coords_ok)
// drop dimmer points that are closer than separation to each other
coords = drop_close(coords, self.separation,