Changeset 1531


Ignore:
Timestamp:
Oct 21, 2014 12:28:29 PM (9 years ago)
Author:
vondreele
Message:

fix getVCOV; nonexistant parms return zero.
fix space group output in PrintDistAngle?

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIImath.py

    r1513 r1531  
    188188                vcov[i1][i2] = covMatrix[varyList.index(name1)][varyList.index(name2)]
    189189            except ValueError:
    190                 if i1 == i2:
    191                     vcov[i1][i2] = 1.0
    192                 else:
    193                     vcov[i1][i2] = 0.0
     190                vcov[i1][i2] = 0.0
     191#                if i1 == i2:
     192#                    vcov[i1][i2] = 1e-20
     193#                else:
     194#                    vcov[i1][i2] = 0.0
    194195    return vcov
    195196
  • trunk/GSASIIspc.py

    r1530 r1531  
    515515        elif SGData['SGPtGrp'] == '2/m':    #OK
    516516            if mod in ['a00','0b0','00g']:
    517                 return SGData['SSGKl']
     517                return SGData['SSGKl'][:]
    518518            else:
    519519                return [i*-1 for i in SGData['SSGKl']]
     
    547547    def genSSGOps():
    548548        SSGOps = SSGData['SSGOps']
    549         SSGKl = SGData['SSGKl']
    550         print 'genQ',genQ
    551         print 'SSGKl',SSGKl
    552549        iFrac = {}
    553550        for i,frac in enumerate(SSGData['modSymb']):
    554551            if frac in ['1/2','1/3','1/4','1/6','1']:
    555552                iFrac[i] = frac
     553        print SSymbol
     554        print 'SSGKl',SSGKl,'genQ',genQ,'iFrac',iFrac
    556555# set identity & 1,-1; triclinic
    557556        SSGOps[0][0][3,3] = 1.
     557# expand if centrosymmetric
     558        if SGData['SGInv']:
     559            SSGOps = SSGOps[:] + [[-1*M,V] for M,V in SSGOps]
    558560# monoclinic
    559561        if SGData['SGPtGrp'] in ['2','m']:  #OK
     
    568570                    SSGOps[1][0][3,i] *= -1
    569571        elif SGData['SGPtGrp'] == '2/m':    #OK
    570             SSGOps[1][0][3,3] = SSGKl[1]
     572            SSGOps[1][0][3,3] = -SSGKl[0]
     573            SSGOps[3][0][3,3] = -SSGKl[1]
    571574            for i in iFrac:
    572575                SSGOps[1][0][3,i] = -1
     
    587590                SSGOps[1][0][3,1] = 1
    588591        elif SGData['SGPtGrp'] in ['4/m',]:
    589             SSGOps[1][0][3,3] = -SSGKl[1]
     592            SSGOps[1][0][3,3] = SSGKl[0]
     593            SSGOps[5][0][3,3] = SSGKl[1]
    590594            SSGOps[1][1][3] = genQ[0]
    591595            if '1/2' in SSGData['modSymb']:
     
    642646                SSGOps[11][0][3,3] = -SSGKl[3]
    643647                SSGOps[11][1][3] = genQ[3]
    644         if SGData['SGInv']:
    645             SSGfull = SSGOps[:]
    646             for M,V in SSGOps:
    647                 Mi = -1*M
    648                 SSGfull.append([Mi,V])
    649             SSGOps = SSGfull
    650648        if SGData['SGPtGrp'] in ['1','-1']: #triclinic - done
    651649            return True,SSGOps
     
    660658                        continue
    661659                    elif np.allclose(OpC[0][:3,:3],OpD[0][:3,:3]):
    662                         if np.any([np.allclose(OpC[0][3][:3],cen) for cen in SGData['SGCen']]):
    663 #                        if np.allclose(OpC[0][3],np.zeros(4)):
     660                        if np.allclose(OpD[0][3],np.zeros(4)):
     661                            SSGOps[k] = OpC
     662                        elif np.any([np.allclose(OpC[0][3][:3],cen) for cen in SGData['SGCen']]):   #?
    664663                            continue
    665                         elif np.allclose(OpD[0][3],np.zeros(4)):
    666                             SSGOps[k] = OpC
    667664                        else:
    668                             print 'OpC',SSMT2text(OpC),'OpD',SSMT2text(OpD)
    669                             return False,None
     665                            OpCtxt = SSMT2text(OpC).strip()
     666                            OpDtxt = SSMT2text(OpD).strip()
     667                            print 'OpC',OpCtxt,'OpD',OpDtxt
     668                            return False,OpCtxt+' conflict with '+OpDtxt
    670669        return True,SSGOps
    671670                   
     
    687686    Fracs = {'1/2':0.5,'1/3':1./3,'1':1.0,'0':0.,'s':.5,'t':1./3,'q':.25,'h':1./6,'a':0.,'b':0.,'g':0.}
    688687    LaueId = LaueList.index(SGData['SGLaue'])
    689     if LaueId in [12,13,]:
     688    if SGData['SGLaue'] in ['m3','m3m']:
    690689        return '(3+1) superlattices not defined for cubic space groups',None
    691     elif LaueId in [5,6,]:
     690    elif SGData['SGLaue'] in ['3R','3mR']:
    692691        return '(3+1) superlattices not defined for rhombohedral settings - use hexagonal setting',None
    693692    try:
     
    704703        return 'Modulation '+''.join(modsym)+' not consistent with space group '+SGData['SpGrp'],None
    705704    modQ = [Fracs[mod] for mod in modsym]
    706     if LaueId in [1,2]:
    707         SGData['SSGKl'] = fixMonoOrtho()
     705    SSGKl = SGData['SSGKl'][:]
     706    if SGData['SGLaue'] in ['2/m','mmm']:
     707        SSGKl = fixMonoOrtho()
    708708    genQ = [Fracs[mod] for mod in gensym]
    709     if len(gensym) and len(gensym) != len(SGData['SSGKl']):
     709    if len(gensym) and len(gensym) != len(SSGKl):
    710710        return 'Wrong number of items in generator symbol '+''.join(gensym),None
    711711    genQ = getTau()
     
    722722        T[:3] = op[1]
    723723        SSGData['SSGOps'].append([ssop,T])
    724     E,SSGOps = genSSGOps()
     724    E,Result = genSSGOps()
    725725    if E:
    726         SSGData['SSGOps'] = SSGOps                     
     726        SSGData['SSGOps'] = Result                     
    727727        return None,SSGData
    728728    else:
    729         return 'Operator conflict - incorrect superspace symbol',None
     729        return Result+'\nOperator conflict - incorrect superspace symbol',None
    730730
    731731def SSGPrint(SGData,SSGData):
  • trunk/GSASIIstrMain.py

    r1493 r1531  
    552552    ShowBanner(DisAglCtls['Name'])
    553553    SGData = DisAglData['SGData']
    554     SGtext = G2spc.SGPrint(SGData)
     554    SGtext,SGtable = G2spc.SGPrint(SGData)
    555555    for line in SGtext: MyPrint(line)
     556    if len(SGtable):
     557        for i,item in enumerate(SGtable[::2]):
     558            line = ' %s %s'%(item.ljust(30),SGtable[2*i+1].ljust(30))
     559            MyPrint(line)   
     560    else:
     561        MyPrint(' ( 1)    %s'%(SGtable[0]))
    556562    Cell = DisAglData['Cell']
    557563   
Note: See TracChangeset for help on using the changeset viewer.