Changeset 881


Ignore:
Timestamp:
Apr 4, 2013 5:04:24 PM (9 years ago)
Author:
vondreele
Message:

more RB editing & fixes
'+0' & '-0' (vice versa) removed from any cif import atom names
fix spelling of "Sequential"
begin implementation of 'Omit map"

Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASII.py

    r879 r881  
    21662166        rigidbodyDict = self.PatternTree.GetItemPyData(   
    21672167            G2gd.GetPatternTreeItemId(self,self.root,'Rigid bodies'))
    2168         rbVary,rbDict,rbIds = G2str.GetRigidBodyModels(rigidbodyDict,Print=False)
     2168        rbVary,rbDict = G2str.GetRigidBodyModels(rigidbodyDict,Print=False)
     2169        rbIds = rigidbodyDict.get('RBIds',{'Vector':[],'Residue':[]})
    21692170        Natoms,atomIndx,phaseVary,phaseDict,pawleyLookup,FFtable,BLtable = G2str.GetPhaseData(Phases,RestraintDict=None,rbIds=rbIds,Print=False)       
    21702171        hapVary,hapDict,controlDict = G2str.GetHistogramPhaseData(Phases,Histograms,Print=False)
  • trunk/GSASIIElem.py

    r850 r881  
    8787        num = El[-2]
    8888        El = El.split(num)[0]+'+'+num
     89    if '+0' in El:
     90        El = El.split('+0')[0]
    8991    if '-' in El[-1]:
    9092        num = El[-2]
    9193        El = El.split(num)[0]+'-'+num
     94    if '-0' in El:
     95        El = El.split('-0')[0]
    9296    return El
    9397       
  • trunk/GSASIIconstrGUI.py

    r879 r881  
    628628    Displays the rigid bodies in the data window
    629629    '''
    630     if not data.get('RBId') or not data:
     630    if not data.get('RBIds') or not data:
    631631        data.update({'Vector':{'AtInfo':{}},'Residue':{'AtInfo':{}},
    632             'RBIds':{'Vector':[],'Residue':[]}})       #empty dict - fill it
    633                
     632            'RBIds':{'Vector':[],'Residue':[]}})       #empty/bad dict - fill it
    634633           
    635634    global resList
  • trunk/GSASIIgrid.py

    r880 r881  
    18561856    Rwps = GetRwps()
    18571857    SetDataMenuBar(G2frame,G2frame.dataFrame.SequentialMenu)
    1858     G2frame.dataFrame.SetLabel('Sequental refinement results')
     1858    G2frame.dataFrame.SetLabel('Sequential refinement results')
    18591859    G2frame.dataFrame.CreateStatusBar()
    18601860    G2frame.dataFrame.Bind(wx.EVT_MENU, OnSaveSelSeq, id=wxID_SAVESEQSEL)
     
    20962096            for i in G2frame.SeqRefine: i.Enable(True)
    20972097            UpdateControls(G2frame,data)
    2098         elif G2frame.PatternTree.GetItemText(item) == 'Sequental results':
     2098        elif G2frame.PatternTree.GetItemText(item) == 'Sequential results':
    20992099            data = G2frame.PatternTree.GetItemPyData(item)
    21002100            UpdateSeqResults(G2frame,data)           
  • trunk/GSASIImath.py

    r860 r881  
    198198    return XYZ
    199199
    200 def AtomUij2TLS(atomData,atPtrs,Amat,Bmat,rbObj):
     200def AtomUij2TLS(atomData,atPtrs,Amat,Bmat,rbObj):   #unfinished & not used
    201201    for atom in atomData:
    202202        XYZ = np.inner(Amat,atom[cx:cx+3])
     
    228228            Umat = Tmat+np.inner(Axyz,Smat)+np.inner(Smat.T,Axyz.T)+np.inner(np.inner(Axyz,Lmat),Axyz.T)
    229229            beta = np.inner(np.inner(g,Umat),g)
    230             atom[cia+2:cia+8] = beta/gvec
     230            atom[cia+2:cia+8] = G2spc.U2Uij(beta/gvec)
    231231
    232232def GetXYZDist(xyz,XYZ,Amat):
     
    242242    return np.array(XYZ)
    243243
    244 def UpdateResRBAtoms(Bmat,RBObj,RBData):
    245     RBIds = GetResRBIds(RBData)
    246     RBname = RBObj['RBname'].split(':')[0]
    247     RBRes = RBData[RBIds[RBname]]
    248     XYZ = np.array(RBRes['rbXYZ'])
    249     for tor,seq in zip(RBObj['Torsions'],RBRes['rbSeq']):
    250         QuatA = AVdeg2Q(tor[0],XYZ[seq[0]]-XYZ[seq[1]])
    251         for ride in seq[3]:
    252             XYZ[ride] = prodQVQ(QuatA,XYZ[ride]-XYZ[seq[1]])+XYZ[seq[1]]
    253     for i,xyz in enumerate(XYZ):
    254         xyz = prodQVQ(RBObj['Orient'][0],xyz)
    255         xyz = np.inner(Bmat,xyz)
    256         xyz += RBObj['Orig'][0]
    257         XYZ[i] = xyz
    258     return XYZ
    259    
    260 def UpdateRBAtoms(Bmat,RBObj,RBData,RBType):
    261     RBIds = GetResRBIds(RBData[RBType])
    262     RBname = RBObj['RBname'].split(':')[0]
    263     RBRes = RBData[RBType][RBIds[RBname]]
     244def UpdateRBXYZ(Bmat,RBObj,RBData,RBType):
     245    ''' Returns crystal coordinates for atoms described by RBObj
     246    '''
     247    RBRes = RBData[RBType][RBObj['RBId']]
    264248    if RBType == 'Vector':
    265249        vecs = RBRes['rbVect']
    266250        mags = RBRes['VectMag']
    267         XYZ = np.zeros_like(vecs[0])
     251        Cart = np.zeros_like(vecs[0])
    268252        for vec,mag in zip(vecs,mags):
    269             XYZ += vec*mag
     253            Cart += vec*mag
    270254    elif RBType == 'Residue':
    271         XYZ = np.array(RBRes['rbXYZ'])
     255        Cart = np.array(RBRes['rbXYZ'])
    272256        for tor,seq in zip(RBObj['Torsions'],RBRes['rbSeq']):
    273             QuatA = AVdeg2Q(tor[0],XYZ[seq[0]]-XYZ[seq[1]])
     257            QuatA = AVdeg2Q(tor[0],Cart[seq[0]]-Cart[seq[1]])
    274258            for ride in seq[3]:
    275                 XYZ[ride] = prodQVQ(QuatA,XYZ[ride]-XYZ[seq[1]])+XYZ[seq[1]]
    276     for i,xyz in enumerate(XYZ):
     259                XYZ[ride] = prodQVQ(QuatA,Cart[ride]-Cart[seq[1]])+Cart[seq[1]]
     260    XYZ = np.zeros_like(Cart)
     261    for i,xyz in enumerate(Cart):
    277262        xyz = prodQVQ(RBObj['Orient'][0],xyz)
    278         xyz = np.inner(Bmat,xyz)
    279         xyz += RBObj['Orig'][0]
    280         XYZ[i] = xyz
    281     return XYZ   
    282    
    283 def GetResRBIds(RBData):   
    284     rbKeys = RBData.keys()
    285     rbKeys.remove('AtInfo')
    286     if not len(rbKeys):
    287         return {}
    288     RBNames = [RBData[k]['RBname'] for k in rbKeys]
    289     return dict(zip(RBNames,rbKeys))
     263        XYZ[i] = np.inner(Bmat,xyz)+RBObj['Orig'][0]
     264    return XYZ,Cart
     265   
     266def UpdateRBUIJ(Bmat,Cart,RBObj):
     267    ''' Returns atom I/A, Uiso or UIJ for atoms at XYZ as described by RBObj
     268    '''
     269    TLStype,TLS = RBObj['ThermalMotion'][:2]
     270#    T = TLS[:6]
     271#    L = TLS[6:12]
     272#    S = TLS[12:]
     273#    Uout = []
     274#    for X in Cart:
     275#        U = [0,0,0,0,0,0]
     276#        U[0] = T[0]+L[1]*X[2]**2+L[2]*X[1]**2-2.0*L[5]*X[1]*X[2]+2.0*(S[2]*X[2]-S[4]*X[1])
     277#        U[1] = T[1]+L[0]*X[2]**2+L[2]*X[0]**2-2.0*L[4]*X[0]*X[2]+2.0*(S[5]*X[0]-S[0]*X[2])
     278#        U[2] = T[2]+L[1]*X[0]**2+L[0]*X[1]**2-2.0*L[3]*X[1]*X[0]+2.0*(S[1]*X[1]-S[3]*X[0])
     279#        U[3] = T[3]+L[4]*X[1]*X[2]+L[5]*X[0]*X[2]-L[3]*X[2]**2-L[2]*X[0]*X[1]+
     280#            S[4]*X[0]-S[5]*X[1]-(S[6]+S[7])*X[2]
     281#        U[4] = T[4]+L[3]*X[1]*X[2]+L[5]*X[0]*X[1]-L[4]*X[1]**2-L[1]*X[0]*X[2]+
     282#            S[3]*X[2]-S[2]*X[0]+S[6]*X[1]
     283#        U[5] = T[5]+L[3]*X[0]*X[2]+L[4]*X[0]*X[1]-L[5]*X[0]**2-L[0]*X[2]*X[1]+
     284#            S[0]*X[1]-S[1]*X[2]+S[7]*X[0]
     285#        UIJ = G2lat.U6toUij(U)
     286#        Uout.append(
     287   
     288    Tmat = np.zeros((3,3))
     289    Lmat = np.zeros((3,3))
     290    Smat = np.zeros((3,3))
     291    if 'T' in TLStype:
     292        Tmat = G2lat.U6toUij(TLS[:6])
     293    if 'L' in TLStype:
     294        Lmat = np.array(G2lat.U6toUij(TLS[6:12]))*(np.pi/180.)**2
     295    if 'S' in TLStype:
     296        Smat = np.array([[TLS[18],TLS[12],TLS[13]],[TLS[14],TLS[19],TLS[15]],[TLS[16],TLS[17],0]])*(np.pi/180.)
     297    g = np.inner(Bmat,Bmat.T)
     298    gvec = 1./np.sqrt(np.array([g[0][0]**2,g[1][1]**2,g[2][2]**2,
     299        g[0][0]*g[1][1],g[0][0]*g[2][2],g[1][1]*g[2][2]]))
     300    Uout = []
     301    for X in Cart:
     302        print 'X: ',X
     303        Axyz = np.array([[0,X[2],-X[1]], [-X[2],0,X[0]], [X[1],-X[0],0]])
     304        if 'U' in TLStype:
     305            Uout.append(['I',TLS[0],0,0,0,0,0,0])
     306        else:
     307            Umat = Tmat+np.inner(Axyz,Smat)+np.inner(Smat.T,Axyz.T)+np.inner(np.inner(Axyz,Lmat),Axyz.T)
     308            print 'Umat: ',Umat
     309            beta = np.inner(np.inner(g,Umat),g)
     310            Uout.append(['A',0.0,]+list(G2lat.UijtoU6(beta)*gvec))
     311    return Uout
    290312   
    291313def GetSHCoeff(pId,parmDict,SHkeys):
     
    852874        Hmax[1] = ((Hmax[1]+2)/4)*4
    853875        Hmax[2] = ((Hmax[2]+1)/4)*4
     876
     877def OmitMap(data,reflData):
     878    generalData = data['General']
     879    if not generalData['Map']['MapType']:
     880        print '**** ERROR - Fourier map not defined'
     881        return
     882    mapData = generalData['Map']
     883    dmin = mapData['Resolution']
     884    SGData = generalData['SGData']
     885    cell = generalData['Cell'][1:8]       
     886    A = G2lat.cell2A(cell[:6])
     887    Hmax = np.asarray(G2lat.getHKLmax(dmin,SGData,A),dtype='i')+1
     888    adjHKLmax(SGData,Hmax)
     889    Fhkl = np.zeros(shape=2*Hmax,dtype='c16')
     890    time0 = time.time()
     891    for ref in reflData:
     892        if ref[4] >= dmin:
     893            Fosq,Fcsq,ph = ref[8:11]
     894            for i,hkl in enumerate(ref[11]):
     895                hkl = np.asarray(hkl,dtype='i')
     896                dp = 360.*ref[12][i]
     897                a = cosd(ph+dp)
     898                b = sind(ph+dp)
     899                phasep = complex(a,b)
     900                phasem = complex(a,-b)
     901                F = np.sqrt(Fosq)
     902                h,k,l = hkl+Hmax
     903                Fhkl[h,k,l] = F*phasep
     904                h,k,l = -hkl+Hmax
     905                Fhkl[h,k,l] = F*phasem
     906    rho = fft.fftn(fft.fftshift(Fhkl))/cell[6]
     907    print 'NB: this is just an Fobs map for now - under development'
     908    print 'Omit map time: %.4f'%(time.time()-time0),'no. elements: %d'%(Fhkl.size)
     909    print rho.shape
     910    mapData['rho'] = np.real(rho)
     911    mapData['rhoMax'] = max(np.max(mapData['rho']),-np.min(mapData['rho']))
     912    return mapData
    854913
    855914def FourierMap(data,reflData):
  • trunk/GSASIIphsGUI.py

    r880 r881  
    498498            if 'cutOff' not in Map:
    499499                Map['cutOff'] = 100.0
    500             mapTypes = ['Fobs','Fcalc','delt-F','2*Fo-Fc','Patterson']
     500            mapTypes = ['Fobs','Fcalc','delt-F','2*Fo-Fc','Omit','Patterson']
    501501            refList = data['Histograms'].keys()
    502502            if not generalData['AtomTypes']:
     
    31593159                    RBObj['Orig'][0][item] = val
    31603160                    Obj.SetValue('%8.5f'%(val))
    3161                     newXYZ = G2mth.UpdateRBAtoms(Bmat,RBObj,RBData,rbType)
     3161                    newXYZ = G2mth.UpdateRBXYZ(Bmat,RBObj,RBData,rbType)[0]
    31623162                    for i,id in enumerate(RBObj['Ids']):
    31633163                        data['Atoms'][AtLookUp[id]][cx:cx+3] = newXYZ[i]
     
    31853185                        raise ValueError
    31863186                    RBObj['Orient'][0] = Q
    3187                     newXYZ = G2mth.UpdateRBAtoms(Bmat,RBObj,RBData,rbType)
     3187                    newXYZ = G2mth.UpdateRBXYZ(Bmat,RBObj,RBData,rbType)[0]
    31883188                    for i,id in enumerate(RBObj['Ids']):
    31893189                        data['Atoms'][AtLookUp[id]][cx:cx+3] = newXYZ[i]
     
    32403240                    val = float(Obj.GetValue())
    32413241                    RBObj['Torsions'][item][0] = val
    3242                     newXYZ = G2mth.UpdateResRBAtoms(Bmat,RBObj,RBData['Residue'])
     3242                    newXYZ = G2mth.UpdateRBXYZ(Bmat,RBObj,RBData,'Residue')[0]
    32433243                    for i,id in enumerate(RBObj['Ids']):
    32443244                        data['Atoms'][AtLookUp[id]][cx:cx+3] = newXYZ[i]
     
    33973397            sel = dlg.GetSelections()
    33983398            for x in sel:
    3399                 RBObjs[x].update(sourceRB)
     3399                RBObjs[x].update(copy.copy(sourceRB))
    34003400        G2plt.PlotStructure(G2frame,data)
    34013401        wx.CallAfter(FillRigidBodyGrid(True))
     
    34313431                rbObj = data['testRBObj']['rbObj']
    34323432                rbId = rbObj['RBId']
    3433                 newXYZ = G2mth.UpdateRBAtoms(Bmat,rbObj,RBData,rbType)
     3433                newXYZ = G2mth.UpdateRBXYZ(Bmat,rbObj,RBData,rbType)[0]
    34343434                Ids = []
    34353435                dmax = 0.0
     
    37843784            data['RBModels']['Residue'] = RBObjs
    37853785            for RBObj in RBObjs:
    3786                 newXYZ = G2mth.UpdateResRBAtoms(Bmat,RBObj,RBData['Residue'])
     3786                newXYZ = G2mth.UpdateRBXYZ(Bmat,RBObj,RBData,'Residue')[0]
    37873787                for i,id in enumerate(RBObj['Ids']):
    37883788                    data['Atoms'][AtLookUp[id]][cx:cx+3] = newXYZ[i]
     
    41774177            PatternId = G2gd.GetPatternTreeItemId(G2frame,G2frame.root, reflName)
    41784178            reflData = G2frame.PatternTree.GetItemPyData(PatternId)[1]
    4179         mapData.update(G2mth.FourierMap(data,reflData))
     4179        if mapData['MapType'] == 'Omit':
     4180            mapData.update(G2mth.OmitMap(data,reflData))
     4181        else:
     4182            mapData.update(G2mth.FourierMap(data,reflData))
    41804183        mapData['Flip'] = False
    41814184        mapSig = np.std(mapData['rho'])
     
    43164319            G2frame.dataFrame.Bind(wx.EVT_MENU, OnReloadDrawAtoms, id=G2gd.wxID_RELOADDRAWATOMS)
    43174320            G2frame.dataFrame.Bind(wx.EVT_MENU, OnDistAngle, id=G2gd.wxID_ATOMSDISAGL)
    4318             for id in G2frame.dataFrame.ReImportMenuId:
     4321            for id in G2frame.dataFrame.ReImportMenuId:     #loop over submenu items
    43194322                G2frame.dataFrame.Bind(wx.EVT_MENU, OnReImport, id=id)
    43204323           
  • trunk/GSASIIstruct.py

    r879 r881  
    131131        return 'Error: no diffraction data',''
    132132    rigidbodyDict = GetRigidBodies(GPXfile)
    133     rbVary,rbDict,rbIds = GetRigidBodyModels(rigidbodyDict,Print=False)
     133    rbIds = rigidbodyDict.get('RBIds',{'Vector':[],'Residue':[]})
     134    rbVary,rbDict = GetRigidBodyModels(rigidbodyDict,Print=False)
    134135    Natoms,atomIndx,phaseVary,phaseDict,pawleyLookup,FFtables,BLtables = GetPhaseData(Phases,RestraintDict=None,rbIds=rbIds,Print=False)
    135136    hapVary,hapDict,controlDict = GetHistogramPhaseData(Phases,Histograms,Print=False)
     
    396397            break
    397398        datum = data[0]
    398         if datum[0] == 'Sequental results':
     399        if datum[0] == 'Sequential results':
    399400            data[0][1] = SeqResult
    400401        try:
     
    589590                    print >>pFile,'\nResidue rigid body model:'
    590591                    PrintResRBModel(rigidbodyDict['Residue'][item])
    591     return rbVary,rbDict,rbIds
     592    return rbVary,rbDict
     593   
     594def ApplyRBModels(parmDict,Phases,rigidbodyDict):
     595    ''' Takes RB info from RBModels in Phase and RB data in rigidbodyDict along with
     596    current RB values in parmDict & modifies atom contents (xyz & Uij) of parmDict
     597    '''
     598    RBIds = rigidbodyDict['RBIds']
     599    if not RBIds['Vector'] and not RBIds['Residue']:
     600        return
     601    RBData = copy.deepcopy(rigidbodyDict)     # don't mess with original!
     602    if RBIds['Vector']:                       # first update the vector magnitudes
     603        VRBIds = RBIds['Vector']
     604        VRBData = RBData['Vector']
     605        for i,rbId in enumerate(VRBIds):
     606            pfxRB = '::RBV;'+str(i)+':'
     607            for j in range(len(VRBData[rbId]['VectMag'])):
     608                VRBData[rbId]['VectMag'][j] = parmDict[pfxRB+str(j)]
     609    for phase in Phases:
     610        Phase = Phases[phase]
     611        General = Phase['General']
     612        cell = General['Cell'][1:7]
     613        Amat,Bmat = G2lat.cell2AB(cell)
     614        AtLookup = G2mth.FillAtomLookUp(Phase['Atoms'])
     615        pId = Phase['pId']
     616        RBModels =  copy.deepcopy(Phase['RBModels']) # again don't mess with original!
     617        for irb,RBObj in enumerate(RBModels['Vector']):
     618            print irb,RBObj
     619           
     620            XYZ,Cart = G2mth.UpdateRBXYZ(Bmat,RBObj,RBData,'Vector')
     621            for x in XYZ: print x
     622            UIJ = G2mth.UpdateRBUIJ(Bmat,Cart,RBObj)
     623            for u in UIJ: print u
     624           
     625        for irb,RBObj in enumerate(RBModels['Residue']):
     626            print irb,RBObj
     627           
     628           
     629       
     630            XYZ = G2mth.UpdateRBXYZ(Bmat,RBObj,RBData,'Residue')
     631            UIJ = G2mth.UpdateRBUIJ(Amat,XYZ,RBObj)
     632           
     633    raise Exception
     634
    592635       
    593636################################################################################
     
    737780        print >>pFile,ptstr
    738781       
    739     def MakeRBParms():
     782    def MakeRBParms(rbKey):
    740783        rbid = str(rbids.index(RB['RBId']))
    741         pfxRB = pfx+'RBP'
     784        pfxRB = pfx+'RB'+rbKey+'P'
    742785        pstr = ['x','y','z']
    743786        ostr = ['a','i','j','k']
     
    747790            if RB['Orig'][1]:
    748791                phaseVary += [name,]
    749         pfxRB = pfx+'RBO'
     792        pfxRB = pfx+'RB'+rbKey+'O'
    750793        for i in range(4):
    751794            name = pfxRB+ostr[i]+':'+str(iRB)+':'+rbid
     
    756799                phaseVary += [name,]
    757800           
    758     def MakeRBThermals():
     801    def MakeRBThermals(rbKey):
    759802        rbid = str(rbids.index(RB['RBId']))
    760803        tlstr = ['11','22','33','12','13','23']
    761804        sstr = ['12','13','21','23','31','32','AA','BB']
    762805        if 'T' in RB['ThermalMotion'][0]:
    763             pfxRB = pfx+'RBT'
     806            pfxRB = pfx+'RB'+rbKey+'T'
    764807            for i in range(6):
    765808                name = pfxRB+tlstr[i]+':'+str(iRB)+':'+rbid
     
    768811                    phaseVary += [name,]
    769812        if 'L' in RB['ThermalMotion'][0]:
    770             pfxRB = pfx+'RBL'
     813            pfxRB = pfx+'RB'+rbKey+'L'
    771814            for i in range(6):
    772815                name = pfxRB+tlstr[i]+':'+str(iRB)+':'+rbid
     
    775818                    phaseVary += [name,]
    776819        if 'S' in RB['ThermalMotion'][0]:
    777             pfxRB = pfx+'RBS'
     820            pfxRB = pfx+'RB'+rbKey+'S'
    778821            for i in range(5):
    779822                name = pfxRB+sstr[i]+':'+str(iRB)+':'+rbid
     
    782825                    phaseVary += [name,]
    783826        if 'U' in RB['ThermalMotion'][0]:
    784             name = pfx+'RBU:'+str(iRB)+':'+rbid
     827            name = pfx+'RB'+rbKey+'U:'+str(iRB)+':'+rbid
    785828            phaseDict[name] = RB['ThermalMotion'][1][0]
    786829            if RB['ThermalMotion'][2][0]:
    787830                phaseVary += [name,]
    788831               
    789     def MakeRBTorsions():
     832    def MakeRBTorsions(rbKey):
    790833        rbid = str(rbids.index(RB['RBId']))
    791         pfxRB = pfx+'RBTr;'
     834        pfxRB = pfx+'RB'+rbKey+'Tr;'
    792835        for i,torsion in enumerate(RB['Torsions']):
    793836            name = pfxRB+str(i)+':'+str(iRB)+':'+rbid
     
    831874        resRBData = PhaseData[name]['RBModels'].get('Residue',[])
    832875        if resRBData:
    833             rbids = rbIds['Residue']
     876            rbids = rbIds['Residue']    #NB: used in the MakeRB routines
    834877            for iRB,RB in enumerate(resRBData):
    835                 MakeRBParms()
    836                 MakeRBThermals()
    837                 MakeRBTorsions()
     878                MakeRBParms('R')
     879                MakeRBThermals('R')
     880                MakeRBTorsions('R')
    838881       
    839882        vecRBData = PhaseData[name]['RBModels'].get('Vector',[])
    840883        if vecRBData:
    841             rbids = rbIds['Vector']
     884            rbids = rbIds['Vector']    #NB: used in the MakeRB routines
    842885            for iRB,RB in enumerate(vecRBData):
    843                 MakeRBParms()
    844                 MakeRBThermals()
     886                MakeRBParms('V')
     887                MakeRBThermals('V')
    845888                   
    846889        Natoms[pfx] = 0
     
    37343777    SumwYo = 0
    37353778    Nobs = 0
     3779    ApplyRBModels(parmdict,Phases,rigidbodyDict)
    37363780    histoList = Histograms.keys()
    37373781    histoList.sort()
     
    37773821            A = [parmdict[pfx+'A%d'%(i)] for i in range(6)]
    37783822            G,g = G2lat.A2Gmat(A)       #recip & real metric tensors
    3779 #apply RB models to atom parms in parmDict?
    37803823            refList = Histogram['Data']
    37813824            refList = StructureFactor(refList,G,hfx,pfx,SGData,calcControls,parmdict)
     
    38703913        raise Exception       
    38713914    rigidbodyDict = GetRigidBodies(GPXfile)
    3872     rbVary,rbDict,rbIds = GetRigidBodyModels(rigidbodyDict,pFile=printFile)
     3915    rbIds = rigidbodyDict.get('RBIds',{'Vector':[],'Residue':[]})
     3916    rbVary,rbDict = GetRigidBodyModels(rigidbodyDict,pFile=printFile)
    38733917    Natoms,atomIndx,phaseVary,phaseDict,pawleyLookup,FFtables,BLtables = GetPhaseData(Phases,restraintDict,rbIds,pFile=printFile)
    38743918    calcControls['atomIndx'] = atomIndx
     
    38763920    calcControls['FFtables'] = FFtables
    38773921    calcControls['BLtables'] = BLtables
    3878     calcControls['rbIDs'] = rbIds
    38793922    hapVary,hapDict,controlDict = GetHistogramPhaseData(Phases,Histograms,pFile=printFile)
    38803923    calcControls.update(controlDict)
     
    40324075        raise Exception
    40334076    rigidbodyDict = GetRigidBodies(GPXfile)
    4034     rbVary,rbDict,rbIds = GetRigidBodyModels(rigidbodyDict,pFile=printFile)
     4077    rbIds = rigidbodyDict.get('RBIds',{'Vector':[],'Residue':[]})
     4078    rbVary,rbDict = GetRigidBodyModels(rigidbodyDict,pFile=printFile)
    40354079    Natoms,atomIndx,phaseVary,phaseDict,pawleyLookup,FFtables,BLtables = GetPhaseData(Phases,restraintDict,rbIds,False,printFile)
    40364080    for item in phaseVary:
     
    40564100        calcControls['FFtables'] = FFtables
    40574101        calcControls['BLtables'] = BLtables
    4058         calcControls['rbIDs'] = rbIds
    40594102        varyList = []
    40604103        parmDict = {}
Note: See TracChangeset for help on using the changeset viewer.