masses
- mdtools.check.masses(ag, flash_test=True)[source]
Check atom masses.
Deprecated since version 0.0.0.dev0:
mdtools.check.masses()
will be replaced bymdtools.check.masses_new()
in a future release.MDAnalysis always guesses atom masses from the atom type, even if the input file contains the masses. This might result in wrong mass assignments. If the mass cannot be guessed at all, a mass of 0 is assigned. Hence, it is important to check the correct assignment of masses before calculating mass dependent quantities like the center of mass.
- Parameters:
ag (
MDAnalysis.core.groups.AtomGroup
) – The MDAnalysisAtomGroup
whose masses shall be checked.flash_test (
bool
, optional) – IfTrue
(default), only check if any atom type in ag was assigned a zero mass. IfFalse
, print a list of all different atom types in ag with their corresponding masses guessed by MDAnalysis so that the user can check whether the masses were guessed correctly.
- Raises:
ValueError – If one or more atoms of ag have zero mass.
Note
This function only checks if any atom type was assigned a zero mass. This functions checks not whether non-zero masses were assigned correctly. This can be done manually by the user, when flash_test is set to
False
.