Changeset 2120
- Timestamp:
- Jan 11, 2016 2:12:00 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIindex.py
r2119 r2120 314 314 Peaks = np.copy(np.array(peaks).T) 315 315 if 'T' in Inst['Type'][0]: 316 result = so.brute(TSSfunc,ranges,finish=so.fmin_cg, 317 args=(peaks,dmin,Inst,SGData,SSGData,ssopt['ModVec'],Vref, ssopt['maxH'],A,difC,Z,dlg))318 else: 319 result = so.brute(ZSSfunc,ranges,finish=so.fmin_cg, 320 args=(peaks,dmin,Inst,SGData,SSGData,ssopt['ModVec'],Vref, ssopt['maxH'],A,wave,Z,dlg))321 return Val2Vec(ssopt['ModVec'],Vref,result )316 result = so.brute(TSSfunc,ranges,finish=so.fmin_cg,full_output=True, 317 args=(peaks,dmin,Inst,SGData,SSGData,ssopt['ModVec'],Vref,1,A,difC,Z,dlg)) 318 else: 319 result = so.brute(ZSSfunc,ranges,finish=so.fmin_cg,full_output=True, 320 args=(peaks,dmin,Inst,SGData,SSGData,ssopt['ModVec'],Vref,1,A,wave,Z,dlg)) 321 return Val2Vec(ssopt['ModVec'],Vref,result[0]),result 322 322 323 323 def IndexPeaks(peaks,HKL): -
trunk/GSASIIlattice.py
r2038 r2120 449 449 return (pos-Inst['difA'][1]*d**2-Inst['Zero'][1]-Inst['difB'][1]/d)/Inst['difC'][1] 450 450 dsp0 = np.ones_like(Pos) 451 N = 0 451 452 while True: #successive approximations 452 453 dsp = func(dsp0,Pos,Inst) … … 454 455 return dsp 455 456 dsp0 = dsp 457 N += 1 458 if N > 10: 459 return dsp 456 460 457 461 def Dsp2pos(Inst,dsp): -
trunk/GSASIIplot.py
r2108 r2120 2371 2371 else: 2372 2372 Page.canvas.draw() 2373 2374 def PlotXYZ(G2frame,XY,Z,labelX=None,labelY=None,newPlot=False,Title=''): 2375 '''simple contour plot of xyz data, used for diagnostic purposes 2376 ''' 2377 def OnMotion(event): 2378 xpos = event.xdata 2379 if xpos: #avoid out of frame mouse position 2380 ypos = event.ydata 2381 Page.canvas.SetCursor(wx.CROSS_CURSOR) 2382 ix = int(Nxy[0]*(xpos-Xmin)+0.5) 2383 iy = int(Nxy[1]*(ypos-Ymin)+0.5) 2384 try: 2385 G2frame.G2plotNB.status.SetStatusText('%s =%9.3f %s =%9.3f val =%9.3f'% \ 2386 (labelX,xpos,labelY,ypos,Z[ix,iy]),1) 2387 except TypeError: 2388 G2frame.G2plotNB.status.SetStatusText('Select '+Title+' pattern first',1) 2389 2390 try: 2391 plotNum = G2frame.G2plotNB.plotList.index(Title) 2392 Page = G2frame.G2plotNB.nb.GetPage(plotNum) 2393 if not newPlot: 2394 Plot = Page.figure.gca() 2395 xylim = Plot.get_xlim(),Plot.get_ylim() 2396 Page.figure.clf() 2397 Plot = Page.figure.gca() 2398 except ValueError: 2399 newPlot = True 2400 Plot = G2frame.G2plotNB.addMpl(Title).gca() 2401 plotNum = G2frame.G2plotNB.plotList.index(Title) 2402 Page = G2frame.G2plotNB.nb.GetPage(plotNum) 2403 Page.canvas.mpl_connect('motion_notify_event', OnMotion) 2404 2405 Page.Choice = None 2406 Page.SetFocus() 2407 G2frame.G2plotNB.status.DestroyChildren() 2408 Nxy = Z.shape 2409 Xmin = np.min(XY[0]) 2410 Xmax = np.max(XY[0]) 2411 Ymin = np.min(XY.T[0]) 2412 Ymax = np.max(XY.T[0]) 2413 Plot.set_title(Title) 2414 if labelX: 2415 Plot.set_xlabel(r''+labelX,fontsize=14) 2416 else: 2417 Plot.set_xlabel(r'X',fontsize=14) 2418 if labelY: 2419 Plot.set_ylabel(r''+labelY,fontsize=14) 2420 else: 2421 Plot.set_ylabel(r'Y',fontsize=14) 2422 Img = Plot.imshow(Z.T,cmap='Paired',interpolation='nearest',origin='lower', \ 2423 aspect='auto',extent=[Xmin,Xmax,Ymin,Ymax]) 2424 Page.figure.colorbar(Img) 2425 if not newPlot: 2426 Page.toolbar.push_current() 2427 Plot.set_xlim(xylim[0]) 2428 Plot.set_ylim(xylim[1]) 2429 xylim = [] 2430 Page.toolbar.push_current() 2431 Page.toolbar.draw() 2432 else: 2433 Page.canvas.draw() 2373 2434 2374 2435 ################################################################################ -
trunk/GSASIIpwdGUI.py
r2118 r2120 2495 2495 def OnFindMV(event): 2496 2496 Peaks = np.copy(peaks[0]) 2497 print ' Trying: ',controls[13],ssopt['ssSymb'], 'maxH:', ssopt['maxH']2497 print ' Trying: ',controls[13],ssopt['ssSymb'], 'maxH:',1 2498 2498 dlg = wx.ProgressDialog('Elapsed time','Modulation vector search', 2499 2499 style = wx.PD_ELAPSED_TIME|wx.PD_AUTO_HIDE) 2500 2500 try: 2501 ssopt['ModVec'] = G2indx.findMV(Peaks,controls,ssopt,Inst,dlg) 2501 ssopt['ModVec'],result = G2indx.findMV(Peaks,controls,ssopt,Inst,dlg) 2502 if len(result[0]) == 2: 2503 G2plt.PlotXYZ(G2frame,result[2],1./result[3],labelX='a',labelY='g', 2504 newPlot=True,Title='Modulation vector search') 2502 2505 finally: 2503 2506 dlg.Destroy() … … 3048 3051 maxMH.Bind(wx.EVT_COMBOBOX, OnMaxMH) 3049 3052 ssSizer.Add(maxMH,0,WACV) 3050 findMV = wx. wx.Button(G2frame.dataDisplay,label="Find mod. vec.?")3053 findMV = wx.Button(G2frame.dataDisplay,label="Find mod. vec.?") 3051 3054 findMV.Bind(wx.EVT_BUTTON,OnFindMV) 3052 3055 ssSizer.Add(findMV,0,WACV)
Note: See TracChangeset
for help on using the changeset viewer.