Version 13 (modified by toby, 7 years ago) (diff)


Space Group Interpreter

GSAS-II incorporates the unique space group interpretation code developed for GSAS by Alan Larson and maintained by Robert Von Dreele as a Python module that wraps the GSAS Fortran code and provides several Python functions. These codes work by performing group theory analysis on the supplied space group name, rather than looking it up from tables, so it is capable of generation of operators for all standard settings of space groups (in Origin 2 only, where a choice exists) plus a very large number of non-standard space group settings. The f2py tool supplied in SciPy integrates the Fortran code into Python quite nicely. The is intended to be used as an independent module for programs needing space group interpretation capabilities.

The symmetry code includes routines:

  • SpcGroup: Determines cell and symmetry information from a short H-M space group name
  • SpaceGroup: Prints the results from SpcGroup in a nicely formatted way
  • GenAtom: Generates the full set of equivalent positions for a space group and one member of the set
  • SytSym: Determines the site multiplicity for a supplied fractional coordinate and classifies the site symmetry

See the documentation inside the code for more information.

The files used in this module are:

Unit Tests

Unit tests are provided that check that the results from SpcGroup and SpaceGroup are identical across platforms and match those computed independently (from program sgtbx in cctbx). Tests are done on SpcGroup and SpaceGroup on all 230 space groups. The SytSym & GenAtom routines are tested on representative space group settings against values taken from then International Tables Volume A.

The unit tests can be run by simply invoking the file directly (python Alternately the python package nosetests which will run file will test all defined unit tests in GSAS-II. Note that unit tests require as input files and in directory testinp/.

Binary distributions

Binary distributions are provided that include a compiled and linked version of as a loadable library (.pyd on windows and .so on Linux and Mac/OS X). The binary distributions for a limited number of platforms are found here in directories named binXXXN.mproc/ where XXX can be win, mac or linux and N.m indicates the python version (2.5 or 2.6) and the optional suffix proc indicates a processor type, if not i86 (Intel 32-bit). The binary distributions can be placed in the directory with this name in the same location as the file or in a directory named bin/. The GSASIIspc.pyd or file can also be in any location in the python search path, but bin/ will be checked first and then binXXXN.mproc/.

Compiling and linking pyspg.for

Compiled shared libraries for this are already provided for all supported platforms, but for those who want to compile code or port to other platforms, the Fortran source code used in GSAS-II is built with the Python scons utility based on the input in file SConstruct is provided to compile and link the Fortran routines used in GSAS-II and these options work for us on Windows, Mac and Linux. You could find that some options do not default properly for you, if so typing:

scons help

will display information on the command-line options that can be accessed for customization.