Package generic_fns :: Package structure :: Module mass
[hide private]
[frames] | no frames]

Module mass

source code

Functions [hide private]
list of 3 floats (or tuple of a list of 3 floats and one float)
centre_of_mass(atom_id=None, model=None, return_mass=False)
Calculate and return the centre of mass of the structure.
source code
Variables [hide private]
  __package__ = 'generic_fns.structure'

Imports: float64, zeros, warn, return_molecule, return_residue, return_spin, return_atomic_mass, RelaxError, RelaxNoPdbError, RelaxWarning


Function Details [hide private]

centre_of_mass(atom_id=None, model=None, return_mass=False)

source code 

Calculate and return the centre of mass of the structure.

Parameters:
  • atom_id (str or None) - The molecule, residue, and atom identifier string. Only atoms matching this selection will be used.
  • model (int or None) - Only use a specific model.
  • return_mass (bool) - A flag which if False will cause only the centre of mass to be returned, but if True will cause the centre of mass and the mass itself to be returned as a tuple.
Returns: list of 3 floats (or tuple of a list of 3 floats and one float)
The centre of mass vector, and additionally the mass.