Changeset 108
- Timestamp:
- Jul 7, 2010 4:08:38 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIIO.py
r94 r108 969 969 elif 'ATOM' in S[:4] or 'HETATM' in S[:6]: 970 970 XYZ = [float(S[31:39]),float(S[39:47]),float(S[47:55])] 971 XYZ = np. sum(AB*XYZ,axis=1)971 XYZ = np.inner(AB,XYZ) 972 972 SytSym,Mult = G2spc.SytSym(XYZ,SGData) 973 973 Uiso = float(S[61:67])/EightPiSq -
trunk/GSASIIimage.py
r104 r108 524 524 t0 = time.time() 525 525 NST = np.zeros(shape=(numAzms,numChans),dtype=np.int,order='F') 526 H0 = np.zeros(shape=(numAzms,numChans),order='F' )526 H0 = np.zeros(shape=(numAzms,numChans),order='F',dtype=np.float32) 527 527 H1 = np.zeros(shape=(numAzms+1,)) 528 528 H2 = np.zeros(shape=(numChans+1,)) 529 HST = [H0,H1,H2] 529 530 NST,H0,H1,H2 = h2d.histogram2d(len(tax),tax,tay,taz,numAzms,numChans,LRazm,LUtth,NST,H0,H1,H2) 530 HST = [H0,H1,H2]531 print "Binning elapsed time:","%8.3f"%(time.time()-t0), "s"532 531 return NST,HST 533 532 … … 549 548 print 'Bin image by 2-theta/azimuth intervals' 550 549 NST,HST = Bin2ThetaAzimuthMap(data,tax,tay,taz) 550 print 'Binning complete' 551 551 del tax,tay,taz 552 552 dlg.Update(3) 553 553 print 'Form normalized 1D pattern(s)' 554 self.Integrate = [HST[0]/NST,HST[1],HST[2]] 555 del NST,HST 554 HST[0] = np.divide(HST[0],NST) 555 print 'Normalize done' 556 self.Integrate = HST 557 del NST 556 558 dlg.Update(4) 557 559 t1 = time.time() -
trunk/GSASIIlattice.py
r105 r108 149 149 150 150 def MaxIndex(dmin,A): 151 #finds maximum allowed hkl for given A within dmin152 151 Hmax = [0,0,0] 153 152 try: … … 186 185 else: 187 186 return [H[2],H[0],H[1]] 187 188 def Rh2Hx(Rh): 189 Hx = [0,0,0] 190 Hx[0] = Rh[0]-Rh[1] 191 Hx[1] = Rh[1]-Rh[2] 192 Hx[2] = np.sum(Rh) 193 return Hx 194 195 def Hx2Rh(Hx): 196 Rh = [0,0,0] 197 itk = -Hx[0]+Hx[1]+Hx[2] 198 if itk%3 != 0: 199 return 0 #error - not rhombohedral reflection 200 else: 201 Rh[1] = itk/3 202 Rh[0] = Rh[1]+Hx[0] 203 Rh[2] = Rh[1]-Hx[1] 204 if Rh[0] < 0: 205 for i in range(3): 206 Rh[i] = -Rh[i] 207 return Rh 188 208 189 209 def CentCheck(Cent,H): … … 368 388 # part of reciprocal space ignoring anomalous dispersion 369 389 import math 370 Hmax = MaxIndex(dmin,A) 390 #finds maximum allowed hkl for given A within dmin 391 if Laue in ['3R','3mR']: #Rhombohedral axes 392 Hmax = [0,0,0] 393 cell = A2cell(A) 394 aHx = cell[0]*math.sqrt(2.0*(1.0-cosd(cell[3]))) 395 cHx = cell[0]*math.sqrt(3.0*(1.0+2.0*cosd(cell[3]))) 396 Hmax[0] = Hmax[1] = int(round(aHx/dmin)) 397 Hmax[2] = int(round(cHx/dmin)) 398 print Hmax,aHx,cHx 399 else: # all others 400 Hmax = MaxIndex(dmin,A) 401 371 402 dminsq = 1./(dmin**2) 372 403 HKL = [] … … 427 458 if Laue in ['3R','3']: 428 459 kmax = h 429 kmin = -int((h-1)/2.) 460 # kmin = -int((h-1.)/2.) 461 kmin = -(h-1)/2 430 462 else: 431 463 kmin = 0 … … 436 468 H = [] 437 469 if CentCheck(Cent,[h,k,l]): H=[h,k,l] 470 if Laue in ['3R','3mR']: 471 H = Hx2Rh(H) 438 472 if H: 439 473 rdsq = calc_rDsq(H,A) 440 474 if 0 < rdsq <= dminsq: 441 475 HKL.append([h,k,l,1/math.sqrt(rdsq)]) 476 print H,1/math.sqrt(rdsq) 442 477 else: #cubic 443 478 for h in range(Hmax[0]+1): … … 581 616 assert np.allclose(ortho,to), msg 582 617 assert np.allclose(frac,tf), msg 618 to = np.sum(A*frac,axis=1) 619 tf = np.sum(B*to,axis=1) 620 assert np.allclose(ortho,to), msg 621 assert np.allclose(frac,tf), msg 583 622 584 623 # test GetBraviasNum(...) and GenHBravais(...) … … 649 688 elif system == 'trigonal': 650 689 permlist = [(1,2,3),(2,1,3),(-1,-2,3),(-2,-1,3)] 690 elif system == 'rhombohedral': 691 permlist = [(1,2,3),(2,3,1),(3,1,2),(-1,-2,-3),(-2,-3,-1),(-3,-1,-2)] 651 692 else: 652 693 permlist = [(1,2,3)] -
trunk/GSASIIplot.py
r94 r108 665 665 scalex = 1000./pixelSize[0] 666 666 scaley = 1000./pixelSize[1] 667 print self.itemPicked 667 668 if self.itemPicked is None and PickName == 'Image Controls': 668 669 size = len(self.ImageZ) … … 815 816 interpolation='nearest',vmin=0,vmax=2,extent=[0,Xmax,Xmax,0]) 816 817 Img = Plot.imshow(A,aspect='equal',cmap=acolor, 817 interpolation='nearest',vmin=Imin,vmax=Imax,extent=[0,Xmax,Xmax,0] ,picker=True)818 interpolation='nearest',vmin=Imin,vmax=Imax,extent=[0,Xmax,Xmax,0]) 818 819 819 820 Plot.plot(xcent,ycent,'x')
Note: See TracChangeset
for help on using the changeset viewer.