LatticeAtoms¶
-
class
sknano.core.atoms.
LatticeAtoms
(*args, xperiodic=False, yperiodic=False, zperiodic=False, **kwargs)[source] [edit on github][source]¶ Bases:
sknano.core.atoms.mixins.PBCAtomsMixin
,sknano.core.atoms.atoms.Atoms
An
Atoms
sub-class for crystal structure lattice atoms.Sub-class of
Atoms
class, and a container class for lists ofLatticeAtom
instances.Parameters: atoms ({None, sequence, LatticeAtoms
}, optional) – if notNone
, then a list ofLatticeAtom
instance objects or an existingLatticeAtoms
instance object.Attributes
M
Total mass of Atoms
.Natoms
Number of atoms in Atoms
.cell
Alias for LatticeAtoms.cell_matrix
.cell_matrix
Return the Crystal3DLattice.cell_matrix
.elements
ndarray
ofAtom.element
s.fmtstr
Format string. lattice
Return the LatticeAtom.lattice
of the first atom in self.masses
ndarray
ofAtom.mass
s.pbc
Return boolean array of periodic boundaries set along x,y,z
axes.rs
Vectors
ofLatticeAtom.rs
Vector
ssymbols
ndarray
ofAtom.symbol
s.xperiodic
Return True
if periodic along thex
axis.xs
ndarray
ofLatticeAtom.xs
valuesyperiodic
Return True
if periodic along they
axis.ys
ndarray
ofLatticeAtom.ys
valueszperiodic
Return True
if periodic along thez
axis.zs
ndarray
ofLatticeAtom.zs
valuesMethods
append
(atom)clear
()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.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.select
([selstr, selstrlist, verbose])Return Atom
orAtoms
from selection command.set_pbc
(dims)Set periodic boundaries along dims
.sort
([key, reverse])todict
()Return dict
of constructor parameters.unset_pbc
()Turn of PBCs along all dimensions. update_attrs
(**kwargs)Call update_attrs
method on each atom.wrap_coords
([pbc])Wrap coordinates into lattice.