Check out the Hyperspy Workshop May 13-17, 2024 Online

filter_vectors_near_basis#

pyxem.utils.vectors.filter_vectors_near_basis(vectors, basis, columns=[0, 1], distance=None)[source]#

Filter an array of vectors to only the list of closest vectors to some set of basis vectors. Only vectors within some distance are considered. If no vector is within the distance np.nan is returned for that vector.

Parameters:
  • vectors (array-like) – A two dimensional array of vectors where each row identifies a new vector

  • basis (array-like) – A two dimensional array of vectors where each row identifies a vector.

  • columns (list) – A list of columns to consider when comparing vectors. The default is [0,1]

Returns:

closest_vectors – An array of vectors which are the closest to the basis considered.

Return type:

array-like