pybec.analysis.get_centroid

pybec.analysis.get_centroid(atoms_dict, key='all')[source]

Calculate the centroid of the atoms of a certian element in a unit cell.

Parameters
  • atoms_dict (dict) – dictionary of atomic coordinates in Angstroms, where the keys are the element symbols and the values are the numpy coordinate array for all atoms of that element.

  • key (str) – the symbol of the element you would like to calculate the centroid for. If ‘all’ is given, the centroid of the entire unit cell will be computed.

Returns

a numpy array of the x,y, and z coordinates (in Angstroms) of the centroid.

Return type

numpy.ndarray