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-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
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
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.Pyriodicfor simple test data, otherwise read in a file with
- Select a clean crystalline grain (
- Compute the RDF (
- Select directions and distances to form the basis of the unit cell (
- Project all particles into the smaller unit cell and cluster (
- Center the system according to the automatically-detected space group (
- Visualize the resulting unit cell (
- Display plots and add interactivity (
- Optionally, save the final unit cell (
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.
- 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
Display the interactive direction- and distance-selection visuals.
Attempt to automatically detect the space group of the system and center it accordingly.
- minimum_distance – Precision with which to merge points transformed by space group transformations
- use_types – Use type information when centering the unit cell
Detect the space group and center the system.
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.
- 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
Project and cluster the particles.