Changeset 3095
- Timestamp:
- Sep 21, 2017 2:42:50 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIdataGUI.py
r3092 r3095 6743 6743 else: 6744 6744 dlg.Destroy() 6745 6746 #def GridRowLblToolTip(row): return 'Row ='+str(row) 6745 6746 def OnCellChange(event): 6747 r = event.GetRow() 6748 val = G2frame.SeqTable.GetValue(r,0) 6749 print r,val 6750 G2frame.SeqTable.SetValue(r,0, val) 6747 6751 6748 6752 # lookup table for unique cell parameters by symmetry … … 7187 7191 colLabels=displayLabels,rowLabels=histNames,types=Types) 7188 7192 G2frame.dataDisplay.SetTable(G2frame.SeqTable, True) 7189 G2frame.dataDisplay.EnableEditing(False) 7190 # make all read-only 7191 # for c in range(len(colLabels)): 7192 # for r in range(nRows): 7193 # G2frame.dataDisplay.SetCellReadOnly(r,c) 7193 # make all Use editable all others ReadOnly 7194 for c in range(len(colLabels)): 7195 for r in range(nRows): 7196 if c: 7197 G2frame.dataDisplay.SetReadOnly(r,c,isReadOnly=True) 7198 else: 7199 G2frame.dataDisplay.SetReadOnly(r,c,isReadOnly=False) 7200 G2frame.dataDisplay.Bind(wg.EVT_GRID_CELL_CHANGE, OnCellChange) 7194 7201 G2frame.dataDisplay.Bind(wg.EVT_GRID_LABEL_LEFT_CLICK, PlotSSelect) 7195 7202 G2frame.dataDisplay.Bind(wg.EVT_GRID_LABEL_LEFT_DCLICK, PlotSelect) -
trunk/GSASIImath.py
r3079 r3095 218 218 try: 219 219 Bmat,Nzero = pinv(Amatlam,xtol) #Moore-Penrose inversion (via SVD) & count of zeros 220 if Print:221 220 # if Print: 221 print 'Found %d SVD zeros'%(Nzero) 222 222 # Bmat = nl.inv(Amatlam); Nzeros = 0 223 223 Bmat = Bmat/Anorm -
trunk/GSASIIobj.py
r3062 r3095 2417 2417 # includes a package, lets try to load the packages 2418 2418 pkgname = '' 2419 path = sys.path 2419 path = sys.path+['./',] 2420 2420 for pkg in f.split('.')[:-1]: # if needed, descend down the tree 2421 2421 if pkgname: -
trunk/GSASIIphsGUI.py
r3092 r3095 331 331 ################################################################################ 332 332 class TransformDialog(wx.Dialog): 333 ''' Phase transformation 333 ''' Phase transformation X' = M*(X-U)+V 334 334 335 335 :param wx.Frame parent: reference to parent frame (or None) … … 349 349 # else: 350 350 self.Trans = np.eye(3) 351 self.Vec = np.zeros(3) 351 self.Uvec = np.zeros(3) 352 self.Vvec = np.zeros(3) 352 353 self.oldSpGrp = phase['General']['SGData']['SpGrp'] 353 354 self.oldSGdata = phase['General']['SGData'] … … 440 441 MatSizer = wx.BoxSizer(wx.HORIZONTAL) 441 442 transSizer = wx.BoxSizer(wx.VERTICAL) 442 transSizer.Add(wx.StaticText(self.panel,label=" XYZ Transformation matrix & vector : M*X+V = X'"))443 transSizer.Add(wx.StaticText(self.panel,label=" XYZ Transformation matrix & vectors: M*(X-U)+V = X'")) 443 444 # if self.Super: 444 445 # Trmat = wx.FlexGridSizer(4,4,0,0) … … 455 456 commonSizer.Add(common,0,WACV) 456 457 transSizer.Add(commonSizer) 457 Trmat = wx.FlexGridSizer(3, 5,0,0)458 Trmat = wx.FlexGridSizer(3,6,0,0) 458 459 for iy,line in enumerate(self.Trans): 459 460 for ix,val in enumerate(line): … … 461 462 Trmat.Add(item) 462 463 Trmat.Add((25,0),0) 463 vec = G2G.ValidatedTxtCtrl(self.panel,self.Vec,iy,nDig=(10,3),size=(65,25)) 464 vec = G2G.ValidatedTxtCtrl(self.panel,self.Uvec,iy,nDig=(10,3),size=(65,25)) 465 Trmat.Add(vec) 466 vec = G2G.ValidatedTxtCtrl(self.panel,self.Vvec,iy,nDig=(10,3),size=(65,25)) 464 467 Trmat.Add(vec) 465 468 transSizer.Add(Trmat) … … 525 528 self.Phase['General']['Name'] += ' %s'%(self.Common) 526 529 self.Phase['General']['Cell'][1:] = G2lat.TransformCell(self.oldCell[:6],self.Trans) 527 return self.Phase,self.Trans,self. Vec,self.ifMag,self.ifConstr,self.Common530 return self.Phase,self.Trans,self.Uvec,self.Vvec,self.ifMag,self.ifConstr,self.Common 528 531 529 532 def OnOk(self,event): … … 2176 2179 try: 2177 2180 if dlg.ShowModal() == wx.ID_OK: 2178 newPhase,Trans, Vec,ifMag,ifConstr,Common = dlg.GetSelection()2181 newPhase,Trans,Uvec,Vvec,ifMag,ifConstr,Common = dlg.GetSelection() 2179 2182 else: 2180 2183 return … … 2189 2192 for atom in Atoms: 2190 2193 for i in range(3): 2191 atom[cx+i] += Vec[i]2194 atom[cx+i] -= Uvec[i] 2192 2195 atom[cs:cs+2] = G2spc.SytSym(atom[cx:cx+3],SGData)[:2] 2193 2196 data['Drawing'] = [] 2194 2197 else: 2195 2198 phaseName = newPhase['General']['Name'] 2196 newPhase,atCodes = G2lat.TransformPhase(data,newPhase,Trans,V ec,ifMag)2199 newPhase,atCodes = G2lat.TransformPhase(data,newPhase,Trans,Vvec,ifMag) 2197 2200 detTrans = np.abs(nl.det(Trans)) 2198 2201 -
trunk/GSASIIstrMain.py
r3068 r3095 261 261 ''' 262 262 Removes unused parameters from phase varylist if phase not in histogram 263 #TODO - implement "Fix F,X,U" for seq refinement here 263 264 ''' 264 265 pIds = [] … … 333 334 print("Error: not found!") 334 335 continue 336 #TODO - implement "Fix F,X,U" for seq refinement here 337 Histo = {histogram:Histograms[histogram],} 335 338 redphaseVary = phaseCheck(phaseVary,Phases,histogram) 336 Histo = {histogram:Histograms[histogram],}337 339 hapVary,hapDict,controlDict = G2stIO.GetHistogramPhaseData(Phases,Histo,Print=False) 338 340 calcControls.update(controlDict) -
trunk/GSASIIstrMath.py
r3093 r3095 2929 2929 Multiprocessing support added 2930 2930 ''' 2931 if GSASIIpath.GetConfigValue(' debug'):2931 if GSASIIpath.GetConfigValue('Show_timing',False): 2932 2932 starttime = time.time() #; print 'start GetFobsSq' 2933 2933 histoList = Histograms.keys() … … 3060 3060 Histogram = Histograms[histogram] 3061 3061 Histogram['Residuals']['hId'] = Histograms[histogram]['hId'] 3062 if GSASIIpath.GetConfigValue(' debug'):3062 if GSASIIpath.GetConfigValue('Show_timing',False): 3063 3063 print 'GetFobsSq t=',time.time()-starttime 3064 3064 3065 3065 def getPowderProfile(parmDict,x,varylist,Histogram,Phases,calcControls,pawleyLookup): 3066 3066 'Computes the powder pattern for a histogram based on contributions from all used phases' 3067 if GSASIIpath.GetConfigValue(' debug'): starttime = time.time()3067 if GSASIIpath.GetConfigValue('Show_timing',False): starttime = time.time() 3068 3068 3069 3069 def GetReflSigGamCW(refl,im,wave,G,GB,phfx,calcControls,parmDict): … … 3248 3248 if badPeak: 3249 3249 print 'ouch #4 bad profile coefficients yield negative peak width; some reflections skipped' 3250 if GSASIIpath.GetConfigValue(' debug'):3250 if GSASIIpath.GetConfigValue('Show_timing',False): 3251 3251 print 'getPowderProfile t=',time.time()-starttime 3252 3252 return yc,yb … … 4132 4132 xF = np.searchsorted(x,Limits[1])+1 4133 4133 useMP,ncores = G2mp.InitMP() 4134 if GSASIIpath.GetConfigValue(' debug'): starttime = time.time()4134 if GSASIIpath.GetConfigValue('Show_timing',False): starttime = time.time() 4135 4135 if useMP: 4136 4136 MPpool = mp.Pool(ncores) … … 4153 4153 # varylist,Histogram,Phases,rigidbodyDict,calcControls,pawleyLookup,dependentVars) 4154 4154 G2mv.Dict2Deriv(varylist,depDerivDict,dMdvh) 4155 if GSASIIpath.GetConfigValue(' debug'): print 'getPowderProfileDerv t=',time.time()-starttime4155 if GSASIIpath.GetConfigValue('Show_timing',False): print 'getPowderProfileDerv t=',time.time()-starttime 4156 4156 Wt = ma.sqrt(W[xB:xF])[nxs,:] 4157 4157 Dy = dy[xB:xF][nxs,:] -
trunk/config_example.py
r3051 r3095 160 160 computations are performed in-line. 161 161 ''' 162 163 Show_timing = False 164 '''If True, shows various timing results.'''
Note: See TracChangeset
for help on using the changeset viewer.