Scene Module

Scenes

class czone.scene.scene.Scene(bounds=None, objects=None)

Bases: object

Scene classes manage multiple objects interacting in space with cell boundaries.

bounds

2x3 array defining rectangular bounds of scene.

Type

np.ndarray

objects

List of all objects currently in scene.

Type

List[BaseVolume]

all_atoms

Coordinates of all atoms in scene after precedence checks.

Type

np.ndarray

all_species

Atomic numbers of all atoms in scene after precedence checks.

Type

np.ndarray

ase_atoms

Collection of atoms in scene as ASE Atoms object.

Type

Atoms

add_object(ob: czone.volume.volume.BaseVolume)

Add an object to the scene.

Parameters

ob (BaseVolume) – object to add to scene.

property all_atoms

Positions of all atoms currently in the scene after evaluating conflict resolution.

property all_species

Atomic numbers of all atoms currently in the scene after evaluating conflict resolution.

property ase_atoms

Collection of atoms in scene as ASE Atoms object.

property bounds

Current boundaries of nanoscale scene.

property objects

List of objects in current scene.

populate()

Populate the scene with atoms according to Volumes and priority levels.

First, every object populates atoms against its own boundaries. Then, gather the list of priorities from all the objects. For each object, generate a True array of length ob.atoms. For each object in the same priority level or lower, perform interiority check and repeatedly perform logical_and to see if atoms belong in scene.

  • Lower priority numbers supercede objects with high priority numbers.

  • Objects on the same priority level will not supply atoms to the scene in their volume intersections.

species_from_object(idx: int)

Grab all the atoms from contributing object at idx.

Returns

Numpy array of all positions of atoms contributed by object at idx.

to_file(fname, **kwargs)

Write atomic scene to an output file, using ASE write utilities.

If format=”prismatic”, will default to Debye-Waller factors of 0.1 RMS displacement in squared angstroms, unless dictionary of debye-waller factors is otherwise supplied.

Parameters
  • fname (str) – output file name.

  • **kwargs – any key word arguments otherwise accepted by ASE write.