viewer
This module is the interface to the Atomic Simulation Environment (ASE,
https://wiki.fysik.dtu.dk/ase/) GUI
, which enables a molecular viewer to be
launched. This viewer allows the visualization of atomic positions and bonds.
- class MDMC.MD.ase.viewer.Viewer(images: ase.gui.images.Images = None, rotations: str = '', expr: str = None)[source]
Subclasses the ASE
GUI
to provide a molecular viewer for MDMC.It modifies how
bonds
are plotted by using an alternativeget_bonds
function in theset_atoms
method.It removes
GUI
menu options that are not applicable in MDMC.Subset of default ASE
GUI
menu options which are applicable to MDMC
- MDMC.MD.ase.viewer.get_bonds(atoms: ASEAtoms) numpy.ndarray [source]
Adds
(0, 0, 0,)
to each bonded atom pair defined within anASEAtoms
object- Parameters
atoms (ASEAtoms) – The
ASEAtoms
object for which thebonds
are required for plotting
- MDMC.MD.ase.viewer.limit_atoms(atoms: ASEAtoms, max_atoms: int) ASEAtoms [source]
Limits the number of atoms that are passed to a visualizer
- MDMC.MD.ase.viewer.view(atoms: list[Atom], viewer: str = 'X3DOM', cell: numpy.ndarray = None, **settings: dict) Optional[IPython.core.display.HTML] [source]
Launches the ASE
GUI
for a collection of atoms- Parameters
atoms (list) – A list of
Atom
(MDMC.MD.structures.Atom
) to viewviewer (str, optional) – The viewer used to display the visualization. This can be ‘X3DOM’, which allows for inline visualization in Jupyter notebooks, or ‘ASE’, which displays in an external window. The default is ‘X3DOM’.
cell (numpy.ndarray, optional) – An
array
of float specifying the dimensions of the cell to view. The default is None.**settings –
max_atoms
(int)Sets the maximum number of atoms that will be viewed
- MDMC.MD.ase.viewer.view_ase(atoms: ASEAtoms, **settings: dict) None [source]
View atom using the ASE viewer
- Parameters
ase_atoms (ASEAtoms) – The
ASEAtoms
object to be visualized using the ASE viewer**settings –
max_atoms
(int)Sets the maximum number of atoms that will be viewed
- MDMC.MD.ase.viewer.view_x3dom(atoms: ASEAtoms, **settings: dict) IPython.core.display.HTML [source]
View atoms using the X3D viewer, which enables inline visualization within a IPython/Jupyter notebook
- Parameters
ase_atoms (ASEAtoms) – The
ASEAtoms
object to be visualized using the X3D viewer**settings –
max_atoms
(int)Sets the maximum number of atoms that will be viewed