Changeset 4268
- Timestamp:
- Jan 28, 2020 3:04:53 PM (4 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIlattice.py
r4248 r4268 606 606 # return A,B 607 607 608 def cell2AB(cell ):608 def cell2AB(cell,alt=False): 609 609 """Computes orthogonalization matrix from unit cell constants 610 610 … … 617 617 cellstar = Gmat2cell(G) 618 618 A = np.zeros(shape=(3,3)) 619 if alt: #as used in RMCProfile!! 620 A[0][0] = 1./cellstar[0] 621 A[0][1] = cell[0]*cosd(cell[5])*sind(cell[3]) 622 A[0][2] = cell[0]*cosd(cell[4]) 623 A[1][1] = cell[1]*sind(cell[3]) 624 A[1][2] = cell[1]*cosd(cell[3]) 625 A[2][2] = cell[2] 626 B = nl.inv(A) 627 return A,B 619 628 # from Giacovazzo (Fundamentals 2nd Ed.) p.75 620 629 A[0][0] = cell[0] # a -
trunk/GSASIIphsGUI.py
r4267 r4268 2653 2653 else: 2654 2654 phaseName = newPhase['General']['Name'] 2655 newPhase,atCodes = G2lat.TransformPhase(data,newPhase,Trans ,Uvec,Vvec,ifMag)2655 newPhase,atCodes = G2lat.TransformPhase(data,newPhase,Trans.T,Uvec,Vvec,ifMag) 2656 2656 detTrans = np.abs(nl.det(Trans)) 2657 2657 generalData = newPhase['General'] … … 5177 5177 generalData = data['General'] 5178 5178 RMCPdict = data['RMC']['RMCProfile'] 5179 atSeq = RMCPdict['atSeq']5180 5179 pName = generalData['Name'].replace(' ','_') 5181 5180 dlg = wx.FileDialog(G2frame, "Choose any RMCProfile csv results file for "+pName+":", … … 5251 5250 '_SQ1partials.csv':[r'$\mathsf{Q,\AA^{-1}}$','S(Q)','RMCP S(Q) partials for '], 5252 5251 '_SQ2partials.csv':[r'$\mathsf{Q,\AA^{-1}}$','S(Q)','RMCP S(Q) partials for '], 5253 '_FQ1partials.csv':[r'$\mathsf{Q,\AA^{-1} $','F(Q)','RMCP F(Q) partials for ']}5252 '_FQ1partials.csv':[r'$\mathsf{Q,\AA^{-1}}$','F(Q)','RMCP F(Q) partials for ']} 5254 5253 for label in Labels: 5255 5254 X = [] … … 5298 5297 odfData = np.fromfile(OutFile,sep=' ') 5299 5298 numx,numy = odfData[:2] 5300 G2plt.Plot3dXYZ(G2frame,int(numx),int(numy),odfData[2:],newPlot=False,Title='Bond %s-%s'%(bond[0],bond[1])) 5299 G2plt.Plot3dXYZ(G2frame,int(numx),int(numy),odfData[2:], 5300 newPlot=False,Title='Bond %s-%s'%(bond[0],bond[1]),Centro=True) 5301 5301 5302 5302 -
trunk/GSASIIplot.py
r4265 r4268 5112 5112 ################################################################################ 5113 5113 5114 def Plot3dXYZ(G2frame,nX,nY,Zdat,labelX='X',labelY='Y',labelZ='Z',newPlot=False,Title='' ):5114 def Plot3dXYZ(G2frame,nX,nY,Zdat,labelX='X',labelY='Y',labelZ='Z',newPlot=False,Title='',Centro=False): 5115 5115 5116 5116 def OnMotion(event): … … 5133 5133 G2frame.G2plotNB.status.SetStatusText('',1) 5134 5134 Zmul = Zdat.reshape((nX,-1)).T 5135 if Centro: 5136 Zmul = Zmul+np.fliplr(np.roll(Zmul,nY//2,0)) 5135 5137 PHI = np.linspace(0.,360.,int(nY),True) 5136 5138 PSI = np.linspace(0.,180.,int(nX),True) … … 5158 5160 Plot.set_ylabel(labelY) 5159 5161 Plot.set_zlabel(labelZ) 5160 Page.canvas.draw()5162 Page.canvas.draw() 5161 5163 5162 5164 ################################################################################ -
trunk/GSASIIpwd.py
r4266 r4268 2141 2141 fl.write('1\n') 2142 2142 fl.write('%d\n'%int(inst[prms[0]][1])) 2143 fl.write('%10.5f%10.5f%10.4f%10d\n'%(inst[prms[1]][1], inst[prms[2]][1]/100.,inst[prms[3]][1],0))2143 fl.write('%10.5f%10.5f%10.4f%10d\n'%(inst[prms[1]][1],-100.*inst[prms[2]][1],inst[prms[3]][1],0)) 2144 2144 fl.write('%10.3f%10.3f%10.3f\n'%(inst[prms[4]][1],inst[prms[5]][1],inst[prms[6]][1])) 2145 2145 fl.write('%10.3f%10.3f%10.3f\n'%(inst[prms[7]][1]+Xsb,inst[prms[8]][1]+Ysb,0.0)) … … 2198 2198 newPhase = copy.deepcopy(Phase) 2199 2199 newPhase['General']['SGData'] = G2spc.SpcGroup('P 1')[1] 2200 newPhase['General']['Cell'][1:] = G2lat.TransformCell(Cell,Trans .T)2200 newPhase['General']['Cell'][1:] = G2lat.TransformCell(Cell,Trans) 2201 2201 newPhase,Atcodes = G2lat.TransformPhase(Phase,newPhase,Trans,np.zeros(3),np.zeros(3),ifMag=False) 2202 2202 Natm = np.core.defchararray.count(np.array(Atcodes),'+') #no. atoms in original unit cell … … 2246 2246 fl.write('Cell (Ang/deg): %12.6f%12.6f%12.6f%12.6f%12.6f%12.6f\n'%( 2247 2247 Cell[0],Cell[1],Cell[2],Cell[3],Cell[4],Cell[5])) 2248 A,B = G2lat. cell2AB(Cell)2248 A,B = G2lat.cell2AB(Cell,True) 2249 2249 fl.write('Lattice vectors (Ang):\n') 2250 2250 for i in [0,1,2]: … … 2274 2274 Sample = PWDdata['Sample Parameters'] 2275 2275 Scale = Sample['Scale'][0] 2276 if 'X' in Inst['Type'][0]: 2277 Scale *= 2. 2276 2278 Limits = PWDdata['Limits'][1] 2277 2279 Ibeg = np.searchsorted(Data[0],Limits[0]) … … 2288 2290 DT = np.diff(Data[0]) 2289 2291 for i in range(Ibeg,Ifin-1): 2290 fl.write('%11.6f%15.2f\n'%(Data[0][i] -DT[i],Data[1][i]))2292 fl.write('%11.6f%15.2f\n'%(Data[0][i],Data[1][i])) 2291 2293 fl.close() 2292 2294 return fname … … 2412 2414 for File in Files: 2413 2415 if Files[File][0]: 2416 if 'Xray' in File and 'F(Q)' in File: 2417 fqdata = open(Files[File][0],'r') 2418 lines = int(fqdata.readline()[:-1]) 2414 2419 fl.write('\n') 2415 2420 fl.write('%s ::\n'%File.split(';')[0].upper().replace(' ','_')) … … 2417 2422 fl.write(' > DATA_TYPE :: %s\n'%Files[File][2]) 2418 2423 fl.write(' > FIT_TYPE :: %s\n'%Files[File][2]) 2419 fl.write(' > START_POINT :: 1\n') 2420 fl.write(' > END_POINT :: 3000\n') 2424 if 'Xray' not in File: 2425 fl.write(' > START_POINT :: 1\n') 2426 fl.write(' > END_POINT :: 3000\n') 2427 fl.write(' > WEIGHT :: %.4f\n'%Files[File][1]) 2421 2428 fl.write(' > CONSTANT_OFFSET 0.000\n') 2422 2429 fl.write(' > NO_FITTED_OFFSET\n') 2423 2430 if Files[File][3] !='RMC': 2424 2431 fl.write(' > %s\n'%Files[File][3]) 2425 fl.write(' > WEIGHT :: %.4f\n'%Files[File][1])2426 2432 if 'reciprocal' in File: 2427 2433 fl.write(' > CONVOLVE ::\n') 2428 2434 fl.write(' > NO_FITTED_SCALE\n') 2429 2435 if 'Xray' in File: 2430 fl.write(' > RECIPROCAL_SPACE_FIT :: 1 3000 1\n')2431 fl.write(' > RECIPROCAL_SPACE_PARAMETERS :: 1 3000 %.4f\n'%Files[File][1])2432 fl.write(' > REAL_SPACE_FIT :: 1 3000 1\n')2433 fl.write(' > REAL_SPACE_PARAMETERS :: 1 3000 %.4f\n'%Files[File][1])2436 fl.write(' > RECIPROCAL_SPACE_FIT :: 1 %d 1\n'%lines) 2437 fl.write(' > RECIPROCAL_SPACE_PARAMETERS :: 1 %d %.4f\n'%(lines,Files[File][1])) 2438 fl.write(' > REAL_SPACE_FIT :: 1 %d 1\n'%(3*lines//2)) 2439 fl.write(' > REAL_SPACE_PARAMETERS :: 1 %d %.4f\n'%(3*lines//2,Files[File][1])) 2434 2440 fl.write('\n') 2435 2441 fl.write('BRAGG ::\n')
Note: See TracChangeset
for help on using the changeset viewer.