sknano.core.atoms.BasisAtoms¶
-
class
sknano.core.atoms.
BasisAtoms
(atoms=None, casttype=True, **kwargs)[source][source]¶ An
Atoms
sub-class for crystal structure basis atoms.Sub-class of
Atoms
class, and a container class for lists ofBasisAtom
instances.Parameters: atoms : {None, sequence,
BasisAtoms
}, optionalif not None, then a list of
BasisAtom
instance objects or an existingBasisAtoms
instance object.Attributes
CM
Alias for center_of_mass
.M
Total mass of Atoms
.Natoms
Number of atoms in Atoms
.bounds
Bounds of 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
ndarray
ofAtom.dr
displacement Vectorselements
ndarray
ofAtom.element
s inAtoms
.fmtstr
inertia_tensor
Inertia tensor. lattice
masses
ndarray
ofAtom.mass
s inAtoms
.pbc
r
ndarray
ofAtom.r
position Vectorsrs
ndarray
ofAtom.r
position Vectorssymbols
ndarray
ofAtom.symbol
s inAtoms
.x
ndarray
ofAtom
s \(x\) coordinates.xs
ndarray
ofAtom
s \(x\) coordinates.y
ndarray
ofAtom
s \(y\) coordinates.ys
ndarray
ofAtom
s \(y\) coordinates.z
ndarray
ofAtom
s \(z\) coordinates.zs
ndarray
ofAtom
s \(z\) coordinates.Methods
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
by condition.filtered
(condition[, invert])Return new list of Atoms
filtered by condition.get_atoms
([asarray])Return list of Atoms
.get_coords
([asdict])Return atom coords. getatomattr
(attr)Get ndarray
of atom attributes attr.index
(item, *args)insert
(i, item)mapatomattr
([from_attr, to_attr, attrmap])Set/update atom attribute from another atom attribute with dict. pop
([i])remove
(item)reverse
()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. rotate
(**kwargs)Rotate Atom
vectors.set_pbc
([xperiodic, yperiodic, zperiodic])sort
([key, reverse])todict
()translate
(t[, fix_anchor_points])Translate Atom
vectors byVector
t.unset_pbc
()wrap_coords
([pbc])