Package diffpy :: Package Structure :: Package Parsers :: Module P_cif
[hide private]
[frames] | no frames]

Module P_cif

source code

Parser for basic CIF file format

http://www.iucr.org/iucr-top/cif/home.html



Classes [hide private]
  P_cif
Simple parser for CIF structure format.
Functions [hide private]
 
leading_float(s)
Obtain first float from a string and ignore any trailing characters.
source code
 
getSymOp(s)
Create SpaceGroups.SymOp instance from a string.
source code
 
fixIfWindowsPath(filename)
Convert Windows-style path to valid local URL.
source code
 
getParser() source code
Variables [hide private]
  __id__ = '$Id: P_cif.py 3017 2009-04-07 17:09:33Z juhas $'
  rx_float = re.compile(r'\s*[-\+]?(\d+(\.\d*)?|\.\d+)([eE][-\+]...
  symvec = {'+x': array([ 1., 0., 0.]), '+y': array([ 0., 1.,...
Function Details [hide private]

leading_float(s)

source code 
Obtain first float from a string and ignore any trailing characters.
Useful for extracting values from "value(std)" syntax.

Return float.

getSymOp(s)

source code 
Create SpaceGroups.SymOp instance from a string.

s   -- formula for equivalent coordinates, for example 'x,1/2-y,1/2+z'

Return instance of SymOp.

fixIfWindowsPath(filename)

source code 
Convert Windows-style path to valid local URL.
CifFile loads files using urlopen, which fails for Windows-style paths.

filename -- path to be fixed

Return fixed URL when run on Windows, otherwise return filename.


Variables Details [hide private]

rx_float

Value:
re.compile(r'\s*[-\+]?(\d+(\.\d*)?|\.\d+)([eE][-\+]?\d+)?')

symvec

Value:
{'+x': array([ 1.,  0.,  0.]),
 '+y': array([ 0.,  1.,  0.]),
 '+z': array([ 0.,  0.,  1.]),
 '-x': array([-1.,  0.,  0.]),
 '-y': array([ 0., -1.,  0.]),
 '-z': array([ 0.,  0., -1.]),
 'x': array([ 1.,  0.,  0.]),
 'y': array([ 0.,  1.,  0.]),
...