Changeset 1058
 Timestamp:
 Sep 18, 2013 12:17:34 PM (10 years ago)
 Location:
 trunk
 Files:

 2 edited
Legend:
 Unmodified
 Added
 Removed

trunk/GSASIImath.py
r1056 r1058 2563 2563 Cart = np.array(RBRes['rbXYZ']) 2564 2564 for itor,seq in enumerate(RBRes['rbSeq']): 2565 tName = pfx+'Tor'+str(itor) 2566 QuatA = AVdeg2Q(parmDict[tName],Cart[seq[0]]Cart[seq[1]]) 2565 QuatA = AVdeg2Q(parmDict[pfx+'Tor'+str(itor)],Cart[seq[0]]Cart[seq[1]]) 2567 2566 for ride in seq[3]: 2568 2567 Cart[ride] = prodQVQ(QuatA,Cart[ride]Cart[seq[1]])+Cart[seq[1]] … … 2630 2629 ''' 2631 2630 global tsum 2631 parmDict.update(dict(zip(varyList,values))) #update parameter tables 2632 2632 t0 = time.time() 2633 parmDict.update(dict(zip(varyList,values))) #update parameter tables2634 2633 Xdata = GetAtomTX(RBdata,parmDict)[1] #get new atom coords from RB 2634 tsum += (time.time()t0) 2635 2635 allX = getAllX(Xdata,SGM,SGT) #fill unit cell  dups. OK 2636 2636 MDval = parmDict['0:MDval'] #get MarchDollase coeff … … 2649 2649 refList[6] = refList[4]refList[5] 2650 2650 M = np.inner(refList[6],np.inner(rcov,refList[6])) 2651 tsum += (time.time()t0)2652 2651 # print M,parmDict['sumFosq'],np.sum(refList[6]**2),np.sum(refList[4]**2) 2653 2652 # print np.sum(refList[6]**2)/np.sum(refList[4]**2) … … 2732 2731 rcov /= Rnorm 2733 2732 elif 'Pawley' in reflName: #need a bail out if Pawley cov matrix doesn't exist. 2734 covMatrix = covData['covMatrix']2735 2733 vList = covData['varyList'] 2736 2734 for iref,refI in enumerate(reflData): … … 2743 2741 nRef = len(refs) 2744 2742 pfx = str(data['pId'])+'::PWLref:' 2745 rcov = np.zeros((nRef,nRef)) 2746 for iref,refI in enumerate(refs): 2747 I = refI[5] 2748 nameI = pfx+str(I) 2749 if nameI in vList: 2750 Iindx = vList.index(nameI) 2751 rcov[iref][iref] = covMatrix[Iindx][Iindx] 2752 for jref,refJ in enumerate(refs[:iref]): 2753 J = refJ[5] 2754 nameJ = pfx+str(J) 2755 try: 2756 rcov[iref][jref] = covMatrix[vList.index(nameI)][vList.index(nameJ)] 2757 except ValueError: 2758 rcov[iref][jref] = rcov[iref][jref1] 2759 else: 2760 rcov[iref] = rcov[iref1] 2761 rcov[iref][iref] = rcov[iref1][iref1] 2762 rcov += (rcov.Tnp.diagflat(np.diagonal(rcov))) 2763 Rdiag = np.sqrt(np.diag(rcov)) 2764 Rnorm = np.outer(Rdiag,Rdiag) 2765 rcov /= Rnorm 2743 if covData['freshCOV'] and generalData['doPawley']: 2744 covMatrix = covData['covMatrix'] 2745 rcov = np.zeros((nRef,nRef)) 2746 for iref,refI in enumerate(refs): 2747 I = refI[5] 2748 nameI = pfx+str(I) 2749 if nameI in vList: 2750 Iindx = vList.index(nameI) 2751 rcov[iref][iref] = covMatrix[Iindx][Iindx] 2752 for jref,refJ in enumerate(refs[:iref]): 2753 J = refJ[5] 2754 nameJ = pfx+str(J) 2755 try: 2756 rcov[iref][jref] = covMatrix[vList.index(nameI)][vList.index(nameJ)] 2757 except ValueError: 2758 rcov[iref][jref] = rcov[iref][jref1] 2759 else: 2760 rcov[iref] = rcov[iref1] 2761 rcov[iref][iref] = rcov[iref1][iref1] 2762 rcov += (rcov.Tnp.diagflat(np.diagonal(rcov))) 2763 Rdiag = np.sqrt(np.diag(rcov)) 2764 Rnorm = np.outer(Rdiag,Rdiag) 2765 rcov /= Rnorm 2766 MCSA['rcov'] = rcov 2767 covData['freshCOV'] = False 2768 else: 2769 rcov = MCSA['rcov'] 2766 2770 elif 'HKLF' in reflName: 2767 2771 for ref in reflData: 
trunk/GSASIIstrMain.py
r1028 r1058 179 179 'varyListStart':varyListStart, 180 180 'covMatrix':covMatrix,'title':GPXfile,'newAtomDict':newAtomDict, 181 'newCellDict':newCellDict }181 'newCellDict':newCellDict,'freshCOV':True} 182 182 # add the uncertainties into the esd dictionary (sigDict) 183 183 sigDict.update(G2mv.ComputeDepESD(covMatrix,varyList,parmDict))
Note: See TracChangeset
for help on using the changeset viewer.