Changeset 3587
- Timestamp:
- Sep 6, 2018 3:01:57 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIlattice.py
r3586 r3587 422 422 phase['SGData'] = G2spc.SpcGroup(SpGrp)[1] 423 423 BNSlatt = phase['SGData']['SGLatt'] 424 phase['SGData']['SGSpin'] = G2spc.GetSGSpin(phase['SGData'],result[0]) 425 phase['SGData']['GenSym'],phase['SGData']['GenFlg'],BNSsym = G2spc.GetGenSym(phase['SGData']) 424 426 if result[1]: 425 427 BNSlatt += '_'+result[1] 426 phase['SGData']['GenSym'],phase['SGData']['GenFlg'],BNSsym = G2spc.GetGenSym(phase['SGData'])427 428 phase['SGData']['BNSlattsym'] = [BNSlatt,BNSsym[BNSlatt]] 428 429 G2spc.ApplyBNSlatt(phase['SGData'],phase['SGData']['BNSlattsym']) 429 else: 430 phase['SGData']['GenSym'],phase['SGData']['GenFlg'],BNSsym = G2spc.GetGenSym(phase['SGData']) 430 phase['SGData']['SpnFlp'] = G2spc.GenMagOps(phase['SGData'])[1] 431 431 phase['SGData']['MagSpGrp'] = G2spc.MagSGSym(phase['SGData']) 432 phase['SGData']['SpnFlp'] = G2spc.GenMagOps(phase['SGData'])[1]433 432 return phase 434 433 -
trunk/GSASIIphsGUI.py
r3586 r3587 550 550 '''Get user selected magnetic atoms after cell transformation 551 551 ''' 552 def __init__(self,parent,Atoms,atCodes,atMxyz ):552 def __init__(self,parent,Atoms,atCodes,atMxyz,ifDelete=False): 553 553 wx.Dialog.__init__(self,parent,wx.ID_ANY,'Magnetic atom selection', 554 554 pos=wx.DefaultPosition,style=wx.DEFAULT_DIALOG_STYLE) … … 557 557 self.atCodes = atCodes 558 558 self.atMxyz = atMxyz 559 self.ifDelete = ifDelete 559 560 self.Use = len(self.Atoms)*[True,] 560 561 self.Draw() … … 590 591 mainSizer.Add(atmSizer) 591 592 592 OkBtn = wx.Button(self.panel,-1,"Ok")593 OkBtn.Bind(wx.EVT_BUTTON, self.OnOk)594 cancelBtn = wx.Button(self.panel,-1,"Cancel")595 cancelBtn.Bind(wx.EVT_BUTTON, self.OnCancel)593 YesBtn = wx.Button(self.panel,-1,"Yes") 594 YesBtn.Bind(wx.EVT_BUTTON, self.OnYes) 595 NoBtn = wx.Button(self.panel,-1,"No") 596 NoBtn.Bind(wx.EVT_BUTTON, self.OnNo) 596 597 btnSizer = wx.BoxSizer(wx.HORIZONTAL) 597 598 btnSizer.Add((20,20),1) 598 btnSizer.Add( OkBtn)599 btnSizer.Add(YesBtn) 599 600 btnSizer.Add((20,20),1) 600 btnSizer.Add(cancelBtn) 601 btnSizer.Add(NoBtn) 602 if self.ifDelete: 603 DeleteBtn = wx.Button(self.panel,-1,"Delete") 604 DeleteBtn.Bind(wx.EVT_BUTTON, self.OnDelete) 605 btnSizer.Add((20,20),1) 606 btnSizer.Add(DeleteBtn) 601 607 btnSizer.Add((20,20),1) 602 608 … … 615 621 return useAtoms,useatCodes 616 622 617 def On Ok(self,event):623 def OnYes(self,event): 618 624 parent = self.GetParent() 619 625 parent.Raise() 620 self.EndModal(wx.ID_ OK)621 622 def On Cancel(self,event):626 self.EndModal(wx.ID_YES) 627 628 def OnNo(self,event): 623 629 parent = self.GetParent() 624 630 parent.Raise() 625 self.EndModal(wx.ID_CANCEL) 631 self.EndModal(wx.ID_NO) 632 633 def OnDelete(self,event): 634 parent = self.GetParent() 635 parent.Raise() 636 self.EndModal(wx.ID_DELETE) 626 637 627 638 … … 2405 2416 CSI = G2spc.GetCSpqinel(SGData['SpnFlp'],dupDir) 2406 2417 atMxyz.append(CSI[0]) 2407 dlg = UseMagAtomDialog(G2frame,Atoms,atCodes,atMxyz )2418 dlg = UseMagAtomDialog(G2frame,Atoms,atCodes,atMxyz,ifDelete=False) 2408 2419 try: 2409 if dlg.ShowModal() == wx.ID_ OK:2420 if dlg.ShowModal() == wx.ID_YES: 2410 2421 newPhase['Atoms'],atCodes = dlg.GetSelection() 2411 2422 generalData['Lande g'] = len(generalData['AtomTypes'])*[2.,] … … 2438 2449 magData = G2frame.GPXtree.GetItemPyData(UnitCellsId)[5] 2439 2450 magKeep = [] 2451 magIds = [] 2440 2452 magchoices = [] 2441 for m agdata in magData:2453 for mid,magdata in enumerate(magData): 2442 2454 if magdata['Keep']: 2443 2455 trans = G2spc.Trans2Text(magdata['Trans']) 2444 2456 vec = G2spc.Latt2text([magdata['Uvec'],]) 2445 2457 magKeep.append(magdata) 2458 magIds.append(mid) 2446 2459 magchoices.append('%s %s %s'%(magdata['Name'],trans,vec)) 2447 2460 if not len(magKeep): … … 2453 2466 sel = dlg.GetSelection() 2454 2467 magchoice = magKeep[sel] 2468 magId = magIds[sel] 2455 2469 phaseName = '%s mag_%d'%(data['General']['Name'],sel) 2456 2470 newPhase = copy.deepcopy(data) … … 2477 2491 AtCods.append(atCodes[ia]) 2478 2492 atMxyz.append(CSI[0]) 2479 dlg = UseMagAtomDialog(G2frame,Atms,AtCods,atMxyz )2493 dlg = UseMagAtomDialog(G2frame,Atms,AtCods,atMxyz,ifDelete=True) 2480 2494 try: 2481 if dlg.ShowModal() == wx.ID_OK: 2495 opt = dlg.ShowModal() 2496 if opt == wx.ID_YES: 2482 2497 newPhase['Atoms'],atCodes = dlg.GetSelection() 2483 2498 generalData['Lande g'] = len(generalData['AtomTypes'])*[2.,] 2484 else: 2499 elif opt == wx.ID_DELETE: 2500 magData[magId]['Keep'] = False 2501 return 2502 else: #wx.ID_NO 2485 2503 return 2486 2504 finally: -
trunk/GSASIIpwdGUI.py
r3586 r3587 3453 3453 magAtms = [atom for atom in controls[14] if atom[1] == atype] 3454 3454 wx.BeginBusyCursor() 3455 wx.MessageBox(''' For use of k-SUBGROUPSMAG, please cite: 3456 Symmetry-Based Computational Tools for Magnetic Crystallography, 3457 J.M. Perez-Mato, S.V. Gallego, E.S. Tasci, L. Elcoro, G. de la Flor, and M.I. Aroyo 3458 Annu. Rev. Mater. Res. 2015. 45,217-48. 3459 doi: 10.1146/annurev-matsci-070214-021008''',caption='Bilbao k-SUBGROUPSMAG',style=wx.ICON_INFORMATION) 3460 3455 3461 MAXMAGN = kMAG.GetNonStdSubgroupsmag(SGData,kvec,star,Landau,intermed) 3456 3462 wx.EndBusyCursor() 3463 if MAXMAGN is None: 3464 wx.MessageBox('Check your internet connection?',caption='Bilbao k-SUBGROUPSMAG error',style=wx.ICON_EXCLAMATION) 3465 return 3457 3466 for result in MAXMAGN: 3458 3467 if result[0].strip().endswith("1'"): #skip gray groups -
trunk/GSASIIspc.py
r3585 r3587 861 861 SGData['SGSpin'].append(-1) 862 862 elif '_S' in BNS: 863 SGData['SGSpin'][-1] = -1 864 SGData['SGSpin'] += [-1,-1,-1,] 863 SGData['SGSpin'] += [1,1,1,] 865 864 Tmat *= 2.0 866 865 else:
Note: See TracChangeset
for help on using the changeset viewer.