Changeset 1935 for trunk/GSASIImath.py
 Timestamp:
 Jul 20, 2015 9:25:46 AM (8 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/GSASIImath.py
r1930 r1935 421 421 Oatom = GetAtomsById(Atoms,AtLookUp,[AddHydId[0],])[0] 422 422 OXYZ = np.array(Oatom[cx:cx+3]) 423 if 'I' in Oatom[cia]: 424 Uiso = Oatom[cia+1] 425 else: 426 Uiso = (Oatom[cia+2]+Oatom[cia+3]+Oatom[cia+4])/3.0 #simple average 427 Uiso = max(Uiso,0.005) #set floor! 423 428 Tatoms = GetAtomsById(Atoms,AtLookUp,AddHydId[1]) 424 429 TXYZ = np.array([tatom[cx:cx+3] for tatom in Tatoms]) #3 x xyz … … 431 436 Len = np.sqrt(np.sum(Vec**2)) 432 437 Hpos = OXYZ0.98*np.inner(Bmat,Vec).T/Len 433 return [Hpos,] 438 HU = 1.1*Uiso 439 return [Hpos,],[HU,] 434 440 elif AddHydId[1] == 2: 435 441 Vec = np.inner(Amat,TXYZOXYZ).T … … 442 448 Hpos = np.array([[0.97*cosd(54.75),0.97*sind(54.75),0.], 443 449 [0.97*cosd(54.75),0.97*sind(54.75),0.]]) 450 HU = 1.2*Uiso*np.ones(2) 444 451 Hpos = np.inner(Bmat,np.inner(iMat,Hpos).T).T+OXYZ 445 return Hpos 452 return Hpos,HU 446 453 else: 447 454 Ratom = GetAtomsById(Atoms,AtLookUp,[AddHydId[2],])[0] … … 452 459 Hpos = np.array([[a,0.,b],[a,b*cosd(30.),0.5*b],[a,b*cosd(30.),0.5*b]]) 453 460 Hpos = np.inner(Bmat,np.inner(iMat,Hpos).T).T+OXYZ 454 return Hpos 461 HU = 1.5*Uiso*np.ones(3) 462 return Hpos,HU 455 463 elif nBonds == 3: 456 464 if AddHydId[1] == 1: … … 459 467 Vec = 0.93*Vec/Len 460 468 Hpos = OXYZ+Vec 461 return [Hpos,] 469 HU = 1.1*Uiso 470 return [Hpos,],[HU,] 462 471 elif AddHydId[1] == 2: 463 472 Ratom = GetAtomsById(Atoms,AtLookUp,[AddHydId[2],])[0] … … 468 477 Hpos = [[a,b,0],[a,b,0]] 469 478 Hpos = np.inner(Bmat,np.inner(iMat,Hpos).T).T+OXYZ 470 return Hpos 479 HU = 1.2*Uiso*np.ones(2) 480 return Hpos,HU 471 481 else: #2 bonds 472 482 if 'C' in Oatom[ct]: … … 475 485 Vec = 0.93*Vec/Len 476 486 Hpos = OXYZ+Vec 477 return [Hpos,] 487 HU = 1.1*Uiso 488 return [Hpos,],[HU,] 478 489 elif 'O' in Oatom[ct]: 479 490 mapData = General['Map'] … … 488 499 Rhos = np.array([getRho(pos,mapData) for pos in Hpos]) 489 500 imax = np.argmax(Rhos) 490 return [Hpos[imax],] 491 return [] 501 HU = 1.5*Uiso 502 return [Hpos[imax],],[HU,] 503 return [],[] 492 504 493 505 def AtomUij2TLS(atomData,atPtrs,Amat,Bmat,rbObj): #unfinished & not used
Note: See TracChangeset
for help on using the changeset viewer.