biotite.structure.mass_center

biotite.structure.mass_center(array, masses=None)[source]

Calculate the center(s) of mass of an atom array or stack.

Parameters
arrayAtomArray or AtomArrayStack

The array or stack to calculate the center(s) of mass for.

massesndarray, optional

The masses to use for each atom in the input array. Must have the same length as array. By default, the standard atomic mass for each element is taken.

Returns
radiusndarray, ndarray, dtype=float

Array containing the the coordinates of the center of mass. If array is an AtomArray, this will be an length 3 ndarray; if it is an AtomArrayStack with n models, a (n x 3) ndarray is returned.