Changeset 3633


Ignore:
Timestamp:
Sep 30, 2018 3:47:12 PM (3 years ago)
Author:
vondreele
Message:

extend Unit Cells List Bravais lattice choices to include Ammm and Bmmm. This allows test indexing to find 100, 010 or 001 propagation vectors. Also allows peak indexing in these Bravais lattices in addition to Cmmm.

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIctrlGUI.py

    r3629 r3633  
    50735073     '''Analysis of a antiferromagnet with change of space group using Bilbao k-SUBGROUPSMAG from CW neutron powder data'''],
    50745074     
    5075    
     5075    ['Magnetic-III', 'Magnetic-III.htm',"Magnetic Structure Analysis-III",
     5076     '''Analysis of a Type IV antiferromagnet with a cell axis doubling using Bilbao k-SUBGROUPSMAG from CW neutron powder data'''],
     5077         
    50765078    ['Parametric sequential fitting'],
    50775079    ['SeqRefine', 'SequentialTutorial.htm', 'Sequential refinement of multiple datasets',
  • trunk/GSASIIdataGUI.py

    r3619 r3633  
    79927992        if not data:
    79937993            data.append([0,0.0,4,25.0,0,'P1',1.,1.,1.,90.,90.,90.,1.,'P 1']) #zero error flag, zero value, max Nc/No, start volume
    7994             data.append([0,0,0,0,0,0,0,0,0,0,0,0,0,0])      #Bravais lattice flags
     7994            data.append([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0])      #Bravais lattice flags
    79957995            data.append([])                                 #empty cell list
    79967996            data.append([])                                 #empty dmin
  • trunk/GSASIIindex.py

    r3496 r3633  
    106106        A[2] *= R
    107107        A[3] = A[4] = A[5] = 0.       
    108     elif Bravais in [7,8,9,10]:     #orthorhombic
     108    elif Bravais in [7,8,9,10,11,12]:     #orthorhombic
    109109        A[0] *= R
    110110        A[1] *= R
    111111        A[2] *= R
    112112        A[3] = A[4] = A[5] = 0.       
    113     elif Bravais in [11,12]:        #monoclinic
     113    elif Bravais in [13,14]:        #monoclinic
    114114        A[0] *= R
    115115        A[1] *= R
     
    140140        c = ranaxis(dmin,dmax)
    141141        alp = bet = gam = 90
    142     elif Bravais in [7,8,9,10]:       #orthorhombic - F,I,C,P - a<b<c convention
     142    elif Bravais in [7,8,9,10,11,12]:       #orthorhombic - F,I,P - a<b<c convention
    143143        abc = [ranaxis(dmin,dmax),ranaxis(dmin,dmax),ranaxis(dmin,dmax)]
    144         if Bravais in [7,8,10]:
     144        if Bravais in [7,8,12]:
    145145            abc.sort()
    146146        a = abc[0]
     
    148148        c = abc[2]
    149149        alp = bet = gam = 90
    150     elif Bravais in [11,12]:        #monoclinic - C,P - a<c convention
     150    elif Bravais in [13,14]:        #monoclinic - C,P - a<c convention
    151151        ac = [ranaxis(dmin,dmax),ranaxis(dmin,dmax)]
    152         if Bravais == 12:
     152        if Bravais == 13:
    153153            ac.sort()
    154154        a = ac[0]
     
    421421    elif ibrav in [5,6]:
    422422        return [values[0],values[0],values[1],0,0,0]
    423     elif ibrav in [7,8,9,10]:
     423    elif ibrav in [7,8,9,10,11,12]:
    424424        return [values[0],values[1],values[2],0,0,0]
    425     elif ibrav in [11,12]:
     425    elif ibrav in [13,14]:
    426426        return [values[0],values[1],values[2],0,values[3],0]
    427427    else:
     
    434434    elif ibrav in [3,4,5,6]:
    435435        return [A[0],A[2]]
    436     elif ibrav in [7,8,9,10]:
     436    elif ibrav in [7,8,9,10,11,12]:
    437437        return [A[0],A[1],A[2]]
    438     elif ibrav in [11,12]:
     438    elif ibrav in [13,14]:
    439439        return [A[0],A[1],A[2],A[4]]
    440440    else:
     
    444444    if ibrav in [3,4,5,6]:
    445445        Nskip = 2
    446     elif ibrav in [7,8,9,10]:
     446    elif ibrav in [7,8,9,10,11,12]:
    447447        Nskip = 3
    448     elif ibrav in [11,12]:
     448    elif ibrav in [13,14]:
    449449        Nskip = 4
    450450    else:
     
    476476        elif ibrav in [5,6]:
    477477            derv = [H[0]*H[0]+H[1]*H[1],H[2]*H[2]]
    478         elif ibrav in [7,8,9,10]:
     478        elif ibrav in [7,8,9,10,11,12]:
    479479            derv = [H[0]*H[0],H[1]*H[1],H[2]*H[2]]
    480         elif ibrav in [11,12]:
     480        elif ibrav in [13,14]:
    481481            derv = [H[0]*H[0],H[1]*H[1],H[2]*H[2],H[0]*H[2]]
    482482        else:
     
    508508    elif ibrav in [5,6]:
    509509        derv = [H[0]*H[0]+H[1]*H[1],H[2]*H[2]]
    510     elif ibrav in [7,8,9,10]:
     510    elif ibrav in [7,8,9,10,11,12]:
    511511        derv = [H[0]*H[0],H[1]*H[1],H[2]*H[2]]
    512     elif ibrav in [11,12]:
     512    elif ibrav in [13,14]:
    513513        derv = [H[0]*H[0],H[1]*H[1],H[2]*H[2],H[0]*H[2]]
    514514    else:
     
    555555    elif ibrav in [5,6]:
    556556        derv = [HM[0]*HM[0]+HM[1]*HM[1],HM[2]*HM[2]]
    557     elif ibrav in [7,8,9,10]:
     557    elif ibrav in [7,8,9,10,11,12]:
    558558        derv = [HM[0]*HM[0],HM[1]*HM[1],HM[2]*HM[2]]
    559     elif ibrav in [11,12]:
     559    elif ibrav in [13,14]:
    560560        derv = [HM[0]*HM[0],HM[1]*HM[1],HM[2]*HM[2],HM[0]*HM[2]]
    561561    else:
     
    608608    elif ibrav in [5,6]:
    609609        derv = [H[0]*H[0]+H[1]*H[1],H[2]*H[2]]
    610     elif ibrav in [7,8,9,10]:
     610    elif ibrav in [7,8,9,10,11,12]:
    611611        derv = [H[0]*H[0],H[1]*H[1],H[2]*H[2]]
    612     elif ibrav in [11,12]:
     612    elif ibrav in [13,14]:
    613613        derv = [H[0]*H[0],H[1]*H[1],H[2]*H[2],H[0]*H[2]]
    614614    else:
     
    652652    elif ibrav in [5,6]:
    653653        derv = [HM[0]*HM[0]+HM[1]*HM[1],HM[2]*HM[2]]
    654     elif ibrav in [7,8,9,10]:
     654    elif ibrav in [7,8,9,10,11,12]:
    655655        derv = [HM[0]*HM[0],HM[1]*HM[1],HM[2]*HM[2]]
    656     elif ibrav in [11,12]:
     656    elif ibrav in [13,14]:
    657657        derv = [HM[0]*HM[0],HM[1]*HM[1],HM[2]*HM[2],HM[0]*HM[2]]
    658658    else:
     
    852852        if A:
    853853            Abeg = ranAbyR(ibrav,A,tries+1,Ntries,ran2axis)
    854             if ibrav in [11,12,13]:         #monoclinic & triclinic
     854            if ibrav in [13,14,15]:         #monoclinic & triclinic
    855855                Abeg = ranAbyR(ibrav,A,tries/10+1,Ntries,ran2axis)
    856856        else:
     
    871871            Lhkl,M20,X20,Aref = refinePeaks(peaks,ibrav,Abeg,ifX20)
    872872            Asave.append([calc_M20(peaks,HKL,ifX20),Aref[:]])
    873             if ibrav == 9:                          #C-centered orthorhombic
     873            if ibrav in [9,10,11]:                          #C-centered orthorhombic
    874874                for i in range(2):
    875875                    Abeg = rotOrthoA(Abeg[:])
     
    878878                    peaks = IndexPeaks(peaks,HKL)[1]
    879879                    Asave.append([calc_M20(peaks,HKL,ifX20),Aref[:]])
    880             elif ibrav == 11:                      #C-centered monoclinic
     880            elif ibrav == 13:                      #C-centered monoclinic
    881881                Abeg = swapMonoA(Abeg[:])
    882882                Lhkl,M20,X20,Aref = refinePeaks(peaks,ibrav,Abeg,ifX20)
     
    899899    a,b,c,alp,bet,gam = G2lat.A2cell(A)
    900900    G,g = G2lat.A2Gmat(A)
    901     if ibrav in [11]:
     901    if ibrav in [13]:
    902902        u = [0,0,-1]
    903903        v = [1,0,2]
     
    925925    dmin = getDmin(peaks)-delt
    926926    bravaisNames = ['Cubic-F','Cubic-I','Cubic-P','Trigonal-R','Trigonal/Hexagonal-P',
    927         'Tetragonal-I','Tetragonal-P','Orthorhombic-F','Orthorhombic-I','Orthorhombic-C',
     927        'Tetragonal-I','Tetragonal-P','Orthorhombic-F','Orthorhombic-I','Orthorhombic-A',
     928        'Orthorhombic-B','Orthorhombic-C',
    928929        'Orthorhombic-P','Monoclinic-C','Monoclinic-P','Triclinic']
    929930    tries = ['1st','2nd','3rd','4th','5th','6th','7th','8th','9th','10th']
    930     N1s = [1,1,1,   5,5,  5,5, 50,50,50,50,  50,50, 200]
    931     N2s = [1,1,1,   2,2,  2,2,     2,2,2,2,   2,2,   4]
    932     Nm  = [1,1,1,   1,1,  1,1,     1,1,1,1,   2,2,   4]
     931    N1s = [1,1,1,   5,5,  5,5, 50,50,50,50,50,50,  50,50, 200]
     932    N2s = [1,1,1,   2,2,  2,2,     2,2,2,2,2,2,   2,2,   4]
     933    Nm  = [1,1,1,   1,1,  1,1,     1,1,1,1,1,1,   2,2,   4]
    933934    notUse = 0
    934935    for peak in peaks:
     
    942943    cells = []
    943944    lastcell = np.zeros(7)
    944     for ibrav in range(14):
     945    for ibrav in range(16):
    945946        begin = time.time()
    946947        if bravais[ibrav]:
     
    983984                                    bestM20 = max(bestM20,M20)
    984985                                    A = halfCell(ibrav,A[:],peaks)
    985                                     if ibrav in [12]:
     986                                    if ibrav in [14,]:
    986987                                        A = monoCellReduce(ibrav,A[:])
    987988                                    HKL = G2lat.GenHBravais(dmin,ibrav,A)
  • trunk/GSASIIlattice.py

    r3622 r3633  
    10181018    elif center.upper() == 'I' and system.lower() == 'orthorhombic':
    10191019        return 8
     1020    elif center.upper() == 'A' and system.lower() == 'orthorhombic':
     1021        return 9
     1022    elif center.upper() == 'B' and system.lower() == 'orthorhombic':
     1023        return 10
    10201024    elif center.upper() == 'C' and system.lower() == 'orthorhombic':
    1021         return 9
     1025        return 11
    10221026    elif center.upper() == 'P' and system.lower() == 'orthorhombic':
    1023         return 10
     1027        return 12
    10241028    elif center.upper() == 'C' and system.lower() == 'monoclinic':
    1025         return 11
     1029        return 13
    10261030    elif center.upper() == 'P' and system.lower() == 'monoclinic':
    1027         return 12
     1031        return 14
    10281032    elif center.upper() == 'P' and system.lower() == 'triclinic':
    1029         return 13
     1033        return 15
    10301034    raise ValueError('non-standard Bravais lattice center=%s, cell=%s' % (center,system))
    10311035
     
    10451049            * 7 F orthorhombic
    10461050            * 8 I orthorhombic
    1047             * 9 C orthorhombic
    1048             * 10 P orthorhombic
    1049             * 11 C monoclinic
    1050             * 12 P monoclinic
    1051             * 13 P triclinic
     1051            * 9 A orthorhombic
     1052            * 10 B orthorhombic
     1053            * 11 C orthorhombic
     1054            * 12 P orthorhombic
     1055            * 13 C monoclinic
     1056            * 14 P monoclinic
     1057            * 15 P triclinic
    10521058           
    10531059    :param A: reciprocal metric tensor elements as [G11,G22,G33,2*G12,2*G13,2*G23]
     
    10551061           
    10561062    """
    1057     if Bravais in [9,11]:
     1063    if Bravais in [9,]:
     1064        Cent = 'A'
     1065    elif Bravais in [10,]:
     1066        Cent = 'B'
     1067    elif Bravais in [11,13]:
    10581068        Cent = 'C'
    10591069    elif Bravais in [1,5,8]:
     
    10681078    dminsq = 1./(dmin**2)
    10691079    HKL = []
    1070     if Bravais == 13:                       #triclinic
     1080    if Bravais == 15:                       #triclinic
    10711081        for l in range(-Hmax[2],Hmax[2]+1):
    10721082            for k in range(-Hmax[1],Hmax[1]+1):
     
    10791089                    if 0 < rdsq <= dminsq:
    10801090                        HKL.append([h,k,l,rdsq2d(rdsq,6),-1])
    1081     elif Bravais in [11,12]:                #monoclinic - b unique
     1091    elif Bravais in [13,14]:                #monoclinic - b unique
    10821092        Hmax = SwapIndx(2,Hmax)
    10831093        for h in range(Hmax[0]+1):
     
    10941104                            HKL.append([h,k,l,rdsq2d(rdsq,6),-1])
    10951105                    [h,k,l] = SwapIndx(2,[h,k,l])
    1096     elif Bravais in [7,8,9,10]:            #orthorhombic
     1106    elif Bravais in [7,8,9,10,11,12]:            #orthorhombic
    10971107        for h in range(Hmax[0]+1):
    10981108            for k in range(Hmax[1]+1):
  • trunk/GSASIIpwdGUI.py

    r3621 r3633  
    26712671    '''
    26722672    bravaisSymb = ['Fm3m','Im3m','Pm3m','R3-H','P6/mmm','I4/mmm',
    2673         'P4/mmm','Fmmm','Immm','Cmmm','Pmmm','C2/m','P2/m','C1','P1']
     2673        'P4/mmm','Fmmm','Immm','Ammm','Bmmm','Cmmm','Pmmm','C2/m','P2/m','C1','P1']
    26742674    IndexId = G2gd.GetGPXtreeItemId(G2frame,G2frame.PatternId, 'Index Peak List')
    26752675    Inst = G2frame.GPXtree.GetItemPyData(G2gd.GetGPXtreeItemId(G2frame,G2frame.PatternId, 'Instrument Parameters'))[0]
     
    28192819    SPGlist = G2spc.spglist
    28202820    bravaisSymb = ['Fm3m','Im3m','Pm3m','R3-H','P6/mmm','I4/mmm','P4/mmm',
    2821         'Fmmm','Immm','Cmmm','Pmmm','C2/m','P2/m','C1','P1']
     2821        'Fmmm','Immm','Ammm','Bmmm','Cmmm','Pmmm','C2/m','P2/m','C1','P1']
    28222822    spaceGroups = ['F m 3 m','I m 3 m','P m 3 m','R 3 m','P 6/m m m','I 4/m m m',
    2823         'P 4/m m m','F m m m','I m m m','C m m m','P m m m','C 2/m','P 2/m','C -1','P -1']
     2823        'P 4/m m m','F m m m','I m m m','A m m m','B m m m','C m m m','P m m m','C 2/m','P 2/m','C -1','P -1']
    28242824    Inst = G2frame.GPXtree.GetItemPyData(G2gd.GetGPXtreeItemId(G2frame,G2frame.PatternId, 'Instrument Parameters'))[0]
    28252825    Limits = G2frame.GPXtree.GetItemPyData(G2gd.GetGPXtreeItemId(G2frame,G2frame.PatternId, 'Limits'))[1]
     
    28412841            if controls[5] in ['R3-H','P6/mmm']:
    28422842                controls[11] = 120.
    2843         elif controls[5] in ['Fmmm','Immm','Cmmm','Pmmm']:
     2843        elif controls[5] in ['Fmmm','Immm','Ammm','Bmmm','Cmmm','Pmmm']:
    28442844            controls[9] = controls[10] = controls[11] = 90.
    28452845        elif controls[5] in ['C2/m','P2/m']:
     
    28582858        Obj = event.GetEventObject()
    28592859        bravais[bravList.index(Obj.GetId())] = Obj.GetValue()
    2860         wx.CallAfter(UpdateUnitCellsGrid,G2frame,data)
     2860#        wx.CallAfter(UpdateUnitCellsGrid,G2frame,data)
    28612861               
    28622862    def OnZeroVar(event):
     
    31983198            elif ibrav in ['R3-H','P6/mmm','I4/mmm','P4/mmm']:
    31993199                print (" %s%10.6f %s%10.6f %s%12.3f" % ('a =',cell[0],' c =',cell[2],' volume =',Vol))
    3200             elif ibrav in ['P4/mmm','Fmmm','Immm','Cmmm','Pmmm']:
     3200            elif ibrav in ['P4/mmm','Fmmm','Immm','Ammm','Bmmm','Cmmm','Pmmm']:
    32013201                print (" %s%10.6f %s%10.6f %s%10.6f %s%12.3f" % ('a =',cell[0],'b =',cell[1],'c =',cell[2],' volume =',Vol))
    32023202            elif ibrav in ['C2/m','P2/m']:
     
    36403640    if len(controls) < 14:              #add space group if missing
    36413641        controls.append(spaceGroups[bravaisSymb.index(controls[5])])
     3642    if len(bravais) < 16:
     3643        bravais += [0,0,]
    36423644    SGData = ssopt.get('SGData',G2spc.SpcGroup(controls[13])[1])
    36433645    G2frame.GPXtree.SetItemPyData(UnitCellsId,data)            #update with volume
    36443646    bravaisNames = ['Cubic-F','Cubic-I','Cubic-P','Trigonal-R','Trigonal/Hexagonal-P',
    3645         'Tetragonal-I','Tetragonal-P','Orthorhombic-F','Orthorhombic-I','Orthorhombic-C',
    3646         'Orthorhombic-P','Monoclinic-C','Monoclinic-P','Triclinic','Triclinic']
     3647        'Tetragonal-I','Tetragonal-P','Orthorhombic-F','Orthorhombic-I','Orthorhombic-A',
     3648        'Orthorhombic-B','Orthorhombic-C','Orthorhombic-P',
     3649        'Monoclinic-C','Monoclinic-P','Triclinic','Triclinic']
    36473650    cellGUIlist = [[[0,1,2],4,zip([" Unit cell: a = "," Vol = "],[(10,5),"%.3f"],[True,False],[0,0])],
    36483651    [[3,4,5,6],6,zip([" Unit cell: a = "," c = "," Vol = "],[(10,5),(10,5),"%.3f"],[True,True,False],[0,2,0])],
    3649     [[7,8,9,10],8,zip([" Unit cell: a = "," b = "," c = "," Vol = "],[(10,5),(10,5),(10,5),"%.3f"],
     3652    [[7,8,9,10,11,12],8,zip([" Unit cell: a = "," b = "," c = "," Vol = "],[(10,5),(10,5),(10,5),"%.3f"],
    36503653        [True,True,True,False],[0,1,2,0])],
    3651     [[11,12],10,zip([" Unit cell: a = "," b = "," c = "," beta = "," Vol = "],
     3654    [[13,14],10,zip([" Unit cell: a = "," b = "," c = "," beta = "," Vol = "],
    36523655        [(10,5),(10,5),(10,5),(10,3),"%.3f"],[True,True,True,True,False],[0,1,2,4,0])],
    3653     [[13,14],8,zip([" Unit cell: a = "," b = "," c = "," Vol = "," alpha = "," beta = "," gamma = "],
     3656    [[15,16],8,zip([" Unit cell: a = "," b = "," c = "," Vol = "," alpha = "," beta = "," gamma = "],
    36543657        [(10,5),(10,5),(10,5),"%.3f",(10,3),(10,3),(10,3)],
    36553658        [True,True,True,False,True,True,True],[0,1,2,0,3,4,5])]]
     
    38973900        if 'N' in Inst['Type'][0]:
    38983901            G2frame.dataWindow.RunSubGroupsMag.Enable(True)
    3899        
     3902        G2frame.dataWindow.CopyCell.Enable(False)
    39003903        Label = '\n Magnetic cells from Bilbao k-SUBGROUPSMAG for %s; kvec1: (%s), kvec2: (%s):'%(SGData['SpGrp'],''.join(controls[14][:3]),''.join(controls[14][3:]))
    39013904        mainSizer.Add(wx.StaticText(parent=G2frame.dataWindow,label=Label),0,WACV)
Note: See TracChangeset for help on using the changeset viewer.