ReadTheDocs

Introduction

flowws-unit-cell is a set of modules to identify crystalline unit cells. At a high level, this analysis proceeds in 4 steps:

  1. Manually select a clean, single grain of well-ordered particles
  2. Select three vectors specifying the periodic directions of the crystal
  3. Project the observations into the unit cell and cluster the resulting coordinates
  4. 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:

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
run(scope, storage)[source]

Display the interactive direction- and distance-selection visuals.

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
run(scope, storage)[source]

Detect the space group and center the system.

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
run(scope, storage)[source]

Project and cluster the particles.

Indices and tables