XYZAtoms¶
-
class
sknano.core.atoms.xyz_atoms.
XYZAtoms
(atoms=None, update_item_class=True, **kwargs)[source] [edit on github][source]¶ Bases:
sknano.core.atoms.atoms.Atoms
An
Atoms
sub-class forXYZAtom
s.A container class for
XYZAtom
objects.Parameters: atoms ({None, sequence, XYZAtoms
}, optional) – if notNone
, then a list ofXYZAtom
instance objects or an existingXYZAtoms
instance object.Attributes
CM
Alias for center_of_mass
.M
Total mass of Atoms
.Natoms
Number of atoms in Atoms
.center_of_mass
Center-of-Mass coordinates of Atoms
.centroid
Centroid of Atoms
.com
Alias for center_of_mass
.coords
Alias for Atoms.r
.dr
Vectors
ofAtom.dr
displacementVector
selements
ndarray
ofAtom.element
s.fmtstr
Format string. inertia_tensor
Return inertia tensor about the origin. masses
ndarray
ofAtom.mass
s.moment_of_inertia
Alias for inertia_tensor
.positions
Alias for Atoms.r
.principal_axes
Return principal axes of rotation computed from the inertia tensor. principal_moments_of_inertia
Return principal moments of inertia. r
Vectors
ofAtom.r
positionVector
sradius_of_gyration
Return radius of gyration. symbols
ndarray
ofAtom.symbol
s.x
ndarray
ofXYZAtom.x
coordinates.y
ndarray
ofXYZAtom.y
coordinates.z
ndarray
ofXYZAtom.z
coordinates.Methods
align_principal_axis
(index, vector)Align principal_axes`[`index
] alongvector
.append
(atom)center_CM
([axis])Alias for center_center_of_mass
.center_center_of_mass
([axis])Center atoms on center-of-mass coordinates. center_centroid
()Center centroid
on origin.center_com
([axis])Alias for center_center_of_mass
.clear
()clip_bounds
(region[, center_before_clipping])Remove atoms outside the given region. copy
()count
(item)extend
(other)filter
(condition[, invert])Filter Atoms
bycondition
.filtered
(condition[, invert])Return new list of Atoms
filtered bycondition
.get_atoms
([asarray, aslist])Return Atoms
either as list (default) or numpy array or self.get_coords
([asdict])Return atom coords. getattr
(attr[, default, recursive])Get ndarray
of atom attributesattr
.index
(item, *args)insert
(i, atom)mapatomattr
([from_attr, to_attr, attrmap])Set/update atom attribute from another atom attribute with dict. pop
([i])remove
(item)reset_attrs
(**kwargs)Call corresponding reset_attrs
method on each atomreverse
()rezero
([epsilon])Set values with absolute value less than epsilon
to zero.rezero_coords
([epsilon])Alias for Atoms.rezero_xyz
.rezero_xyz
([epsilon])Rezero position vector components with absolute value less than epsilon
.select
([selstr, selstrlist, verbose])Return Atom
orAtoms
from selection command.sort
([key, reverse])todict
()Return dict
of constructor parameters.update_attrs
(**kwargs)Call update_attrs
method on each atom.