site_analysis.atom

class Atom(index: int, species_string: Optional[str] = None)[source]

Bases: object

Represents a single persistent atom during a simulation.

index

Unique numeric index identifying this atom.

Type:int
in_site

Site index for the site this atom currently occupies.

Type:int
frac_coords

Numpy array containing the current fractional coordinates for this atom.

Type:np.array
trajectory

List of site indices occupied at each timestep.

Type:list

Note

The atom index is used to identify it when parsing structures, so needs to be e.g. the corresponding Site index in a Pymatgen Structure.

as_dict() → Dict[KT, VT][source]
assign_coords(structure: pymatgen.core.structure.Structure) → None[source]

Assign fractional coordinates to this atom from a pymatgen Structure.

Parameters:structure (pymatgen.Structure) – The Structure to use for this atom’s fractional coordinates.
Returns:None
frac_coords

Getter for the fractional coordinates of this atom.

Raises:AttributeError – if the fractional coordinates for this atom have not been set.
classmethod from_dict(d: Dict[KT, VT]) → site_analysis.atom.Atom[source]
classmethod from_file(filename)[source]
classmethod from_str(input_string: str) → site_analysis.atom.Atom[source]

Initiate an Atom object from a JSON-formatted string.

Parameters:input_string (str) – JSON-formatted string.
Returns:(Atom)
reset() → None[source]

Reset the state of this Atom.

Clears the in_site and trajectory attributes.

Returns:None
to(filename: Optional[str] = None) → str[source]
atoms_from_indices(indices: List[int]) → List[site_analysis.atom.Atom][source]
atoms_from_species_string(structure: pymatgen.core.structure.Structure, species_string: str) → List[site_analysis.atom.Atom][source]