Changeset 4547
- Timestamp:
- Aug 18, 2020 12:46:54 PM (3 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIdataGUI.py
r4534 r4547 2586 2586 if not newHistList: return # somehow, no new histograms 2587 2587 return # success 2588 2588 2589 def AddToNotebook(self,text): 2590 Id = GetGPXtreeItemId(self,self.root,'Notebook') 2591 data = self.GPXtree.GetItemPyData(Id) 2592 data.append('Notebook entry @ %s: %s\n'%(time.ctime(),text)) 2593 2589 2594 ############################################################################### 2590 2595 #Command logging … … 6235 6240 self.PostfillDataMenu() 6236 6241 # end of GSAS-II menu definitions 6237 6242 6238 6243 ################################################################################ 6239 6244 ##### Notebook Tree Item editor … … 6259 6264 G2frame.dataWindow.GetSizer().Add(wx.StaticText(G2frame.dataWindow,-1,' Add notes on project here: '),0,WACV) 6260 6265 G2frame.dataWindow.GetSizer().Add(text,1,wx.ALL|wx.EXPAND) 6261 6266 6262 6267 ################################################################################ 6263 6268 ##### Comments -
trunk/GSASIImath.py
r4542 r4547 3389 3389 Mmap = np.reshape(np.sum((Dang)**2,axis=1),newshape=steps)/len(DH) 3390 3390 hist,bins = np.histogram(Mmap,bins=1000) 3391 # for i,item in enumerate(hist[:10]):3392 # print item,bins[i]3393 3391 chisq = np.min(Mmap) 3394 3392 DX = -np.array(np.unravel_index(np.argmin(Mmap),Mmap.shape)) 3395 G2fil.G2Print (' map offset chi**2: %.3f, map offset: %d %d %d'%(chisq,DX[0],DX[1],DX[2]))3396 # print (np.dot(DX,DH.T)+.5)%1.-Dphi 3397 return DX 3393 ptext = ' map offset chi**2: %.3f, map offset: %d %d %d'%(chisq,DX[0],DX[1],DX[2]) 3394 G2fil.G2Print(ptext) 3395 return DX,ptext 3398 3396 3399 3397 def ChargeFlip(data,reflDict,pgbar): … … 3488 3486 G2fil.G2Print (' Charge flip time: %.4f'%(time.time()-time0),'no. elements: %d'%(Ehkl.size)) 3489 3487 CErho = np.real(fft.fftn(fft.fftshift(CEhkl)))/10. #? to get on same scale as e-map 3490 G2fil.G2Print (' No.cycles = %d Residual Rcf =%8.3f%s Map size: %s'%(Ncyc,Rcf,'%',str(CErho.shape))) 3491 roll = findOffset(SGData,A,CEhkl) #CEhkl needs to be just the observed set, not the full set! 3488 ctext = ' No.cycles = %d Residual Rcf =%8.3f%s Map size: %s'%(Ncyc,Rcf,'%',str(CErho.shape)) 3489 G2fil.G2Print (ctext) 3490 roll,ptext = findOffset(SGData,A,CEhkl) #CEhkl needs to be just the observed set, not the full set! 3492 3491 3493 3492 mapData['Rcf'] = Rcf … … 3496 3495 mapData['minmax'] = [np.max(mapData['rho']),np.min(mapData['rho'])] 3497 3496 mapData['Type'] = reflDict['Type'] 3498 return mapData,twophases 3497 return mapData,twophases,ptext,ctext 3499 3498 3500 3499 def findSSOffset(SGData,SSGData,A,Fhklm): … … 3555 3554 Mmap = np.reshape(np.sum((Dang)**2,axis=1),newshape=steps)/len(DH) 3556 3555 hist,bins = np.histogram(Mmap,bins=1000) 3557 # for i,item in enumerate(hist[:10]):3558 # print item,bins[i]3559 3556 chisq = np.min(Mmap) 3560 3557 DX = -np.array(np.unravel_index(np.argmin(Mmap),Mmap.shape)) 3561 G2fil.G2Print (' map offset chi**2: %.3f, map offset: %d %d %d %d'%(chisq,DX[0],DX[1],DX[2],DX[3]))3562 # print (np.dot(DX,DH.T)+.5)%1.-Dphi 3563 return DX 3558 ptext = ' map offset chi**2: %.3f, map offset: %d %d %d %d'%(chisq,DX[0],DX[1],DX[2],DX[3]) 3559 G2fil.G2Print(ptext) 3560 return DX,ptext 3564 3561 3565 3562 def SSChargeFlip(data,reflDict,pgbar): … … 3650 3647 CErho = np.real(fft.fftn(fft.fftshift(CEhkl[:,:,:,maxM+1])))/10. #? to get on same scale as e-map 3651 3648 SSrho = np.real(fft.fftn(fft.fftshift(CEhkl)))/10. #? ditto 3652 G2fil.G2Print (' No.cycles = %d Residual Rcf =%8.3f%s Map size: %s'%(Ncyc,Rcf,'%',str(CErho.shape))) 3653 roll = findSSOffset(SGData,SSGData,A,CEhkl) #CEhkl needs to be just the observed set, not the full set! 3649 ctext = ' No.cycles = %d Residual Rcf =%8.3f%s Map size: %s'%(Ncyc,Rcf,'%',str(CErho.shape)) 3650 G2fil.G2Print (ctext) 3651 roll,ptext = findSSOffset(SGData,SSGData,A,CEhkl) #CEhkl needs to be just the observed set, not the full set! 3654 3652 3655 3653 mapData['Rcf'] = Rcf … … 3664 3662 map4DData['minmax'] = [np.max(map4DData['rho']),np.min(map4DData['rho'])] 3665 3663 map4DData['Type'] = reflDict['Type'] 3666 return mapData,map4DData 3664 return mapData,map4DData,ptext,ctext 3667 3665 3668 3666 def getRho(xyz,mapData): -
trunk/GSASIIphsGUI.py
r4532 r4547 12157 12157 finally: 12158 12158 pgbar.Destroy() 12159 G2frame.AddToNotebook('4D Charge flip: '+result[2]) 12160 G2frame.AddToNotebook('4D Charge flip: '+result[3]) 12159 12161 mapData.update(newMap) 12160 12162 map4DData.update(new4Dmap) … … 12194 12196 try: 12195 12197 result = G2mth.ChargeFlip(data,ReflData,pgbar) 12198 G2frame.AddToNotebook('Charge flip: '+result[2]) 12199 G2frame.AddToNotebook('Charge flip: '+result[3]) 12196 12200 mapData.update(result[0]) 12197 12201 X = range(len(result[1])) -
trunk/GSASIIpwdGUI.py
r4541 r4547 890 890 dlg.SetPosition(wx.Point(screenSize[2]-Size[0]-305,screenSize[1]+5)) 891 891 try: 892 peaks['sigDict'] = G2pwd.DoPeakFit(FitPgm,peaks['peaks'],background,limits,inst,inst2,data,bxye,[],oneCycle,controls,wtFactor,dlg)[0] 892 results = G2pwd.DoPeakFit(FitPgm,peaks['peaks'],background,limits,inst,inst2,data,bxye,[],oneCycle,controls,wtFactor,dlg) 893 peaks['sigDict'] = results[0] 894 text = 'Peak fit: Rwp=%.2f%% Nobs= %d Nparm= %d Npeaks= %d'%(results[3]['Rwp'],results[1][2]['fjac'].shape[1],len(results[0]),len(peaks['peaks'])) 893 895 finally: 894 896 # dlg.Destroy() … … 896 898 newpeaks = copy.copy(peaks) 897 899 G2frame.GPXtree.SetItemPyData(G2gd.GetGPXtreeItemId(G2frame,PatternId, 'Peak List'),newpeaks) 900 G2frame.AddToNotebook(text) 898 901 G2plt.PlotPatterns(G2frame,plotType='PWDR') 899 902 wx.CallAfter(UpdatePeakGrid,G2frame,newpeaks)
Note: See TracChangeset
for help on using the changeset viewer.