Changeset 1548 for trunk/GSASIIspc.py


Ignore:
Timestamp:
Oct 30, 2014 4:07:50 PM (8 years ago)
Author:
vondreele
Message:

more super structure stuff - now some in unit cell indexing
now using pulldown ComboBoxes? for supersymmetry choices
continue building tables of supersymmetry codes
use deepcopy for peaks in various places; copy wasn't enough
get seq. peak fit to stop when a refinement goes bad; then allow display of results

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIspc.py

    r1547 r1548  
    175175    returns SSGPtGrp & SSGKl (only defaults for Mono & Ortho)
    176176    '''
    177     Flds = SGData['SpGrp'].split(' ')
     177    Flds = SGData['SpGrp'].split()
     178    if len(Flds) < 2:
     179        return '',[]
    178180    if SGData['SGLaue'] == '-1':    #triclinic
    179181        if '-' in Flds[1]:
     
    430432    """
    431433   
    432     def splitSSsym(SSymbol):
    433         '''
    434         Splits supersymmetry symbol into two lists of strings
    435         '''
    436         modsym,gensym = SSymbol.replace(' ','').split(')')
    437         nfrac = modsym.count('/')
    438         modsym = modsym.lstrip('(')
    439         if nfrac == 0:
    440             modsym = list(modsym)
    441         elif nfrac == 1:
    442             pos = modsym.find('/')
    443             if pos == 1:
    444                 modsym = [modsym[:3],modsym[3],modsym[4]]
    445             elif pos == 2:
    446                 modsym = [modsym[0],modsym[1:4],modsym[4]]
    447             else:
    448                 modsym = [modsym[0],modsym[1],modsym[2:]]
    449         else:
    450             lpos = modsym.find('/')
    451             rpos = modsym.rfind('/')
    452             if lpos == 1 and rpos == 4:
    453                 modsym = [modsym[:3],modsym[3:6],modsym[6]]
    454             elif lpos == 1 and rpos == 5:
    455                 modsym = [modsym[:3],modsym[3],modsym[4:]]
    456             else:
    457                 modsym = [modsym[0],modsym[1:4],modsym[4:]]
    458         gensym = list(gensym)
    459         return modsym,gensym
    460        
    461434    def checkModSym():
    462435        '''
     
    589562        if SGData['SGInv']:
    590563            SSGOps += [[-1*M,V] for M,V in SSGOps[:]]
    591 # monoclinic - all done
     564# monoclinic - all done & all checked
    592565        if SGData['SGPtGrp'] in ['2','m']:  #OK
    593566            SSGOps[1][0][3,3] = SSGKl[0]
     
    602575                for k in iFrac:
    603576                    SSGOps[j][0][3,k] = SSGKl[i]
    604                 E,SSGOps = extendSSGOps(SSGOps)
    605577           
    606578# orthorhombic
     
    626598        elif SGData['SGPtGrp'] in ['4/m',]:
    627599            if '1/2' in SSGData['modSymb']:
    628                 SSGOps[1][0][3,1] = -1
     600                SSGOps[1][0][3,1] = SSGKl[0]
    629601            for i,j in enumerate([1,6]):
    630602                SSGOps[j][0][3,3] = SSGKl[i]
     
    634606        elif SGData['SGPtGrp'] in ['422','4mm','-42m','-4m2',]:
    635607            if '1/2' in SSGData['modSymb']:
    636                 SSGOps[1][0][3,1] = -1
     608                SSGOps[1][0][3,1] = SSGKl[0]
    637609            for i,j in enumerate([1,4,5]):
    638610                SSGOps[j][0][3,3] = SSGKl[i]
     
    856828        return Result+'\nOperator conflict - incorrect superspace symbol',None
    857829
     830def splitSSsym(SSymbol):
     831    '''
     832    Splits supersymmetry symbol into two lists of strings
     833    '''
     834    modsym,gensym = SSymbol.replace(' ','').split(')')
     835    nfrac = modsym.count('/')
     836    modsym = modsym.lstrip('(')
     837    if nfrac == 0:
     838        modsym = list(modsym)
     839    elif nfrac == 1:
     840        pos = modsym.find('/')
     841        if pos == 1:
     842            modsym = [modsym[:3],modsym[3],modsym[4]]
     843        elif pos == 2:
     844            modsym = [modsym[0],modsym[1:4],modsym[4]]
     845        else:
     846            modsym = [modsym[0],modsym[1],modsym[2:]]
     847    else:
     848        lpos = modsym.find('/')
     849        rpos = modsym.rfind('/')
     850        if lpos == 1 and rpos == 4:
     851            modsym = [modsym[:3],modsym[3:6],modsym[6]]
     852        elif lpos == 1 and rpos == 5:
     853            modsym = [modsym[:3],modsym[3],modsym[4:]]
     854        else:
     855            modsym = [modsym[0],modsym[1:4],modsym[4:]]
     856    gensym = list(gensym)
     857    return modsym,gensym
     858       
    858859def SSGPrint(SGData,SSGData):
    859860    '''
     
    897898    return SSGText,SSGTable
    898899   
    899 def SSGModCheck(Vec,SSGData):
     900def SSGModCheck(Vec,modSymb):
    900901    ''' Checks modulation vector compatibility with supersymmetry space group symbol.
    901902    Superspace group symbol takes precidence & the vector will be modified accordingly
    902903    '''
    903     modQ = SSGData['modQ']
    904     modSymb = SSGData['modSymb']
     904    Fracs = {'1/2':0.5,'1/3':1./3,'1':1.0,'0':0.,'a':0.,'b':0.,'g':0.}
     905    modQ = [Fracs[mod] for mod in modSymb]
    905906    Vec = [0.1 if (vec == 0.0 and mod in ['a','b','g']) else vec for [vec,mod] in zip(Vec,modSymb)]
    906     return [Q if mod not in ['a','b','g'] and vec != Q else vec for [vec,mod,Q] in zip(Vec,modSymb,modQ)]
     907    return [Q if mod not in ['a','b','g'] and vec != Q else vec for [vec,mod,Q] in zip(Vec,modSymb,modQ)],  \
     908        [True if mod in ['a','b','g'] else False for mod in modSymb]
    907909
    908910def SSMT2text(Opr):
     
    16561658        rspc = rspc[:-1]
    16571659        rhomb = ' R'
    1658     if rspc[-1:] == 'H': # hexagonal is assumed and thus can be ignored
     1660    elif rspc[-1:] == 'H': # hexagonal is assumed and thus can be ignored
    16591661        rspc = rspc[:-1]
    16601662    # look for a match in the spacegroup lists
     
    17641766    'P 1':['(abg)',],'P -1':['(abg)',],
    17651767    #monoclinic - done
    1766     'P 2':['(a0g)','(a1/2g)','(0b0)','(0b0)s','(1/2b0)','(0b1/2)',],
     1768    'P 2':['(a0g)','(a1/2g)','(0b0)','(0b0)s','(1/2b0)','(0b1/2)','(1/2b0)s','(0b1/2)s',],
    17671769    'P 21':['(a0g)','(0b0)','(0b0)s','(1/2b0)','(0b1/2)','(1/2b0)s','(0b1/2)s',],
    17681770    'P m':['(a0g)','(a0g)s','(a1/2g)','(a1/2g)s','(0b0)','(1/2b0)','(0b1/2)',],
     
    17721774    'P 2/m':['(a0g)','(a1/2g)','(a0g)0s','(a1/2g)0s',
    17731775        '(0b0)','(0b0)s0','(1/2b0)','(0b1/2)','(1/2b0)s0','(0b1/2)s0',],
    1774     'P 21/m':['(a0g)','(a0g)0s','(0b0)','(0b0)s',
     1776    'P 21/m':['(a0g)','(a0g)0s','(0b0)','(0b0)s0',
    17751777        '(1/2b0)','(0b1/2)','(1/2b0)s0','(0b1/2)s0'],
    17761778    'P 2/c':['(a0g)','(a1/2g)','(a0g)0s','(a1/2g)0s',
     
    17871789    'C c':['(a0g)','(a0g)s','(0b0)',],
    17881790    'C n':['(a0g)','(a0g)s','(0b0)',],
    1789     'C 2/m':['(a0g)','(a0g)0s','(0b0)','(0b0)s0',
    1790         '(1/2b0)','(0b1/2)','(1/2b0)s0','(0b1/2)s0',],
     1791    'C 2/m':['(a0g)','(a0g)0s','(0b0)','(0b0)s0','(0b1/2)','(0b1/2)s0',],
    17911792    'C 2/c':['(a0g)','(a0g)0s','(0b0)','(0b0)s0',],
    17921793    'C 2/n':['(a0g)','(a0g)0s','(0b0)','(0b0)s0',],
     
    19141915    'P c m a':[],
    19151916       
    1916     'P c c n':[],
    1917     'P n a a':[],
    1918     'P b n b':[],
     1917    'P c c n':['(00g)','(00g)s00','(00g)0s0','(00g)ss0','(a00)','(a00)0s0',
     1918        '(a00)00s','(a00)0ss','(0b0)','(0b0)s00','(0b0)00s','(0b0)s0s'],
     1919    'P n a a':['(00g)','(00g)s00','(00g)0s0','(00g)ss0','(a00)','(a00)0s0',
     1920        '(a00)00s','(a00)0ss','(0b0)','(0b0)s00','(0b0)00s','(0b0)s0s'],
     1921    'P b n b':['(00g)','(00g)s00','(00g)0s0','(00g)ss0','(a00)','(a00)0s0',
     1922        '(a00)00s','(a00)0ss','(0b0)','(0b0)s00','(0b0)00s','(0b0)s0s'],
    19191923       
    19201924    'P b c m':[],
     
    19251929    'P c m b':[],
    19261930       
    1927     'P n n m':[],
    1928     'P m n n':[],
    1929     'P n m n':[],
     1931    'P n n m':['(00g)','(00g)s00','(00g)0s0','(00g)ss0','(a00)','(a00)0s0',
     1932        '(a00)00s','(a00)0ss','(0b0)','(0b0)s00','(0b0)00s','(0b0)s0s'],
     1933    'P m n n':['(00g)','(00g)s00','(00g)0s0','(00g)ss0','(a00)','(a00)0s0',
     1934        '(a00)00s','(a00)0ss','(0b0)','(0b0)s00','(0b0)00s','(0b0)s0s'],
     1935    'P n m n':['(00g)','(00g)s00','(00g)0s0','(00g)ss0','(a00)','(a00)0s0',
     1936        '(a00)00s','(a00)0ss','(0b0)','(0b0)s00','(0b0)00s','(0b0)s0s'],
    19301937       
    19311938    'P m m n':[],
     
    19331940    'P m n m':[],
    19341941       
    1935     'P b c n':[],
    1936     'P c a n':[],
    1937     'P n c a':[],
    1938     'P n a b':[],
    1939     'P b n a':[],
    1940     'P c n b':[],
     1942    'P b c n':['(00g)','(00g)s00','(00g)0s0','(00g)ss0','(a00)','(a00)0s0',
     1943        '(a00)00s','(a00)0ss','(0b0)','(0b0)s00','(0b0)00s','(0b0)s0s'],
     1944    'P c a n':['(00g)','(00g)s00','(00g)0s0','(00g)ss0','(a00)','(a00)0s0',
     1945        '(a00)00s','(a00)0ss','(0b0)','(0b0)s00','(0b0)00s','(0b0)s0s'],
     1946    'P n c a':['(00g)','(00g)s00','(00g)0s0','(00g)ss0','(a00)','(a00)0s0',
     1947        '(a00)00s','(a00)0ss','(0b0)','(0b0)s00','(0b0)00s','(0b0)s0s'],
     1948    'P n a b':['(00g)','(00g)s00','(00g)0s0','(00g)ss0','(a00)','(a00)0s0',
     1949        '(a00)00s','(a00)0ss','(0b0)','(0b0)s00','(0b0)00s','(0b0)s0s'],
     1950    'P b n a':['(00g)','(00g)s00','(00g)0s0','(00g)ss0','(a00)','(a00)0s0',
     1951        '(a00)00s','(a00)0ss','(0b0)','(0b0)s00','(0b0)00s','(0b0)s0s'],
     1952    'P c n b':['(00g)','(00g)s00','(00g)0s0','(00g)ss0','(a00)','(a00)0s0',
     1953        '(a00)00s','(a00)0ss','(0b0)','(0b0)s00','(0b0)00s','(0b0)s0s'],
    19411954       
    19421955    'P b c a':[],
    19431956    'P c a b':[],
    19441957       
    1945     'P n m a':[],
    1946     'P m n b':[],
    1947     'P b n m':[],
    1948     'P c m n':[],
    1949     'P m c n':[],
    1950     'P n a m':[],
     1958    'P n m a':['(00g)','(00g)s00','(00g)0s0','(00g)ss0','(a00)','(a00)0s0',
     1959        '(a00)00s','(a00)0ss','(0b0)','(0b0)s00','(0b0)00s','(0b0)s0s'],
     1960    'P m n b':['(00g)','(00g)s00','(00g)0s0','(00g)ss0','(a00)','(a00)0s0',
     1961        '(a00)00s','(a00)0ss','(0b0)','(0b0)s00','(0b0)00s','(0b0)s0s'],
     1962    'P b n m':['(00g)','(00g)s00','(00g)0s0','(00g)ss0','(a00)','(a00)0s0',
     1963        '(a00)00s','(a00)0ss','(0b0)','(0b0)s00','(0b0)00s','(0b0)s0s'],
     1964    'P c m n':['(00g)','(00g)s00','(00g)0s0','(00g)ss0','(a00)','(a00)0s0',
     1965        '(a00)00s','(a00)0ss','(0b0)','(0b0)s00','(0b0)00s','(0b0)s0s'],
     1966    'P m c n':['(00g)','(00g)s00','(00g)0s0','(00g)ss0','(a00)','(a00)0s0',
     1967        '(a00)00s','(a00)0ss','(0b0)','(0b0)s00','(0b0)00s','(0b0)s0s'],
     1968    'P n a m':['(00g)','(00g)s00','(00g)0s0','(00g)ss0','(a00)','(a00)0s0',
     1969        '(a00)00s','(a00)0ss','(0b0)','(0b0)s00','(0b0)00s','(0b0)s0s'],
    19511970       
    19521971    'C 2 2 21':['(a00)','(0b0)','(00g)','(10g)','(01g)',],
     
    19922011    'I m 2 a':[],
    19932012       
    1994     'I b a m':[],
    1995     'I m c b':[],
    1996     'I c m a':[],
    1997        
    1998     'I b c a':[],
    1999     'I c a b':[],
    2000        
    2001     'I m m a':[],
    2002     'I m m b':[],
    2003     'I b m m ':[],
    2004     'I c m m':[],
    2005     'I m c m':[],
    2006     'I m a m':[],
    2007        
    2008     'F 2 2 2':[],
    2009     'F m m m':[],
    2010     'F d d d':[],
    2011        
    2012     'F m m 2':[],
    2013     'F m 2 m':[],
    2014     'F 2 m m':[],
    2015        
    2016     'F d d 2':[],
    2017     'F d 2 d':[],
    2018     'F 2 d d':[],       
     2013    'I b a m':['(00g)','(00g)s00','(00g)0s0','(00g)ss0','(a00)','(a00)0s0',
     2014        '(a00)00s','(a00)0ss','(0b0)','(0b0)s00','(0b0)00s','(0b0)s0s'],
     2015    'I m c b':['(00g)','(00g)s00','(00g)0s0','(00g)ss0','(a00)','(a00)0s0',
     2016        '(a00)00s','(a00)0ss','(0b0)','(0b0)s00','(0b0)00s','(0b0)s0s'],
     2017    'I c m a':['(00g)','(00g)s00','(00g)0s0','(00g)ss0','(a00)','(a00)0s0',
     2018        '(a00)00s','(a00)0ss','(0b0)','(0b0)s00','(0b0)00s','(0b0)s0s'],
     2019       
     2020    'I b c a':['(00g)','(00g)s00','(00g)0s0','(00g)ss0','(a00)','(a00)0s0',
     2021        '(a00)00s','(a00)0ss','(0b0)','(0b0)s00','(0b0)00s','(0b0)s0s'],
     2022    'I c a b':['(00g)','(00g)s00','(00g)0s0','(00g)ss0','(a00)','(a00)0s0',
     2023        '(a00)00s','(a00)0ss','(0b0)','(0b0)s00','(0b0)00s','(0b0)s0s'],
     2024       
     2025    'I m m a':['(00g)','(00g)s00','(00g)0s0','(00g)ss0','(a00)','(a00)0s0',
     2026        '(a00)00s','(a00)0ss','(0b0)','(0b0)s00','(0b0)00s','(0b0)s0s'],
     2027    'I m m b':['(00g)','(00g)s00','(00g)0s0','(00g)ss0','(a00)','(a00)0s0',
     2028        '(a00)00s','(a00)0ss','(0b0)','(0b0)s00','(0b0)00s','(0b0)s0s'],
     2029    'I b m m ':['(00g)','(00g)s00','(00g)0s0','(00g)ss0','(a00)','(a00)0s0',
     2030        '(a00)00s','(a00)0ss','(0b0)','(0b0)s00','(0b0)00s','(0b0)s0s'],
     2031    'I c m m':['(00g)','(00g)s00','(00g)0s0','(00g)ss0','(a00)','(a00)0s0',
     2032        '(a00)00s','(a00)0ss','(0b0)','(0b0)s00','(0b0)00s','(0b0)s0s'],
     2033    'I m c m':['(00g)','(00g)s00','(00g)0s0','(00g)ss0','(a00)','(a00)0s0',
     2034        '(a00)00s','(a00)0ss','(0b0)','(0b0)s00','(0b0)00s','(0b0)s0s'],
     2035    'I m a m':['(00g)','(00g)s00','(00g)0s0','(00g)ss0','(a00)','(a00)0s0',
     2036        '(a00)00s','(a00)0ss','(0b0)','(0b0)s00','(0b0)00s','(0b0)s0s'],
     2037       
     2038    'F 2 2 2':['(00g)','(00g)s00','(00g)0s0','(00g)ss0','(a00)','(a00)0s0',
     2039        '(a00)00s','(a00)0ss','(0b0)','(0b0)s00','(0b0)00s','(0b0)s0s',
     2040        '(10g)','(10g)s00','(10g)0s0','(10g)ss0','(a10)','(a10)0s0',
     2041        '(a10)00s','(a10)0ss','(0b1)','(0b1)s00','(0b1)00s','(0b1)s0s',
     2042        '(01g)','(01g)s00','(01g)0s0','(01g)ss0','(a01)','(a01)0s0',
     2043        '(a01)00s','(a01)0ss','(1b0)','(1b0)s00','(1b0)00s','(1b0)s0s'],
     2044       
     2045    'F m m m':['(00g)','(00g)s00','(00g)0s0','(00g)ss0','(a00)','(a00)0s0',
     2046        '(a00)00s','(a00)0ss','(0b0)','(0b0)s00','(0b0)00s','(0b0)s0s',
     2047        '(10g)','(10g)s00','(10g)0s0','(10g)ss0','(a10)','(a10)0s0',
     2048        '(a10)00s','(a10)0ss','(0b1)','(0b1)s00','(0b1)00s','(0b1)s0s',
     2049        '(01g)','(01g)s00','(01g)0s0','(01g)ss0','(a01)','(a01)0s0',
     2050        '(a01)00s','(a01)0ss','(1b0)','(1b0)s00','(1b0)00s','(1b0)s0s'],
     2051       
     2052    'F d d d':['(00g)','(00g)s00','(00g)0s0','(00g)ss0','(a00)','(a00)0s0',
     2053        '(a00)00s','(a00)0ss','(0b0)','(0b0)s00','(0b0)00s','(0b0)s0s'],
     2054       
     2055    'F m m 2':['(00g)','(00g)ss0','(00g)0ss','(00g)s0s','(a00)','(a00)0s0',
     2056        '(0b0)','(0b0)s00','(10g)','(10g)ss0','(10g)0ss','(10g)s0s','(a01)','(a01)0s0',
     2057        '(1b0)','(1b0)s00','(01g)','(01g)ss0','(01g)0ss','(01g)s0s','(a10)','(a10)0s0',
     2058        '(0b1)','(0b1)s00',],
     2059       
     2060    'F m 2 m':['(0b0)','(0b0)ss0','(0b0)0ss','(0b0)s0s','(a00)','(a00)00s',
     2061        '(00g)','(00g)s00','(1b0)','(1b0)ss0','(1b0)0ss','(1b0)s0s','(a01)','(a01)00s',
     2062        '(01g)','(01g)s00','(0b1)','(0b1)ss0','(0b1)0ss','(0b1)s0s','(a10)','(a10)00s',
     2063        '(10g)','(10g)s00',],
     2064       
     2065    'F 2 m m':['(a00)','(a00)ss0','(a00)0ss','(a00)s0s','(0b0)','(0b0)00s',
     2066        '(00g)','(00g)0s0','(a10)','(a10)ss0','(a10)0ss','(a10)s0s','(0b1)','(0b1)00s',
     2067        '(10g)','(10g)0s0','(a01)','(a01)ss0','(a01)0ss','(a01)s0s','(1b0)','(1b0)00s',
     2068        '(01g)','(01g)0s0',],
     2069       
     2070    'F d d 2':['(00g)','(00g)ss0','(00g)0ss','(00g)s0s','(a00)','(a00)0s0',
     2071        '(0b0)','(0b0)s00',],
     2072    'F d 2 d':['(0b0)','(0b0)ss0','(0b0)0ss','(0b0)s0s','(a00)','(a00)00s',
     2073        '(00g)','(00g)s00',],
     2074    'F 2 d d':['(a00)','(a00)ss0','(a00)0ss','(a00)s0s','(0b0)','(0b0)00s',
     2075        '(00g)','(00g)0s0',],       
    20192076    #tetragonal - done
    20202077    'P 4':['(00g)','(00g)q','(00g)s','(1/21/2g)','(1/21/2g)q',],
Note: See TracChangeset for help on using the changeset viewer.