Changeset 569
- Timestamp:
- Apr 23, 2012 4:17:29 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASII.py
r567 r569 671 671 else: 672 672 Data['type'] = 'PWDR' 673 Data['color'] = ' binary'673 Data['color'] = 'Paired' 674 674 Data['tilt'] = 0.0 675 675 Data['rotation'] = 0.0 -
trunk/GSASIIimgGUI.py
r536 r569 182 182 'IOtth','outAzimuths'] 183 183 for key in keys: 184 File.write(key+':'+str(data[key])+'\n') 184 if key in ['rotation']: 185 File.write(key+':'+str(data[key]-90.)+'\n') 186 else: 187 File.write(key+':'+str(data[key])+'\n') 185 188 File.close() 186 189 finally: … … 205 208 if key in ['type','calibrant',]: 206 209 save[key] = val 210 elif key in ['rotation']: 211 save[key] = val+90. 207 212 elif key in ['center',]: 208 213 if ',' in val: -
trunk/GSASIImath.py
r568 r569 581 581 return mapData 582 582 583 def find Roll(SGData,rho,Fhkl):583 def findOffset(SGData,rho,Fhkl): 584 584 mapShape = rho.shape 585 585 hklShape = Fhkl.shape 586 586 mapHalf = np.array(mapShape)/2 587 Fmax = np.max(np.absolute(Fhkl)) 587 588 hklHalf = np.array(hklShape)/2 588 mapMax = np.unravel_index(np.argmax(rho),mapShape) 589 print mapMax,rho[mapMax],mapHalf 590 hklMax = np.unravel_index(np.argmax(Fhkl),hklShape) 591 print hklMax,Fhkl[hklMax],hklMax-hklHalf,hklHalf 589 sortHKL = np.argsort(Fhkl.flatten()) 590 Fdict = {} 591 for hkl in sortHKL: 592 HKL = np.unravel_index(hkl,hklShape) 593 F = Fhkl[HKL[0]][HKL[1]][HKL[2]] 594 if F == 0.: 595 break 596 Fdict['%.6f'%(np.absolute(F))] = hkl 597 Flist = np.flipud(np.sort(Fdict.keys())) 598 F = str(1.e6) 599 i = 0 600 while float(F) > 0.5*Fmax: 601 F = Flist[i] 602 hkl = np.unravel_index(Fdict[F],hklShape) 603 iabsnt,mulp,Uniq,phi = G2spc.GenHKLf(list(hkl-hklHalf),SGData) 604 Uniq = np.array(Uniq,dtype='i') 605 Uniq = np.concatenate((Uniq,-Uniq))+hklHalf 606 phi = np.concatenate((phi,-phi)) 607 print hkl-hklHalf 608 for j,H in enumerate(Uniq): 609 Fh = Fhkl[H[0],H[1],H[2]] 610 h,k,l = H-hklHalf 611 print '(%3d,%3d,%3d) %5.2f %9.5f'%(h,k,l,phi[j],np.angle(Fh,deg=True)) 612 i += 1 613 614 592 615 593 616 return [0,0,0] … … 663 686 print 'No.cycles = ',Ncyc,'Residual Rcf =%8.3f%s'%(Rcf,'%') 664 687 CErho = np.real(fft.fftn(fft.fftshift(CEhkl))) 665 roll = find Roll(SGData,CErho,CEhkl)688 roll = findOffset(SGData,CErho,CEhkl) 666 689 mapData['rho'] = np.roll(np.roll(np.roll(CErho,roll[0],axis=0),roll[1],axis=1),roll[2],axis=2) 667 690 mapData['rhoMax'] = max(np.max(mapData['rho']),-np.min(mapData['rho']))
Note: See TracChangeset
for help on using the changeset viewer.