sknano.core.atoms.KDTAtoms

class sknano.core.atoms.KDTAtoms(atoms=None, copylist=True, deepcopy=False)[source][source]

An Atoms sub-class for KDTree analysis.

Sub-class of XAtoms class, and a container class for lists of KDTAtom instances.

Parameters:

atoms : {None, sequence, KDTAtoms}, optional

if not None, then a list of KDTAtom instance objects or an existing KDTAtoms instance object.

copylist : bool, optional

perform shallow copy of atoms list

deepcopy : bool, optional

perform deepcopy of atoms list

Attributes

CM Center-of-Mass coordinates of Atoms.
M Total mass of Atoms.
NNrc Only return neighbors within this distance when querying the kd-tree.
Natoms Number of atoms in Atoms.
Ntypes Number of atomtypes.
atom_ids Return array of XAtom IDs.
atom_tree scipy.spatial.KDTree of
atomtypes atomtypes dict.
bonds Return list of bonds.
bounds Bounds of Atoms.
centroid Centroid of Atoms.
charges Return array of XAtom charges.
coordination_numbers Return array of KDTAtom coordination numbers.
coords numpy.ndarray of Atoms \(x, y, z\) coordinates.
inertia_tensor Return the inertia tensor.
kNN Number of nearest neighbors to return when querying the kd-tree.
masses Return list of Atom masses.
nearest_neighbors Return array of nearest-neighbor atoms for each KDTAtom.
q Return the total net charge of XAtoms.
symbols Return list of Atom symbols.
velocities Return array of XAtom velocities.
x numpy.ndarray of Atoms \(x\) coordinates.
y numpy.ndarray of Atoms \(y\) coordinates.
z numpy.ndarray of Atoms \(z\) coordinates.

Methods

add_atomtype(atom) Add atom type to atomtypes.
add_atomtypes([atoms]) Add atomtype for each atom in atoms to atomtypes dictionary.
append(item)
assign_unique_ids([starting_id]) Assign unique ID to each XAtom in XAtoms.
center_CM([axes]) Center atoms on CM coordinates.
clear()
clip_bounds(region[, center_before_clipping]) Remove atoms outside the given limits along given dimension.
copy()
count(item)
extend(other)
filter(condition[, invert]) Filter Atoms by condition.
filter_ids(atom_ids[, invert]) Return Atoms by XAtoms.atom_ids in atom_ids.
get_atom(atomID) Get XAtom with Xatom.atomID == atomID.
get_atoms([asarray]) Return list of Atoms.
get_coords([asdict]) Return atom coords.
getatomattr(attr) Get numpy.ndarray of atom attributes attr.
index(item, *args)
insert(i, item)
mapatomattr(attr, from_attr, attrmap) Set/update atom attribute from another atom attribute with dict.
pop([i])
query_atom_tree([k, eps, p, rc]) Query atom tree for nearest neighbors distances and indices.
query_ball_point(pts, r[, p, eps]) Find all Atoms within distance r of point(s) pts.
remove(item)
reverse()
rezero([epsilon]) Set really really small coordinates to zero.
rezero_coords([epsilon]) Alias for Atoms.rezero.
rezero_xyz([epsilon]) Alias for Atoms.rezero.
rotate([angle, rot_axis, anchor_point, ...]) Rotate Atom position vectors.
select(cmd)
select_within(volume)
sort([key, reverse])
translate(t[, fix_anchor_points]) Translate Atom position vectors by Vector t.
update_attrs() Update each KDTAtoms attributes.
update_bonds() Update KDTAtom.bonds list.
update_coordination_numbers() Update KDTAtom.CN.
update_nearest_neighbors() Update KDTAtom.NN.