space_group module

Space group support, including building operator dictionary for 230 space groups.

usage:space_group.py [build] [name(s)]

Module author: Michael Chapman <chapmami@ohsu.edu>

Authors:

Michael S. Chapman <chapmami@ohsu.edu>

Oregon Health & Science University

Version:

0.5, March 23, 2016

Changed in version 0.1: 09/15/2011

Changed in version 0.2: 11/23/2011

Changed in version 0.5: 05/02/2011 ReStructuredText docs

Prints the operator list for space groups listed (Hermann-Mauguin symbols). The space group operator dictionary is built through calls to cctbx.sgtbx (Gross-Kunstleve, RW & CCI, http://cci.lbl.gov). The dictionary is pickled so that the SpaceGroups class defined here can be used without further dependence on cctbx.

class space_group.SpaceGroups

Bases: object

Variables:lib – keyed by the extended Hermann-Mauguin symbol with values that are lists of the operators as tuples of (rotation, translation), all in fractional coordinates.
build()

Builds self.lib, a dictionary of operators for all 230 space groups.

Returns:self
Return type:SpaceGroup
jar = 'space_group.pkl'
pickle()

Serialize self.lib, the dictionary of space group operators.

which(name)

Deduce unique Hermann-Mauguin (extended) International symbol.

The approximation to the short form of the Hermann-Mauguin symbol supported is not fully general (International Tables vol A, sect 12.3), but works for the 65 chiral groups, is used by CCP4 (and most macromolecular crystallographers). If in doubt, use the extended form!

Settings are required to designate the rhombohedral (‘:R’) or hexagonal settings (‘:H’) for rhombohedral, and alternative settings of several other space groups. (The choice should be consistent w/ input of cell parameters!)

Parameters:name (str) – (optionally shortened) Hermann-Mauguin symbol. Screw axes can be formatted as ‘2_1’, ‘2(1)’ or ‘21’. Axis-designating ‘ 1’ can be removed except for P1 and unless needed to resolve ambiguity. Spaces can be removed. The setting, eg. ‘H’, ‘R’ or ‘2’ is appended after a colon.
Returns:International extended Hermann-Mauguin symbol (unique).
Return type:string
Raises ValueError:
 if name does not give one and only one match.
space_group.lattice_operators(space_group_name=None, verbose=True)

Lattice symmetry operators for a single space group.

Requires cctbx.sgtbx to be available.

Parameters:space_group_name (str) – eg P2_12_1_2 or P2(1)2(1)2 or P21212
Returns:symmetry operators: [(rotation, translation)]*N, fractional coordinates OR None
Return type:list(tuple(numpy.matrix(dtype=float,shape=(3,3), numpy.matrix(dtype=float, shape=(1,3))))