Changeset 4547 for trunk/GSASIImath.py
- Timestamp:
- Aug 18, 2020 12:46:54 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIImath.py
r4542 r4547 3389 3389 Mmap = np.reshape(np.sum((Dang)**2,axis=1),newshape=steps)/len(DH) 3390 3390 hist,bins = np.histogram(Mmap,bins=1000) 3391 # for i,item in enumerate(hist[:10]):3392 # print item,bins[i]3393 3391 chisq = np.min(Mmap) 3394 3392 DX = -np.array(np.unravel_index(np.argmin(Mmap),Mmap.shape)) 3395 G2fil.G2Print (' map offset chi**2: %.3f, map offset: %d %d %d'%(chisq,DX[0],DX[1],DX[2]))3396 # print (np.dot(DX,DH.T)+.5)%1.-Dphi 3397 return DX 3393 ptext = ' map offset chi**2: %.3f, map offset: %d %d %d'%(chisq,DX[0],DX[1],DX[2]) 3394 G2fil.G2Print(ptext) 3395 return DX,ptext 3398 3396 3399 3397 def ChargeFlip(data,reflDict,pgbar): … … 3488 3486 G2fil.G2Print (' Charge flip time: %.4f'%(time.time()-time0),'no. elements: %d'%(Ehkl.size)) 3489 3487 CErho = np.real(fft.fftn(fft.fftshift(CEhkl)))/10. #? to get on same scale as e-map 3490 G2fil.G2Print (' No.cycles = %d Residual Rcf =%8.3f%s Map size: %s'%(Ncyc,Rcf,'%',str(CErho.shape))) 3491 roll = findOffset(SGData,A,CEhkl) #CEhkl needs to be just the observed set, not the full set! 3488 ctext = ' No.cycles = %d Residual Rcf =%8.3f%s Map size: %s'%(Ncyc,Rcf,'%',str(CErho.shape)) 3489 G2fil.G2Print (ctext) 3490 roll,ptext = findOffset(SGData,A,CEhkl) #CEhkl needs to be just the observed set, not the full set! 3492 3491 3493 3492 mapData['Rcf'] = Rcf … … 3496 3495 mapData['minmax'] = [np.max(mapData['rho']),np.min(mapData['rho'])] 3497 3496 mapData['Type'] = reflDict['Type'] 3498 return mapData,twophases 3497 return mapData,twophases,ptext,ctext 3499 3498 3500 3499 def findSSOffset(SGData,SSGData,A,Fhklm): … … 3555 3554 Mmap = np.reshape(np.sum((Dang)**2,axis=1),newshape=steps)/len(DH) 3556 3555 hist,bins = np.histogram(Mmap,bins=1000) 3557 # for i,item in enumerate(hist[:10]):3558 # print item,bins[i]3559 3556 chisq = np.min(Mmap) 3560 3557 DX = -np.array(np.unravel_index(np.argmin(Mmap),Mmap.shape)) 3561 G2fil.G2Print (' map offset chi**2: %.3f, map offset: %d %d %d %d'%(chisq,DX[0],DX[1],DX[2],DX[3]))3562 # print (np.dot(DX,DH.T)+.5)%1.-Dphi 3563 return DX 3558 ptext = ' map offset chi**2: %.3f, map offset: %d %d %d %d'%(chisq,DX[0],DX[1],DX[2],DX[3]) 3559 G2fil.G2Print(ptext) 3560 return DX,ptext 3564 3561 3565 3562 def SSChargeFlip(data,reflDict,pgbar): … … 3650 3647 CErho = np.real(fft.fftn(fft.fftshift(CEhkl[:,:,:,maxM+1])))/10. #? to get on same scale as e-map 3651 3648 SSrho = np.real(fft.fftn(fft.fftshift(CEhkl)))/10. #? ditto 3652 G2fil.G2Print (' No.cycles = %d Residual Rcf =%8.3f%s Map size: %s'%(Ncyc,Rcf,'%',str(CErho.shape))) 3653 roll = findSSOffset(SGData,SSGData,A,CEhkl) #CEhkl needs to be just the observed set, not the full set! 3649 ctext = ' No.cycles = %d Residual Rcf =%8.3f%s Map size: %s'%(Ncyc,Rcf,'%',str(CErho.shape)) 3650 G2fil.G2Print (ctext) 3651 roll,ptext = findSSOffset(SGData,SSGData,A,CEhkl) #CEhkl needs to be just the observed set, not the full set! 3654 3652 3655 3653 mapData['Rcf'] = Rcf … … 3664 3662 map4DData['minmax'] = [np.max(map4DData['rho']),np.min(map4DData['rho'])] 3665 3663 map4DData['Type'] = reflDict['Type'] 3666 return mapData,map4DData 3664 return mapData,map4DData,ptext,ctext 3667 3665 3668 3666 def getRho(xyz,mapData):
Note: See TracChangeset
for help on using the changeset viewer.