Changeset 4862


Ignore:
Timestamp:
Mar 23, 2021 2:02:01 PM (7 months ago)
Author:
vondreele
Message:

add A-centered monoclinic to list of indexable lattices.
Fix a number of monoclinic indexing issues.

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIindex.py

    r4810 r4862  
    114114        A[2] *= R
    115115        A[3] = A[4] = A[5] = 0.       
    116     elif Bravais in [13,14,15]:        #monoclinic
     116    elif Bravais in [13,14,15,16]:        #monoclinic
    117117        A[0] *= R
    118118        A[1] *= R
     
    151151        c = abc[2]
    152152        alp = bet = gam = 90
    153     elif Bravais in [13,14,15]:        #monoclinic - C,P - a<c convention
     153    elif Bravais in [13,14,15,16]:        #monoclinic - C,P - a<c convention
    154154        ac = [ranaxis(dmin,dmax),ranaxis(dmin,dmax)]
    155155        if Bravais in [13,14]:
     
    426426    elif ibrav in [7,8,9,10,11,12]:
    427427        return [values[0],values[1],values[2],0,0,0]
    428     elif ibrav in [13,14,15]:
     428    elif ibrav in [13,14,15,16]:
    429429        return [values[0],values[1],values[2],0,values[3],0]
    430430    else:
     
    439439    elif ibrav in [7,8,9,10,11,12]:
    440440        return [A[0],A[1],A[2]]
    441     elif ibrav in [13,14,15]:
     441    elif ibrav in [13,14,15,16]:
    442442        return [A[0],A[1],A[2],A[4]]
    443443    else:
     
    449449    elif ibrav in [7,8,9,10,11,12]:
    450450        Nskip = 3
    451     elif ibrav in [13,14,15]:
     451    elif ibrav in [13,14,15,16]:
    452452        Nskip = 4
    453453    else:
     
    481481        elif ibrav in [7,8,9,10,11,12]:
    482482            derv = [H[0]*H[0],H[1]*H[1],H[2]*H[2]]
    483         elif ibrav in [13,14,15]:
     483        elif ibrav in [13,14,15,16]:
    484484            derv = [H[0]*H[0],H[1]*H[1],H[2]*H[2],H[0]*H[2]]
    485485        else:
     
    513513    elif ibrav in [7,8,9,10,11,12]:
    514514        derv = [H[0]*H[0],H[1]*H[1],H[2]*H[2]]
    515     elif ibrav in [13,14,15]:
     515    elif ibrav in [13,14,15,16]:
    516516        derv = [H[0]*H[0],H[1]*H[1],H[2]*H[2],H[0]*H[2]]
    517517    else:
     
    560560    elif ibrav in [7,8,9,10,11,12]:
    561561        derv = [HM[0]*HM[0],HM[1]*HM[1],HM[2]*HM[2]]
    562     elif ibrav in [13,14,15]:
     562    elif ibrav in [13,14,15,16]:
    563563        derv = [HM[0]*HM[0],HM[1]*HM[1],HM[2]*HM[2],HM[0]*HM[2]]
    564564    else:
     
    612612    elif ibrav in [7,8,9,10,11,12]:
    613613        derv = [H[0]*H[0],H[1]*H[1],H[2]*H[2]]
    614     elif ibrav in [13,14,15]:
     614    elif ibrav in [13,14,15,16]:
    615615        derv = [H[0]*H[0],H[1]*H[1],H[2]*H[2],H[0]*H[2]]
    616616    else:
     
    656656    elif ibrav in [7,8,9,10,11,12]:
    657657        derv = [HM[0]*HM[0],HM[1]*HM[1],HM[2]*HM[2]]
    658     elif ibrav in [13,14,15]:
     658    elif ibrav in [13,14,15,16]:
    659659        derv = [HM[0]*HM[0],HM[1]*HM[1],HM[2]*HM[2],HM[0]*HM[2]]
    660660    else:
     
    838838# A = 0 for random cell, volume normalized to V1;
    839839# returns number of generated hkls, M20, X20 & A for best found
    840     mHKL = [3,3,3, 5,5, 5,5, 7,7,7,7,7,7, 9,9,9, 10]
     840    mHKL = [3,3,3, 5,5, 5,5, 7,7,7,7,7,7, 9,9,9,9, 10]
    841841    dmin = getDmin(peaks)-0.05
    842842    amin = 2.5
     
    880880                    peaks = IndexPeaks(peaks,HKL)[1]
    881881                    Asave.append([calc_M20(peaks,HKL,ifX20),Aref[:]])
    882             elif ibrav == 13:                      #C-centered monoclinic
    883                 Abeg = swapMonoA(Abeg[:])
    884                 Lhkl,M20,X20,Aref = refinePeaks(peaks,ibrav,Abeg,ifX20)
    885                 HKL = G2lat.GenHBravais(dmin,ibrav,Aref)
    886                 peaks = IndexPeaks(peaks,HKL)[1]
    887                 Asave.append([calc_M20(peaks,HKL,ifX20),Aref[:]])
     882            # elif ibrav == 15:                      #C-centered monoclinic
     883            #     Abeg = swapMonoA(Abeg[:])
     884            #     Lhkl,M20,X20,Aref = refinePeaks(peaks,ibrav,Abeg,ifX20)
     885            #     HKL = G2lat.GenHBravais(dmin,ibrav,Aref)
     886            #     peaks = IndexPeaks(peaks,HKL)[1]
     887            #     Asave.append([calc_M20(peaks,HKL,ifX20),Aref[:]])
    888888        else:
    889889            break
     
    901901    a,b,c,alp,bet,gam = G2lat.A2cell(A)
    902902    G,g = G2lat.A2Gmat(A)
    903     if ibrav in [13]:
     903    if ibrav in [13,]:    #I-monoclinic
     904        pass
     905        # u = [-1,0,0]
     906        # v = [1,0,1]
     907        # cnew = math.sqrt(np.dot(np.dot(v,g),v))
     908        # if cnew < c:
     909        #     cang = np.dot(np.dot(u,g),v)/(a*cnew)
     910        #     beta = acosd(-abs(cang))
     911        #     if beta < 90.: beta = 180.-beta
     912        #     A = G2lat.cell2A([a,b,cnew,90,beta,90])
     913    elif ibrav in [14,]:      #A-monoclinic - OK?
    904914        u = [0,0,-1]
    905915        v = [1,0,2]
     
    908918            cang = np.dot(np.dot(u,g),v)/(anew*c)
    909919            beta = acosd(-abs(cang))
     920            if beta < 90.: beta = 180.-beta
    910921            A = G2lat.cell2A([anew,b,c,90,beta,90])
    911     else:
     922    elif ibrav in [15,]:    #C-monoclinic - OK?
    912923        u = [-1,0,0]
    913924        v = [1,0,1]
     
    916927            cang = np.dot(np.dot(u,g),v)/(a*cnew)
    917928            beta = acosd(-abs(cang))
     929            if beta < 90.: beta = 180.-beta
    918930            A = G2lat.cell2A([a,b,cnew,90,beta,90])
    919931    return A
     
    930942        'Tetragonal-I','Tetragonal-P','Orthorhombic-F','Orthorhombic-I','Orthorhombic-A',
    931943        'Orthorhombic-B','Orthorhombic-C',
    932         'Orthorhombic-P','Monoclinic-I','Monoclinic-C','Monoclinic-P','Triclinic']
     944        'Orthorhombic-P','Monoclinic-I','Monoclinic-A','Monoclinic-C','Monoclinic-P','Triclinic']
    933945    tries = ['1st','2nd','3rd','4th','5th','6th','7th','8th','9th','10th']
    934     N1s = [1,1,1,   5,5,  5,5, 50,50,50,50,50,50,  100,100,100, 200]
    935     N2s = [1,1,1,   2,2,  2,2,     2,2,2,2,2,2,   2,2,2,   4]
    936     Nm  = [1,1,1,   1,1,  1,1,     1,1,1,1,1,1,   2,2,2,   4]
     946    N1s = [1,1,1,   5,5,  5,5, 50,50,50,50,50,50,  100,100,100,100, 200]
     947    N2s = [1,1,1,   2,2,  2,2,     2,2,2,2,2,2,   2,2,2,2,   4]
     948    Nm  = [1,1,1,   1,1,  1,1,     1,1,1,1,1,1,   2,2,2,2,   4]
    937949    notUse = 0
    938950    for peak in peaks:
     
    9921004                                    bestM20 = max(bestM20,M20)
    9931005                                    A = halfCell(ibrav,A[:],peaks)
    994                                     if ibrav in [14,]:
     1006                                    if ibrav in [13,14,15]:
    9951007                                        A = monoCellReduce(ibrav,A[:])
    9961008                                    HKL = G2lat.GenHBravais(dmin,ibrav,A)
     
    10191031                        if ibrav < 13:
    10201032                            V1 *= 1.1
    1021                         elif ibrav in range(13,17):
     1033                        elif ibrav in range(13,18):
    10221034                            V1 *= 1.025
    10231035                        if not GoOn:
  • trunk/GSASIIlattice.py

    r4826 r4862  
    868868    ''' convert d-spacing to powder pattern position (2-theta or TOF, musec)
    869869    '''
    870     if 'T' in Inst['Type'][0] or 'PKS' in Inst['Type'][0]:
     870    if 'T' in Inst['Type'][0]:
    871871        pos = Inst['difC'][1]*dsp+Inst['Zero'][1]+Inst['difA'][1]*dsp**2+Inst.get('difB',[0,0,False])[1]/dsp
    872872    else:   #'C' or 'B'
     
    11851185            * 12 P orthorhombic
    11861186            * 13 I monoclinic
    1187             * 14 C monoclinic
    1188             * 15 P monoclinic
    1189             * 16 P triclinic
     1187            = 14 A monoclinic
     1188            * 15 C monoclinic
     1189            * 16 P monoclinic
     1190            * 17 P triclinic
    11901191           
    11911192    :param A: reciprocal metric tensor elements as [G11,G22,G33,2*G12,2*G13,2*G23]
     
    12031204                    cctbx_args['sg_type'], cctbx_args['uctbx_unit_cell'], cctbx_args['miller_index_generator'])
    12041205   
    1205     if Bravais in [9,]:
     1206    if Bravais in [9,14]:
    12061207        Cent = 'A'
    12071208    elif Bravais in [10,]:
    12081209        Cent = 'B'
    1209     elif Bravais in [11,14]:
     1210    elif Bravais in [11,15]:
    12101211        Cent = 'C'
    12111212    elif Bravais in [1,5,8,13]:
     
    12201221    dminsq = 1./(dmin**2)
    12211222    HKL = []
    1222     if Bravais == 16:                       #triclinic
     1223    if Bravais == 17:                       #triclinic
    12231224        for l in range(-Hmax[2],Hmax[2]+1):
    12241225            for k in range(-Hmax[1],Hmax[1]+1):
     
    12311232                    if 0 < rdsq <= dminsq:
    12321233                        HKL.append([h,k,l,rdsq2d(rdsq,6),-1])
    1233     elif Bravais in [13,14,15]:                #monoclinic - b unique
     1234    elif Bravais in [13,14,15,16]:                #monoclinic - b unique
    12341235        Hmax = SwapIndx(2,Hmax)
    12351236        for h in range(Hmax[0]+1):
  • trunk/GSASIIpwdGUI.py

    r4848 r4862  
    32403240        elif controls[5] in ['Fmmm','Immm','Ammm','Bmmm','Cmmm','Pmmm']:
    32413241            controls[9] = controls[10] = controls[11] = 90.
    3242         elif controls[5] in ['C2/m','P2/m','I2/m']:
     3242        elif controls[5] in ['A2/m','C2/m','P2/m','I2/m']:
    32433243            controls[9] = controls[11] = 90.  # b unique
    32443244        controls[12] = G2lat.calc_V(G2lat.cell2A(controls[6:12]))
     
    33853385            Obj.SetValue(controls[6+ObjId])
    33863386            controls[9] = controls[10] = controls[11] = 90.0
    3387         elif controls[5] in ['I2/m','C2/m','P2/m']:
     3387        elif controls[5] in ['I2/m','A2/m','C2/m','P2/m']:
    33883388            controls[9] = controls[11] = 90.0
    33893389            if ObjId != 3:
     
    36443644            elif ibrav in ['P4/mmm','Fmmm','Immm','Ammm','Bmmm','Cmmm','Pmmm']:
    36453645                print (" %s%10.6f %s%10.6f %s%10.6f %s%12.3f" % ('a =',cell[0],'b =',cell[1],'c =',cell[2],' volume =',Vol))
    3646             elif ibrav in ['C2/m','P2/m']:
     3646            elif ibrav in ['I2/m','A2/m','C2/m','P2/m']:
    36473647                print (" %s%10.6f %s%10.6f %s%10.6f %s%8.3f %s%12.3f" % ('a =',cell[0],'b =',cell[1],'c =',cell[2],'beta =',cell[4],' volume =',Vol))
    36483648            else:
     
    43504350    SPGlist = G2spc.spglist
    43514351    bravaisSymb = ['Fm3m','Im3m','Pm3m','R3-H','P6/mmm','I4/mmm','P4/mmm',
    4352         'Fmmm','Immm','Ammm','Bmmm','Cmmm','Pmmm','I2/m','C2/m','P2/m','P1','C1']
     4352        'Fmmm','Immm','Ammm','Bmmm','Cmmm','Pmmm','I2/m','A2/m','C2/m','P2/m','P1','C1']
    43534353    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',
    4354         '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','I 2/m','C 2/m','P 2/m','P -1','C -1']
     4354        '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','I 2/m','A 2/m','C 2/m','P 2/m','P -1','C -1']
    43554355    Inst = G2frame.GPXtree.GetItemPyData(G2gd.GetGPXtreeItemId(G2frame,G2frame.PatternId, 'Instrument Parameters'))[0]
    43564356    Limits = G2frame.GPXtree.GetItemPyData(G2gd.GetGPXtreeItemId(G2frame,G2frame.PatternId, 'Limits'))[1]
     
    43844384    if len(controls) < 15:
    43854385        controls.append(list(range(1,len(magcells)+1)))
    4386     while len(bravais) < 17:
     4386    while len(bravais) < 18:
    43874387        bravais += [0,]
    43884388    SGData = ssopt.get('SGData',G2spc.SpcGroup(controls[13])[1])
     
    43914391        'Tetragonal-I','Tetragonal-P','Orthorhombic-F','Orthorhombic-I','Orthorhombic-A',
    43924392        'Orthorhombic-B','Orthorhombic-C','Orthorhombic-P',
    4393         'Monoclinic-I','Monoclinic-C','Monoclinic-P','Triclinic','Triclinic',]
     4393        'Monoclinic-I','Monoclinic-A','Monoclinic-C','Monoclinic-P','Triclinic','Triclinic',]
    43944394    cellGUIlist = [[[0,1,2],4,zip([" Unit cell: a = "," Vol = "],[(10,5),"%.3f"],[True,False],[0,0])],
    43954395    [[3,4,5,6],6,zip([" Unit cell: a = "," c = "," Vol = "],[(10,5),(10,5),"%.3f"],[True,True,False],[0,2,0])],
    43964396    [[7,8,9,10,11,12],8,zip([" Unit cell: a = "," b = "," c = "," Vol = "],[(10,5),(10,5),(10,5),"%.3f"],
    43974397        [True,True,True,False],[0,1,2,0])],
    4398     [[13,14,15],10,zip([" Unit cell: a = "," b = "," c = "," beta = "," Vol = "],
     4398    [[13,14,15,16],10,zip([" Unit cell: a = "," b = "," c = "," beta = "," Vol = "],
    43994399        [(10,5),(10,5),(10,5),(10,3),"%.3f"],[True,True,True,True,False],[0,1,2,4,0])],
    4400     [[16,17],8,zip([" Unit cell: a = "," b = "," c = "," alpha = "," beta = "," gamma = "," Vol = "],
     4400    [[17,18],8,zip([" Unit cell: a = "," b = "," c = "," alpha = "," beta = "," gamma = "," Vol = "],
    44014401        [(10,5),(10,5),(10,5),(10,3),(10,3),(10,3),"%.3f"],
    44024402        [True,True,True,True,True,True,False],[0,1,2,3,4,5,0])]]
  • trunk/GSASIIstrIO.py

    r4861 r4862  
    797797      and histograms (specified as str values)
    798798    '''
    799                        
    800     import distutils.file_util as dfu
    801    
     799                           
    802800    GPXphase = os.path.splitext(GPXfile)[0]+'.seqPhase'
    803801    fp = open(GPXphase,'rb')
     
    13851383                elif symHold is not None: #variable is held due to symmetry
    13861384                    symHold.append(name)
    1387         for k in equivs:
    1388             equiv = equivs[k]
    1389             if len(equiv) > 1:
    1390                 name = equiv[0][0]
    1391                 coef = equiv[0][1]
    1392                 for eqv in equiv[1:]:
     1385        for equiv in equivs:
     1386            if len(equivs[equiv]) > 1:
     1387                name = equivs[equiv][0][0]
     1388                coef = equivs[equiv][0][1]
     1389                for eqv in equivs[equiv][1:]:
    13931390                    eqv[1] /= coef
    13941391                    G2mv.StoreEquivalence(name,(eqv,))
Note: See TracChangeset for help on using the changeset viewer.