XYZAtom

class sknano.core.atoms.xyz_atoms.XYZAtom(*args, x=None, y=None, z=None, **kwargs)[source] [edit on github][source]

Bases: sknano.core.atoms.atoms.Atom

An Atom sub-class with x, y, z attributes.

Parameters:
  • element ({str, int}, optional) – A string representation of the element symbol or an integer specifying an element atomic number.
  • y, z (x,) – \(x, y, z\) components of XYZAtom position vector relative to origin.

Attributes

Z Atomic number \(Z\).
dr \(x, y, z\) components of Atom displacement vector.
element Element symbol.
fmtstr Format string.
m An alias for mass.
mass Atomic mass \(m_a\) in atomic mass units.
r \(x, y, z\) components of Atom position vector.
r0 \(x, y, z\) components of Atom position vector at t=0.
symbol Element symbol.
x \(x\)-coordinate in units of Angstroms.
y \(y\)-coordinate in units of Angstroms.
z \(z\)-coordinate in units of Angstroms.

Methods

get_coords([asdict]) Return atom coords.
getattr(attr[, default, recursive]) Get atom attribute named attr.
reset_attrs(**kwargs) Reset atom attributes.
rezero([epsilon]) Alias for Atom.rezero_xyz, but calls super class rezero method as well.
rezero_coords([epsilon]) Alias for Atom.rezero_xyz.
rezero_xyz([epsilon]) Re-zero position vector components.
todict() Return dict of constructor parameters.
update_attrs(**kwargs) Update atom attributes.

Attributes Summary

dr \(x, y, z\) components of Atom displacement vector.
r \(x, y, z\) components of Atom position vector.
r0 \(x, y, z\) components of Atom position vector at t=0.
x \(x\)-coordinate in units of Angstroms.
y \(y\)-coordinate in units of Angstroms.
z \(z\)-coordinate in units of Angstroms.

Methods Summary

get_coords([asdict]) Return atom coords.
rezero([epsilon]) Alias for Atom.rezero_xyz, but calls super class rezero method as well.
rezero_coords([epsilon]) Alias for Atom.rezero_xyz.
rezero_xyz([epsilon]) Re-zero position vector components.
todict() Return dict of constructor parameters.

Attributes Documentation

dr

\(x, y, z\) components of Atom displacement vector.

Returns:3-element ndarray of [\(x, y, z\)] coordinates of Atom.
Return type:ndarray
r

\(x, y, z\) components of Atom position vector.

Returns:3D Vector of [\(x, y, z\)] coordinates of Atom.
Return type:Vector
r0

\(x, y, z\) components of Atom position vector at t=0.

Returns:3-element ndarray of [\(x, y, z\)] coordinates of Atom.
Return type:ndarray
x

\(x\)-coordinate in units of Angstroms.

Returns:\(x\)-coordinate in units of Angstroms.
Return type:float
y

\(y\)-coordinate in units of Angstroms.

Returns:\(y\)-coordinate in units of Angstroms.
Return type:float
z

\(z\)-coordinate in units of Angstroms.

Returns:\(z\)-coordinate in units of Angstroms.
Return type:float

Methods Documentation

get_coords(asdict=False)[source] [edit on github][source]

Return atom coords.

Parameters:asdict (bool, optional) –
Returns:coords
Return type:OrderedDict or ndarray
rezero(epsilon=1e-10)[source] [edit on github][source]

Alias for Atom.rezero_xyz, but calls super class rezero method as well.

rezero_coords(epsilon=1e-10)[source] [edit on github][source]

Alias for Atom.rezero_xyz.

rezero_xyz(epsilon=1e-10)[source] [edit on github][source]

Re-zero position vector components.

Set position vector components with absolute value less than epsilon to zero.

Unlike the Atom.rezero method, this method does not call the super class rezero method.

Parameters:epsilon (float) – smallest allowed absolute value of any \(x,y,z\) component.
todict()[source] [edit on github][source]

Return dict of constructor parameters.