Changeset 744
- Timestamp:
- Aug 29, 2012 6:48:02 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIphsGUI.py
r738 r744 3843 3843 FWHM = max(0.001,G2pwd.getFWHM(pos,Inst))/2. 3844 3844 dx = xdata[0][indx+1]-xdata[0][indx] 3845 ref[6] = FWHM*xdata[1][indx] /dx3845 ref[6] = FWHM*xdata[1][indx]*cosd(pos/2.)**3/dx 3846 3846 Lorenz = 1./(2.*sind(xdata[0][indx]/2.)**2*cosd(xdata[0][indx]/2.)) #Lorentz correction 3847 3847 pola,dIdPola = G2pwd.Polarization(Inst['Polariz.'],xdata[0][indx],Inst['Azimuth']) -
trunk/GSASIIstruct.py
r743 r744 954 954 print >>pFile,sigstr 955 955 956 General['Mass'] = 0. 956 957 if Phase['General'].get('doPawley'): 957 958 pawleyRef = Phase['Pawley ref'] … … 965 966 else: 966 967 atomsSig = {} 967 General['Mass'] = 0.968 968 if General['Type'] == 'nuclear': 969 969 for i,at in enumerate(Atoms): … … 2652 2652 try: 2653 2653 pInd =pfx+'PWLref:%d'%(pawleyLookup[pfx+'%d,%d,%d'%(h,k,l)]) 2654 #parmDict[pInd] = max(parmDict[pInd]/2.,parmDict[pInd])2654 parmDict[pInd] = max(parmDict[pInd]/2.,parmDict[pInd]) 2655 2655 refl[9] = parmDict[pInd] 2656 2656 except KeyError: … … 2805 2805 dMdpw[iBeg:iFin] = dervDict['int']/refl[9] 2806 2806 if parmDict[pIdx] < 0.: 2807 dMdpw[iBeg:iFin] = dervDict['int']/refl[9]2807 dMdpw[iBeg:iFin] = 2.*dervDict['int']/refl[9] 2808 2808 if Ka2: 2809 2809 dMdpw[iBeg2:iFin2] += dervDict2['int']/refl[9] 2810 2810 if parmDict[pIdx] < 0.: 2811 dMdpw[iBeg2:iFin2] += dervDict['int']/refl[9]2811 dMdpw[iBeg2:iFin2] += 2.*dervDict['int']/refl[9] 2812 2812 dMdv[idx] = dMdpw 2813 2813 except: # ValueError: … … 3011 3011 xB = np.searchsorted(x,Limits[0]) 3012 3012 xF = np.searchsorted(x,Limits[1]) 3013 dMdvh = np.sqrt(W[xB:xF])*getPowderProfileDerv(parmdict,x[xB:xF],3013 dMdvh = getPowderProfileDerv(parmdict,x[xB:xF], 3014 3014 varylist,Histogram,Phases,calcControls,pawleyLookup) 3015 Wt = np.sqrt(W[xB:xF])[np.newaxis,:] 3016 Dy = dy[xB:xF][np.newaxis,:] 3017 print 'Jacobian size: ',dMdvh.shape 3018 dMdvh *= Wt 3015 3019 if dlg: 3016 3020 dlg.Update(Histogram['wR'],newmsg='Hessian for histogram %d\nAll data Rw=%8.3f%s'%(hId,Histogram['wR'],'%'))[0] 3017 3021 if len(Hess): 3018 Vec += np.sum(dMdvh*np.sqrt(W[xB:xF])*dy[xB:xF],axis=1)3019 3022 Hess += np.inner(dMdvh,dMdvh) 3023 dMdvh *= Wt*Dy 3024 Vec += np.sum(dMdvh,axis=1) 3020 3025 else: 3021 Vec = np.sum(dMdvh*np.sqrt(W[xB:xF])*dy[xB:xF],axis=1)3022 3026 Hess = np.inner(dMdvh,dMdvh) 3027 dMdvh *= Wt*Dy 3028 Vec = np.sum(dMdvh,axis=1) 3023 3029 elif 'HKLF' in histogram[:4]: 3024 3030 Histogram = Histograms[histogram] … … 3184 3190 GoOn = dlg.Update(Rw,newmsg='%s%8.3f%s'%('All data Rw =',Rw,'%'))[0] 3185 3191 if not GoOn: 3186 parm Dict['saved values'] = values3192 parmdict['saved values'] = values 3187 3193 raise Exception #Abort!! 3188 3194 # pFunc = penaltyFxn(parmdict,varylist)
Note: See TracChangeset
for help on using the changeset viewer.