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:
return None, None
// drop dimmer points that are closer than separation to each other
After Change
pos_rescaled = self.hash.to_eucl(pos)
coords_ok = []
for coord, coord_rescaled in zip(coords, coords_rescaled):
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