Introduction¶
flowws-unit-cell
is a set of modules to identify crystalline unit
cells. At a high level, this analysis proceeds in 4 steps:
- Manually select a clean, single grain of well-ordered particles
- Select three vectors specifying the periodic directions of the crystal
- Project the observations into the unit cell and cluster the resulting coordinates
- Detect the space group and center the system accordingly
flowws-unit-cell
implements this workflow interactively in the
desktop or jupyter notebook as a set of modules using
flowws-analysis.
Installation¶
Install flowws-unit-cell
from PyPI:
pip install flowws-unit-cell
Alternatively, install it from source:
pip install git+https://github.com/glotzerlab/flowws-unit-cell.git#egg=flowws-unit-cell
API Documentation¶
Browse more detailed documentation online or build the sphinx documentation from source:
git clone https://github.com/glotzerlab/flowws-unit-cell
cd flowws-unit-cell/doc
pip install -r requirements.txt
make html
Usage¶
The modules provided in this project are designed to be used as part of a live flowws-analysis workflow, sandwiched between data sources and interactive backends and/or data sinks. Consult the flowws documentation or the flowws-examples project for information on how to create and execute workflows.
A suggested workflow:
- Read in data (
flowws_analysis.Pyriodic
for simple test data, otherwise read in a file withflowws_analysis.GTAR
orflowws_analysis.Garnett
) - Select a clean crystalline grain (
flowws_analysis.Selection
andflowws_analysis.Plato
) - Compute the RDF (
flowws_freud.RDF
) - Select directions and distances to form the basis of the unit cell (
flowws_unit_cell.BasisSelection
) - Project all particles into the smaller unit cell and cluster (
flowws_unit_cell.Projection
) - Center the system according to the automatically-detected space group (
flowws_unit_cell.CenterSpaceGroup
) - Visualize the resulting unit cell (
flowws_analysis.Plato
) - Display plots and add interactivity (
flowws_analysis.ViewNotebook
orflowws_analysis.ViewQt
) - Optionally, save the final unit cell (
flowws_analysis.SaveGarnett
)
Modules¶
-
class
flowws_unit_cell.
BasisSelection
(*args, **kwargs)[source]¶ Select directions and distances to form the basis vectors for a unit cell.
This stage produces two visuals: a bond orientational order diagram that can be used to select symmetric directions, and a “cylindrical RDF” that measures bonds along each given direction. Together, these can be used to select the direction and length of the three basis vectors for the unit cell.
Parameters: - orientations – Quaternions specifying orientations for basis vectors (in the (0, 0, 1) direction)
- r_max – Maximum distance to consider for binds to select for the unit cell basis vectors
- angle_tolerance – Angle tolerance for selecting bonds (in degrees)
- rdf_bins – Number of bins to use for cylindrical RDF
- x_direction – Candidate direction to take as the x direction in the final unit cell
- x_min – Minimum distance to take bonds from the cylindrical RDF for the x basis vector
- x_max – Maximum distance to take bonds from the cylindrical RDF for the x basis vector
- y_direction – Candidate direction to take as the y direction in the final unit cell
- y_min – Minimum distance to take bonds from the cylindrical RDF for the y basis vector
- y_max – Maximum distance to take bonds from the cylindrical RDF for the y basis vector
- z_direction – Candidate direction to take as the z direction in the final unit cell
- z_min – Minimum distance to take bonds from the cylindrical RDF for the z basis vector
- z_max – Maximum distance to take bonds from the cylindrical RDF for the z basis vector
-
class
flowws_unit_cell.
CenterSpaceGroup
(**kwargs)[source]¶ Attempt to automatically detect the space group of the system and center it accordingly.
Parameters: - minimum_distance – Precision with which to merge points transformed by space group transformations
- use_types – Use type information when centering the unit cell
-
class
flowws_unit_cell.
Projection
(**kwargs)[source]¶ Project the system using a previously-calculated set of basis vectors.
This stage wraps the system into the box specified by a given box matrix and clusters the particles using sklearn. Either a density map or the final cluster centers can be visualized.
Parameters: - color_scale – Scale to adjust colors by in the reduced unit cell density map
- minimum_distance – Distance scale to use to cluster projected unit cell particles
- density – If True, plot a density map instead of clustered points