Changeset 963 for trunk/GSASIIspc.py


Ignore:
Timestamp:
Jun 20, 2013 5:07:33 PM (10 years ago)
Author:
toby
Message:

more CIF work, more docs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIspc.py

    r956 r963  
    202202def AllOps(SGData):
    203203    '''
    204     Returns a list of all operators for a space group, including those for centering and a center of symmetry
     204    Returns a list of all operators for a space group, including those for
     205    centering and a center of symmetry
    205206   
    206207    :param SGData: from :func:`SpcGroup`
    207     :returns: list of strings of formatted symmetry operators
    208     '''
    209     SGText = []
     208    :returns: (SGTextList,offsetList,symOpList,G2oprList) where
     209
     210      * SGTextList: a list of strings with formatted and normalized
     211        symmetry operators.
     212      * offsetList: a tuple of (dx,dy,dz) offsets that relate the GSAS-II
     213        symmetry operation to the operator in SGTextList and symOpList.
     214        these dx (etc.) values are added to the GSAS-II generated
     215        positions to provide the positions that are generated
     216        by the normalized symmetry operators.       
     217      * symOpList: a list of tuples with the normalized symmetry
     218        operations as (M,T) values
     219        (see ``SGOps`` in the :ref:`Space Group object<SGData_table>`)
     220      * G2oprList: The GSAS-II operations for each symmetry operation as
     221        a tuple with (center,mult,opnum), where center is (0,0,0), (0.5,0,0),
     222        (0.5,0.5,0.5),...; where mult is 1 or -1 for the center of symmetry
     223        and opnum is the number for the symmetry operation, in ``SGOps``
     224        (starting with 0).
     225    '''
     226    SGTextList = []
     227    offsetList = []
     228    symOpList = []
     229    G2oprList = []
    210230    onebar = (1,)
    211231    if SGData['SGInv']:
     
    213233    for cen in SGData['SGCen']:
    214234        for mult in onebar:
    215             for M,T in SGData['SGOps']:
    216                 OPtxt = MT2text(mult*M,(mult*T)+cen)
    217                 SGText.append(OPtxt.replace(' ',''))
    218     return SGText
    219 
     235            for j,(M,T) in enumerate(SGData['SGOps']):
     236                offset = [0,0,0]
     237                Tprime = (mult*T)+cen
     238                for i in range(3):
     239                    while Tprime[i] < 0:
     240                        Tprime[i] += 1
     241                        offset[i] += 1
     242                    while Tprime[i] >= 1:
     243                        Tprime[i] += -1
     244                        offset[i] += -1
     245                OPtxt = MT2text(mult*M,Tprime)
     246                SGTextList.append(OPtxt.replace(' ',''))
     247                offsetList.append(tuple(offset))
     248                symOpList.append((mult*M,Tprime))
     249                G2oprList.append((cen,mult,j))
     250    return SGTextList,offsetList,symOpList,G2oprList
    220251   
    221252def MT2text(M,T):
Note: See TracChangeset for help on using the changeset viewer.