- Timestamp:
- Oct 3, 2018 11:17:31 AM (7 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/GSASIIlattice.py ¶
r3636 r3638 485 485 return True 486 486 487 cx,ct ,cs,cia = Phase['General']['AtomPtrs']487 cx,ct = Phase['General']['AtomPtrs'][:2] 488 488 SGData = Phase['General']['SGData'] 489 489 Atoms = Phase['Atoms'] -
TabularUnified trunk/GSASIIphsGUI.py ¶
r3636 r3638 6027 6027 ZstepSizer = wx.BoxSizer(wx.HORIZONTAL) 6028 6028 ZstepSizer.Add(wx.StaticText(drawOptions,-1,' Z step:'),0,WACV) 6029 Zstep = G2G.ValidatedTxtCtrl(drawOptions,drawingData,'Zstep',nDig=(10,2),min=0.01,max= 1.0)6029 Zstep = G2G.ValidatedTxtCtrl(drawOptions,drawingData,'Zstep',nDig=(10,2),min=0.01,max=4.0) 6030 6030 ZstepSizer.Add(Zstep,0,WACV) 6031 6031 slideSizer.Add(ZstepSizer) -
TabularUnified trunk/GSASIIpwdGUI.py ¶
r3633 r3638 3399 3399 E,SGData = G2spc.SpcGroup(controls[13]) 3400 3400 if c == 2: 3401 testAtoms = ['',]+list(set([atom[1] for atom in controls[15]])) 3402 allmom = magcells[0].get('allmom',False) 3403 magAtms = magcells[0].get('magAtms','') 3404 maxequiv = magcells[0].get('maxequiv',1000) 3405 dlg = G2G.MultiDataDialog(G2frame,title='Keep options', 3406 prompts=['test for mag. atoms','all have moment','max unique'], 3407 values=['',allmom,maxequiv],limits=[testAtoms,[True,False],[1,100]], 3408 formats=['choice','bool','%d',]) 3409 if dlg.ShowModal() == wx.ID_OK: 3410 atype,allmom,maxequiv = dlg.GetValues() 3411 magAtms = [atom for atom in controls[15] if atom[1] == atype] 3401 3412 for phase in magcells: 3402 3413 Uvec = phase['Uvec'] 3403 3414 Trans = phase['Trans'] 3404 allmom = phase['allmom']3405 3415 invTrans = nl.inv(Trans) 3406 magAtms = phase['magAtms'] 3407 TestMagAtoms(phase,magAtms,SGData,Uvec,invTrans,allmom) 3416 phase['nAtoms'] = TestMagAtoms(phase,magAtms,SGData,Uvec,invTrans,allmom,maxequiv) 3408 3417 data = controls,bravais,cells,dminx,ssopt,magcells 3409 3418 G2frame.GPXtree.SetItemPyData(UnitCellsId,data) … … 3526 3535 wx.CallAfter(UpdateUnitCellsGrid,G2frame,data) 3527 3536 3528 def TestMagAtoms(phase,magAtms,SGData,Uvec,invTrans,allmom ):3537 def TestMagAtoms(phase,magAtms,SGData,Uvec,invTrans,allmom,maxequiv=1000): 3529 3538 found = False 3539 phase['Keep'] = False 3530 3540 if not magAtms: 3531 3541 phase['Keep'] = True 3532 3542 return 3543 Phase = {'General':{'AtomPtrs':[2,1],'SGData':copy.deepcopy(phase['SGData'])},'Atoms':[]} 3533 3544 for matm in magAtms: 3534 3545 xyzs = G2spc.GenAtom(matm[3:6],SGData,False,Move=True) 3535 for x in xyzs:3546 for ix,x in enumerate(xyzs): 3536 3547 xyz = G2lat.TransformXYZ(x[0]-Uvec,invTrans.T,np.zeros(3))%1. 3548 Phase['Atoms'].append(matm[:2]+list(xyz)) 3537 3549 SytSym,Mul,Nop,dupDir = G2spc.SytSym(xyz,phase['SGData']) 3538 3550 CSI = G2spc.GetCSpqinel(phase['SGData']['SpnFlp'],dupDir) 3539 if any(CSI[0]): #found one - can quit looking3551 if any(CSI[0]): 3540 3552 phase['Keep'] = True 3541 3553 if allmom: 3542 if not any(CSI[0]): 3554 if not any(CSI[0]): #found one - can quit looking 3543 3555 phase['Keep'] = False 3544 3556 found = True 3545 break 3546 if found: #found one 3547 break 3557 atCodes = len(Phase['Atoms'])*['1',] 3558 natm = len(G2lat.GetUnique(Phase,atCodes)[0]) 3559 if natm > maxequiv or found: #too many allowed atoms found 3560 phase['Keep'] = False 3561 return natm 3548 3562 3549 3563 def OnRunSubsMag(event): … … 3557 3571 Kz = [' ','0','1/2','3/2','1/3','2/3','1'] 3558 3572 dlg = G2G.MultiDataDialog(G2frame,title='k-SUBGROUPSMAG options', 3559 prompts=[' kx1 as fr.',' ky1 as fr.',' kz1 as fr.',' kx2 as fr.',' ky2 as fr.',' kz2 as fr.',\ 3560 ' Use whole star',' Landau transition',' Give intermediate cells','preserve axes','test for mag. atoms','all have moment'], 3561 values=kvec+[False,False,False,True,'',False], 3562 limits=[Kx[1:],Ky[1:],Kz[1:],Kx,Ky,Kz,[True,False],[True,False],[True,False],[True,False],testAtoms,[True,False]], 3563 formats=['choice','choice','choice','choice','choice','choice','bool','bool','bool','bool', 3564 'choice','bool']) 3573 prompts=[' kx1 as fr.',' ky1 as fr.',' kz1 as fr.',' kx2 as fr.',' ky2 as fr.',' kz2 as fr.', \ 3574 ' Use whole star',' Landau transition',' Give intermediate cells','preserve axes', \ 3575 'test for mag. atoms','all have moment','max unique'], 3576 values=kvec+[False,False,False,True,'',False,100], 3577 limits=[Kx[1:],Ky[1:],Kz[1:],Kx,Ky,Kz,[True,False],[True,False],[True,False], 3578 [True,False],testAtoms,[True,False],[1,100]], 3579 formats=['choice','choice','choice','choice','choice','choice','bool','bool', 3580 'bool','bool','choice','bool','%d',]) 3565 3581 if dlg.ShowModal() == wx.ID_OK: 3566 3582 magcells = [] … … 3573 3589 atype = newVals[10] 3574 3590 allmom = newVals[11] 3591 maxequiv = newVals[12] 3575 3592 magAtms = [atom for atom in controls[15] if atom[1] == atype] 3576 3593 wx.BeginBusyCursor() … … 3610 3627 phase['allmom'] = allmom 3611 3628 phase['magAtms'] = magAtms 3612 TestMagAtoms(phase,magAtms,SGData,Uvec,invTrans,allmom) 3629 phase['maxequiv'] = maxequiv 3630 phase['nAtoms'] = TestMagAtoms(phase,magAtms,SGData,Uvec,invTrans,allmom,maxequiv) 3613 3631 magcells.append(phase) 3614 3632 magcells[0]['Use'] = True … … 3905 3923 rowLabels = [] 3906 3924 for i in range(len(magcells)): rowLabels.append(str(i+1)) 3907 colLabels = ['Space Gp.','Try','Keep',' Trans','Vec','a','b','c','alpha','beta','gamma','Volume']3908 Types = [wg.GRID_VALUE_STRING,wg.GRID_VALUE_BOOL,wg.GRID_VALUE_BOOL,wg.GRID_VALUE_ STRING,wg.GRID_VALUE_STRING,]+ \3925 colLabels = ['Space Gp.','Try','Keep','Uniq','Trans','Vec','a','b','c','alpha','beta','gamma','Volume'] 3926 Types = [wg.GRID_VALUE_STRING,wg.GRID_VALUE_BOOL,wg.GRID_VALUE_BOOL,wg.GRID_VALUE_LONG,wg.GRID_VALUE_STRING,wg.GRID_VALUE_STRING,]+ \ 3909 3927 3*[wg.GRID_VALUE_FLOAT+':10,5',]+3*[wg.GRID_VALUE_FLOAT+':10,3',]+[wg.GRID_VALUE_FLOAT+':10,2'] 3910 3928 table = [] 3911 3929 for phase in magcells: 3930 natms = phase.get('nAtoms',1) 3912 3931 cell = list(phase['Cell']) 3913 3932 trans = G2spc.Trans2Text(phase['Trans']) 3914 3933 vec = G2spc.Latt2text([phase['Uvec'],]) 3915 row = [phase['Name'],phase['Use'],phase['Keep'], trans,vec]+cell3934 row = [phase['Name'],phase['Use'],phase['Keep'],natms,trans,vec]+cell 3916 3935 table.append(row) 3917 3936 MagCellsTable = G2G.Table(table,rowLabels=rowLabels,colLabels=colLabels,types=Types)
Note: See TracChangeset
for help on using the changeset viewer.