Visualization#
The visualization module contains classes for generating three-dimensional visuals.
- class CrystalStructure(A, ux, uy, uz, atms, colors, nu=1, nv=1, nw=1)[source]
Draw a crystal structure. Atom can drawn with various radii with occupancy displayed using opacity. Atoms can allso be draw as atomic displacement ellipsoids or be decorated with magnetic moments vectors.
- Parameters:
- A2d-array
Real-space Cartesian transform.
- ux, uy, uz1d-array
Cartesian fractional coordinates.
- atms1d-array, str
Atom labels.
- colors2d-array
RGB color for each atom.
- nu, nv, nwint
Number of cells along each dimension. Default is
1
along each dimension.
Methods
show_figure()
save_figure()
view_direction)
draw_basis_vectors()
draw_cell_edges()
atomic_radii()
atomic_displacement_ellipsoids()
magnetic_vectors()
- atomic_displacement_ellipsoids(Uxx, Uyy, Uzz, Uyz, Uxz, Uxy, p=0.99)[source]
Draw atomic displacement ellipsoids
- Parameters:
- Uxx, Uyy, Uzz, Uyz, Uxz, Uxy1d-array
Atomic displacement parameters in Cartesian coordinates.
- pfloat
Probability surface. Default is
p=0.99
- atomic_radii(radii, occ)[source]
Draw atoms with given radii and displayed with opacity corresponding to site occupancy
- Parameters:
- radii1d-array
The radii of the atom sites.
- occ1d-array
The site occupancy of each atom. The value ranges from 0-1.
- draw_basis_vectors()[source]
Draw the baasis vector directions for the crytallographic directions.
- draw_cell_edges()[source]
Draw unit cell edges.
- magnetic_vectors(sx, sy, sz)[source]
Draw magnetic vectors.
- Parameters:
- sx, sy, sz1d-array
The magnetic moment vector components in Cartesian coordinates.
- save_figure(filename)[source]
Save the figure as a graphic image.
- Parameters:
- filenamestr
Name of file with extension. Supported extensions are
.svg
and.pdf
.
- show_figure()[source]
Display the drawing.
- view_direction(u, v, w)[source]
View drawing along a crystallographic direction.
- Parameters:
- u, v, wfloat
Components of the viewing axis. Units are in fractional coordinates.