Changeset 1611


Ignore:
Timestamp:
Dec 17, 2014 1:51:16 PM (9 years ago)
Author:
vondreele
Message:

revision to GSASII.BAT - new citation for small angle
allow super space groups not in list to be entered
work on SS symmetry constraints
complete mmm symmetry SS operations
correct some monoclinic SS choices

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASII.BAT

    r1603 r1611  
    77@echo                            Please cite:
    88@echo      B.H. Toby and R.B. Von Dreele, J. Appl. Cryst. 46, 544-549 (2013)
     9@echo                   for small angle use also cite:
     10@echo      R.B. Von Dreele, J. Appl. Cryst. 47, 1784-9 (2014)
    911@echo ========================================================================
    1012@
     
    1416@set gsasloc=%gsasloc:\\*=\*%
    1517@set gsasloc=%gsasloc:\*=\%
    16 D:\Python27\python "%gsasloc%\GSASII.py" %1
     18@rem one can use a specific reference to a python via, e.g.:
     19@set pythonloc=%D:\Python27\python%
     20%pythonloc% "%gsasloc%\GSASII.py" %1
    1721@REM To keep the window from disappearing with any error messages
    1822pause
  • trunk/GSASIIphsGUI.py

    r1610 r1611  
    620620            SSChoice = G2spc.ssdict.get(generalData['SGData']['SpGrp'],[])
    621621            if SSChoice:
    622                 superGp = wx.ComboBox(General,value=generalData['SuperSg'],choices=SSChoice,style=wx.CB_READONLY|wx.CB_DROPDOWN)
     622                superGp = wx.ComboBox(General,value=generalData['SuperSg'],choices=SSChoice,style=wx.CB_DROPDOWN)   #wx.CB_READONLY|
    623623                superGp.Bind(wx.EVT_COMBOBOX,OnSuperGp)
     624                superGp.Bind(wx.EVT_TEXT_ENTER,OnSuperGp)
    624625            else:   #nonstandard space group symbol not in my dictionary
    625626                superGp = wx.TextCtrl(General,value=generalData['SuperSg'],style=wx.TE_PROCESS_ENTER)
     
    20082009            return atomSizer
    20092010           
    2010         def WaveSizer(waveBlk,Stype,typeName,Names):
     2011        def WaveSizer(waveBlk,Stype,typeName,Names,waveCSI):
    20112012           
    20122013            def OnAddWave(event):
     
    20532054                for iwave,wave in enumerate(waveBlk):
    20542055                    for ival,val in enumerate(wave[0]):
    2055                         waveVal = wx.TextCtrl(waveData,value='%.4f'%(val),style=wx.TE_PROCESS_ENTER)
    2056                         waveVal.Bind(wx.EVT_TEXT_ENTER,OnWaveVal)
    2057                         waveVal.Bind(wx.EVT_KILL_FOCUS,OnWaveVal)
    2058                         Indx[waveVal.GetId()] = [iatm,Stype,iwave,ival]
     2056                        if waveCSI[0][ival] < 0:
     2057                            waveVal = wx.TextCtrl(waveData,value='%.4f'%(val),style=wx.TE_READONLY)
     2058                            waveVal.SetBackgroundColour(VERY_LIGHT_GREY)
     2059                        else:
     2060                            waveVal = wx.TextCtrl(waveData,value='%.4f'%(val),style=wx.TE_PROCESS_ENTER)
     2061                            waveVal.Bind(wx.EVT_TEXT_ENTER,OnWaveVal)
     2062                            waveVal.Bind(wx.EVT_KILL_FOCUS,OnWaveVal)
     2063                            Indx[waveVal.GetId()] = [iatm,Stype,iwave,ival]
    20592064                        Waves.Add(waveVal,0,WACV)
    20602065                        if len(wave[0]) > 6 and ival == 5:
     
    21012106        G2frame.dataFrame.SetStatusText('')
    21022107        generalData = data['General']
     2108        SGData = generalData['SGData']
     2109        SSGData = generalData['SSGData']
    21032110        cx,ct,cs,cia = generalData['AtomPtrs']
    21042111        atomData = data['Atoms']
     
    21192126            mainSizer.Add(MapSizer(),0,WACV)           
    21202127            for iatm,atom in enumerate(atomData):
     2128                xyz = atom[cx:cx+3]
     2129                uij = atom[cia+2:cia+8]
     2130                CSI = G2spc.GetSSfxuinel(xyz,uij,SGData,SSGData)
    21212131                for SS in ['SS1',]:  #future SS2 & SS3 - I doubt it!
    21222132                    G2gd.HorizontalLine(mainSizer,waveData)
     
    21252135                        if generalData['Type'] == 'modulated' and Stype == 'Smag':
    21262136                            break
    2127                         mainSizer.Add(WaveSizer(atom[-1][SS][Stype],Stype,typeNames[Stype],Labels[Stype]))
     2137                        mainSizer.Add(WaveSizer(atom[-1][SS][Stype],Stype,typeNames[Stype],Labels[Stype],CSI[Stype]))
    21282138                       
    21292139        SetPhaseWindow(G2frame.dataFrame,waveData,mainSizer)
     
    26372647                        XYZ = XYZ+cent+Cell
    26382648                        if Force:
    2639                             XYZ = G2spc.MoveToUnitCell(XYZ)
     2649                            XYZ %= 1.       #G2spc.MoveToUnitCell(XYZ)
    26402650                        if noDuplicate(XYZ,atomData):
    26412651                            atom = copy.copy(atomData[ind])
     
    26472657                            if atom[cuia] == 'A':
    26482658                                Uij = atom[cuij:cuij+6]
    2649                                 U = G2spc.Uij2U(Uij)
    2650                                 U = np.inner(np.inner(M,U),M)
    2651                                 Uij = G2spc.U2Uij(U)
     2659                                Uij = G2spc.U2Uij(np.inner(np.inner(M,G2spc.Uij2U(Uij)),M))
    26522660                                atom[cuij:cuij+6] = Uij
    26532661                            atomData.append(atom)
  • trunk/GSASIIspc.py

    r1606 r1611  
    2222import sys
    2323import os.path as ospath
     24import config
    2425
    2526import GSASIIpath
     
    603604                E,SSGOps = extendSSGOps(SSGOps)
    604605                if not E:
    605                     return E,SSGOps
    606                
     606                    return E,SSGOps               
    607607# tetragonal - all done & checked
    608608        elif SGData['SGPtGrp'] == '4':  #OK
     
    727727        return E,SSGOps
    728728       
    729     def specialGen(gensym):
     729    def specialGen(gensym,modsym):
    730730        sym = ''.join(gensym)
    731731        if SGData['SGPtGrp'] in ['2/m',] and 'n' in SGData['SpGrp']:
     
    741741            elif sym == 's00':
    742742                gensym = 's0s'
     743        elif SGData['SGPtGrp'] in ['mmm',]:
     744            if 'g' in modsym:
     745                if sym == 's00':
     746                    gensym = 's0s'
     747                elif sym == '0s0':
     748                    gensym = '0ss'
     749            elif 'a' in modsym:
     750                if sym == '0s0':
     751                    gensym = 'ss0'
     752                elif sym == '00s':
     753                    gensym = 's0s'
     754            elif 'b' in modsym:
     755                if sym == '00s':
     756                    gensym = '0ss'
     757                elif sym == 's00':
     758                    gensym = 'ss0'
    743759        return gensym
    744760                   
     
    842858    if not checkGen(gensym):
    843859        return 'Generator '+''.join(gensym)+' not consistent with space group '+SGData['SpGrp'],None
    844     gensym = specialGen(gensym)
     860    gensym = specialGen(gensym,modsym)
    845861    genQ = [Fracs[mod] for mod in gensym]
    846862    if not genQ:
     
    862878    if E:
    863879        SSGData['SSGOps'] = Result
    864 #        print SSGData['SSpGrp']
    865 #        for Op in Result:
    866 #            print SSMT2text(Op).replace(' ','')                                 
     880        if config.debug:
     881            print 'Super spacegroup operators for '+SSGData['SSpGrp']
     882            for Op in Result:
     883                print SSMT2text(Op).replace(' ','')
     884            if SGData['SGInv']:                                 
     885                for Op in Result:
     886                    Op = [-Op[0],-Op[1]%1.]
     887                    print SSMT2text(Op).replace(' ','')                                 
    867888        return None,SSGData
    868889    else:
     
    14001421    indx = GetNXUPQsym(siteSym)
    14011422    return CSuinel[indx[1]]
     1423   
     1424def GetSSfxuinel(XYZ,UIJ,SGData,SSGData):
     1425    CSI = {'Sfrac':[[0,1],[1.,1.]],'Spos':[[0,1,2, 0,1,2],[1.,1.,1., 1.,1.,1.]],    #sin & cos
     1426        'Sadp':[[0,1,2,3,4,5, 0,1,2,3,4,5],[1.,1.,1.,1.,1.,1., 1.,1.,1.,1.,1.,1.]],
     1427        'Smag':[[0,1,2, 0,1,2],[1.,1.,1., 1.,1.,1.]]}
     1428    deltx = np.eye((3))*.001
     1429    deltu = np.eye((6))*.0001
     1430    xyz = np.array(XYZ)%1.
     1431    uij = np.array(UIJ)
     1432    SGOps = SGData['SGOps']
     1433    SSGOps = SSGData['SSGOps']
     1434    ssop = SSGOps[0]
     1435    sop = SGOps[0]
     1436    for iop,Op in enumerate(SGOps):
     1437        nxyz = (np.inner(Op[0],xyz)+Op[1])%1.
     1438        if SGData['SGInv'] and np.allclose(xyz,-nxyz%1.,1.e-6):
     1439            ssop = SSGOps[iop]
     1440            ssop = [-ssop[0],-ssop[1]%1.]
     1441            sop = [-Op[0],-Op[1]%1.]
     1442            break
     1443        elif np.allclose(xyz,nxyz,1.e-6) and iop:
     1444            ssop = SSGOps[iop]
     1445            sop = SGOps[iop]
     1446            break
     1447    siteSym = SytSym(XYZ,SGData)[0].strip().split('(')[0]
     1448    OpText =  MT2text(sop).replace(' ','')
     1449    SSOptext = SSMT2text(ssop).replace(' ','')
     1450    if siteSym == '1':   #"1" site symmetry
     1451        return CSI
     1452    elif siteSym == '-1':   #"-1" site symmetry
     1453        CSI['Spos'][0] = [0,1,2, -1,-1,-1]
     1454        CSI['Sadp'][0] = [-1,-1,-1,-1,-1,-1, 0,1,2,3,4,5,]
     1455        return CSI       
     1456    print siteSym[0],OpText,SSOptext   
     1457    UniqAx = {'a':'a','b':'b','c':'g'}
     1458    if SGData['SGLaue'] == '2/m':
     1459        if UniqAx[SGData['SGUniq']] in SSGData['modSymb']:   #e.g. (0b0)
     1460            if 's' in SSGData['SSpGrp'].split('(')[1]:
     1461                if siteSym == 'm':
     1462                    CSI['Spos'][0] = [0,-1,1, -1,1,-1]
     1463                    CSI['Sadp'][0] = [0,1,2,-1,3,-1, -1,-1,-1,4,-1,5]
     1464                elif siteSym == '2/m':
     1465                    CSI['Spos'][0] = [0,-1,1, -1,-1,-1]
     1466                    CSI['Sadp'][0] = [-1,-1,-1,-1,-1,-1, -1,-1,-1,0,-1,1]
     1467                elif siteSym == '2':
     1468                    CSI['Spos'][0] = [0,-1,1, 2,-1,3]               
     1469                    CSI['Sadp'][0] = [-1,-1,-1,0,-1,1, -1,-1,-1,2,-1,3]
     1470            elif '1/2' in SSGData['modSymb']:    #e.g. (0b1/2)
     1471                if siteSym == 'm':
     1472                    CSI['Spos'][0] = [-1,-1,-1, -1,-1,-1]
     1473                    CSI['Sadp'][0] = [-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1]
     1474                elif siteSym == '2/m':
     1475                    CSI['Spos'][0] = [0,-1,1, -1,-1,-1]
     1476                    CSI['Sadp'][0] = [-1,-1,-1,-1,-1,-1, 0,1,2,-1,3,-1]
     1477                elif siteSym == '2':
     1478                    CSI['Spos'][0] = [0,-1,1, 2,-1,3]
     1479                    CSI['Sadp'][0] = [-1,-1,-1,0,-1,1, -1,-1,-1,2,-1,3]
     1480            else:
     1481                if siteSym == 'm':
     1482                    CSI['Spos'][0] = [-1,0,-1, 1,-1,2]
     1483                    CSI['Sadp'][0] = [-1,-1,-1,0,-1,1, 2,3,4,-1,5,-1]
     1484                elif siteSym == '2/m':
     1485                    CSI['Spos'][0] = [-1,0,-1, -1,-1,-1]
     1486                    CSI['Sadp'][0] = [-1,-1,-1,-1,-1,-1, 0,1,2,-1,3,-1]
     1487                elif siteSym == '2':
     1488                    CSI['Spos'][0] = [-1,0,-1, -1,1,-1]
     1489                    CSI['Sadp'][0] = [0,1,2,-1,3,-1, 4,5,6,-1,7,-1]
     1490           
     1491        else:   #e.g. (a0g)
     1492            if 's' in SSGData['SSpGrp'].split('(')[1]:
     1493                if siteSym == 'm':
     1494                    CSI['Spos'][0] = [-1,0,-1, -1,1,-1]
     1495                    CSI['Sadp'][0] = [-1,-1,-1,0,-1,1, -1,-1,-1,2,-1,3]
     1496                elif siteSym == '2/m':
     1497                    CSI['Spos'][0] = [-1,0,-1, -1,-1,-1]
     1498                    CSI['Sadp'][0] = [-1,-1,-1,-1,-1,-1, -1,-1,-1,0,-1,1]
     1499                elif siteSym == '2':
     1500                    CSI['Spos'][0] = [-1,0,-1, 1,-1,2]
     1501                    CSI['Sadp'][0] = [0,1,2,-1,3,-1, -1,-1,-1,4,-1,5]
     1502            else:
     1503                if siteSym == 'm':
     1504                    CSI['Spos'][0] = [0,-1,1, 2,-1,3]
     1505                    CSI['Sadp'][0] = [0,1,2,-1,3,-1, 4,5,6,-1,7,-1]
     1506                elif siteSym == '2/m':
     1507                    CSI['Spos'][0] = [0,-1,1, -1,-1,-1]
     1508                    CSI['Sadp'][0] = [-1,-1,-1,-1,-1,-1, 0,1,2,-1,3,-1]
     1509                elif siteSym == '2':
     1510                    CSI['Spos'][0] = [0,-1,1, -1,2,-1]
     1511                    CSI['Sadp'][0] = [-1,-1,-1,0,-1,1, 2,3,4,-1,5,-1]
     1512        Sx = CSI['Spos'][0]
     1513        Su = CSI['Sadp'][0]
     1514        if SGData['SGUniq'] == 'a':
     1515            CSI['Spos'][0] = [Sx[1],Sx[2],Sx[0], Sx[4],Sx[5],Sx[3]]
     1516            CSI['Sadp'][0] = [Su[1],Sx[2],Sx[0],Su[4],Su[5],Su[3], Su[7],Su[8],Su[6],Su[10],Su[11],Su[9]]
     1517        elif SGData['SGUniq'] == 'c':
     1518            CSI['Spos'][0] = [Sx[2],Sx[0],Sx[1], Sx[5],Sx[3],Sx[4]]
     1519            CSI['Sadp'][0] = [Su[2],Su[0],Su[1],Su[5],Su[3],Su[4], Su[8],Su[6],Su[7],Su[11],Su[9],Su[10]]
     1520#        return CSI
     1521#    elif SGData['SGLaue'] == 'mmm':
     1522#    elif SGData['SGLaue'] in ['4/m','4/mmm']:
     1523#    elif SGData['SGLaue'] in ['3','3m1','31m']:
     1524#    elif SGData['SGLaue'] in ['6/m','6/mmm']:
     1525#       
     1526    xsin = np.zeros(3)
     1527    xcos = np.zeros(3)
     1528    usin = np.zeros(6)
     1529    ucos = np.zeros(6)
     1530    for i,idelt in enumerate(deltx):
     1531        nxyz = (np.inner(sop[0],(xyz+idelt))+sop[1])%1.
     1532        xcos[i] = np.allclose((xyz+idelt)%1.,nxyz,1.e-6)
     1533        xsin[i] = np.allclose((xyz-idelt)%1.,nxyz,1.e-6)
     1534    print CSI['Spos'][0]
     1535    print xsin,xcos
     1536    for i,idelt in enumerate(deltu):
     1537        nuij = U2Uij(np.inner(sop[0],np.inner(Uij2U(uij+idelt),sop[0])))
     1538        ucos[i] = np.allclose((uij+idelt),nuij,1.e-6)
     1539        usin[i] = np.allclose((uij-idelt),nuij,1.e-6)
     1540    print CSI['Sadp'][0]
     1541    print usin,ucos
     1542    return CSI
    14021543   
    14031544def MustrainNames(SGData):
     
    19042045#monoclinic - done
    19052046#3
    1906     'P 2':['(a0g)','(a1/2g)','(0b0)','(0b0)s','(1/2b0)','(1/2b0)s','(0b1/2)','(0b1/2)s',],
     2047    'P 2':['(a0g)','(a1/2g)','(0b0)','(0b0)s','(1/2b0)','(0b1/2)',],
    19072048#4       
    1908     'P 21':['(a0g)','(0b0)','(0b0)s','(1/2b0)','(1/2b0)s','(0b1/2)','(0b1/2)s',],
     2049    'P 21':['(a0g)','(0b0)','(1/2b0)','(0b1/2)',],
    19092050#5
    1910     'C 2':['(a0g)','(0b0)','(0b0)s','(0b1/2)','(0b1/2)s',],
     2051    'C 2':['(a0g)','(0b0)','(0b0)s','(0b1/2)',],
    19112052#6
    1912     'P m':['(a0g)','(a0g)s','(a1/2g)','(a1/2g)s','(0b0)','(1/2b0)','(0b1/2)',],
     2053    'P m':['(a0g)','(a0g)s','(a1/2g)','(0b0)','(1/2b0)','(0b1/2)',],
    19132054#7
    1914     'P a':['(a0g)','(a0g)s','(a1/2g)','(a1/2g)s','(0b0)','(0b1/2)',],
    1915     'P c':['(a0g)','(a0g)s','(a1/2g)','(a1/2g)s','(0b0)','(1/2b0)',],
    1916     'P n':['(a0g)','(a0g)s','(a1/2g)','(a1/2g)s','(0b0)','(1/2b1/2)',],
     2055    'P a':['(a0g)','(a1/2g)','(0b0)','(0b1/2)',],
     2056    'P c':['(a0g)','(a1/2g)','(0b0)','(1/2b0)',],
     2057    'P n':['(a0g)','(a1/2g)','(0b0)','(1/2b1/2)',],
    19172058#8       
    19182059    'C m':['(a0g)','(a0g)s','(0b0)','(0b1/2)',],
     
    19212062    'C n':['(a0g)','(a0g)s','(0b0)',],
    19222063#10       
    1923     'P 2/m':['(a0g)','(a0g)0s','(a1/2g)','(a1/2g)0s',
    1924         '(0b0)','(0b0)s0','(1/2b0)','(1/2b0)s0','(0b1/2)','(0b1/2)s0',],
     2064    'P 2/m':['(a0g)','(a0g)0s','(a1/2g)','(0b0)','(0b0)s0','(1/2b0)','(0b1/2)',],
    19252065#11
    1926     'P 21/m':['(a0g)','(a0g)0s','(0b0)','(0b0)s0',
    1927         '(1/2b0)','(1/2b0)s0','(0b1/2)','(0b1/2)s0'],
     2066    'P 21/m':['(a0g)','(a0g)0s','(0b0)','(0b0)s0','(1/2b0)','(0b1/2)',],
    19282067#12       
    1929     'C 2/m':['(a0g)','(a0g)0s','(0b0)','(0b0)s0','(0b1/2)','(0b1/2)s0',],
     2068    'C 2/m':['(a0g)','(a0g)0s','(0b0)','(0b0)s0','(0b1/2)',],
    19302069#13
    1931     'P 2/c':['(a0g)','(a0g)0s','(a1/2g)','(a1/2g)0s',
    1932         '(0b0)','(0b0)s0','(1/2b0)','(1/2b0)s0',],
    1933     'P 2/a':['(a0g)','(a0g)0s','(a1/2g)','(a1/2g)0s',
    1934         '(0b0)','(0b0)s0','(0b1/2)','(0b1/2)s0',],
    1935     'P 2/n':['(a0g)','(a0g)0s','(a1/2g)','(a1/2g)0s',
    1936         '(0b0)','(0b0)s0','(1/2b1/2)','(1/2b1/2)s0',],
     2070    'P 2/c':['(a0g)','(a0g)0s','(a1/2g)','(0b0)','(0b0)s0','(1/2b0)',],
     2071    'P 2/a':['(a0g)','(a0g)0s','(a1/2g)','(0b0)','(0b0)s0','(0b1/2)',],
     2072    'P 2/n':['(a0g)','(a0g)0s','(a1/2g)','(0b0)','(0b0)s0','(1/2b1/2)',],
    19372073#14
    1938     'P 21/c':['(a0g)','(a0g)0s','(0b0)','(0b0)s0','(1/2b0)','(1/2b0)s0',],
    1939     'P 21/a':['(a0g)','(a0g)0s','(0b0)','(0b0)s0','(0b1/2)','(0b1/2)s0',],
    1940     'P 21/n':['(a0g)','(a0g)0s','(0b0)','(0b0)s0','(1/2b1/2)','(1/2b1/2)s0',],
     2074    'P 21/c':['(a0g)','(0b0)','(1/2b0)',],
     2075    'P 21/a':['(a0g)','(0b0)','(0b1/2)',],
     2076    'P 21/n':['(a0g)','(0b0)','(1/2b1/2)',],
    19412077#15
    1942     'C 2/c':['(a0g)','(a0g)0s','(0b0)','(0b0)s0',],
    1943     'C 2/n':['(a0g)','(a0g)0s','(0b0)','(0b0)s0',],
     2078    'C 2/c':['(a0g)','(0b0)','(0b0)s0',],
     2079    'C 2/n':['(a0g)','(0b0)','(0b0)s0',],
    19442080#orthorhombic
    19452081#16   
Note: See TracChangeset for help on using the changeset viewer.