# Changeset 3716

Ignore:
Timestamp:
Nov 4, 2018 8:21:47 AM (5 years ago)
Message:

implement new version of SUBGROUPS & k-SUBGROUPDMAG that return conjugacy & super group lists
display the results from these
remove lattice parameter constraints (for now at least) - occasionally fail with bad consequences

Location:
trunk
Files:
6 edited

Unmodified
Removed
• ## trunk/GSASIIconstrGUI.py

 r3711 #how do I do Uij's for most Trans? As = ['A0','A1','A2','A3','A4','A5'] Aids = [[0,0,'A0'],[1,1,'A1'],[2,2,'A2'],[0,1,'A3'],[0,2,'A4'],[1,2,'A5']] DepConsDict = dict(zip(As,[[],[],[],[],[],[]])) for iA,Aid in enumerate(Aids): GT = np.zeros((3,3)) if abs(nAcof[iA]) > 1.e-8: GT[Aid[0],Aid[1]] = 1 nGT = G2lat.prodMGMT(GT,Trans) nAT = G2lat.Gmat2A(nGT) for ia,nA in enumerate(nAT): if abs(nA) > 1.e-8 and abs(nAcof[ia]) > 1.e-8: parm = SetUniqAj(npId,As[ia],nSGData['SGLaue']) DepConsDict[Aid[2]].append([nA,G2obj.G2VarObj(parm)]) #unfortunately, this doesn't always work! #    As = ['A0','A1','A2','A3','A4','A5'] #    Aids = [[0,0,'A0'],[1,1,'A1'],[2,2,'A2'],[0,1,'A3'],[0,2,'A4'],[1,2,'A5']] #    DepConsDict = dict(zip(As,[[],[],[],[],[],[]])) #    for iA,Aid in enumerate(Aids): #        GT = np.zeros((3,3)) #        if abs(nAcof[iA]) > 1.e-8: #            GT[Aid[0],Aid[1]] = 1. #            nGT = G2lat.prodMGMT(GT,Trans) #            nAT = G2lat.Gmat2A(nGT) #            for ia,nA in enumerate(nAT): #                if abs(nA) > 1.e-8 and abs(nAcof[ia]) > 1.e-8: #                    parm = SetUniqAj(npId,As[ia],nSGData['SGLaue']) #                    DepConsDict[Aid[2]].append([nA,G2obj.G2VarObj(parm)]) conStrings = [] for iA,Asi in enumerate(As):
• ## trunk/GSASIIlattice.py

 r3686 if result[1]: BNSlatt += '_'+result[1] if 'P_S' in BNSlatt: BNSlatt = 'P_c'    #triclinic fix phase['SGData']['BNSlattsym'] = [BNSlatt,BNSsym[BNSlatt]] G2spc.ApplyBNSlatt(phase['SGData'],phase['SGData']['BNSlattsym'])
• ## trunk/GSASIIphsGUI.py

 r3714 UCdata = list(G2frame.GPXtree.GetItemPyData(UnitCellsId)) magData = UCdata[5] baseList = UCdata[0][16] magKeep = [] magIds = [] magchoices = [] ifMag = False for mid,magdata in enumerate(magData): itemList = [phase.get('gid',ip+1) for ip,phase in enumerate(magData)] phaseDict = dict(zip(itemList,magData)) for im,mid in enumerate(baseList): magdata = phaseDict[mid] if magdata['Keep']: if 'magAtms' in magdata: ifMag = True magdata['No.'] = mid+1 magdata['No.'] = im+1 trans = G2spc.Trans2Text(magdata['Trans']) vec = G2spc.Latt2text([magdata['Uvec'],]) magKeep.append(magdata) magIds.append(mid) magchoices.append('(%d) %s; (%s) + (%s)'%(mid+1,magdata['Name'],trans,vec)) magchoices.append('(%d) %s; (%s) + (%s)'%(im+1,magdata['Name'],trans,vec)) if not len(magKeep): G2frame.ErrorDialog('Subgroup/magnetic phase selection error','No magnetic phases found; be sure to "Keep" some')
• ## trunk/GSASIIpwdGUI.py

 r3712 ###### class definitions ################################################################################ class SubCellsDialog(wx.Dialog): def __init__(self,parent,title,items,phaseDict): wx.Dialog.__init__(self,parent,-1,title, pos=wx.DefaultPosition,style=wx.DEFAULT_DIALOG_STYLE) self.panel = None self.items = items self.phaseDict = phaseDict self.Draw() def Draw(self): if self.panel: self.panel.Destroy() self.panel = wx.Panel(self) rowLabels = [str(i+1) for i in range(len(self.items))] colLabels = ['Space Gp','Try','Keep','Uniq','nConj','nSup','Trans','Vec','a','b','c','alpha','beta','gamma','Volume'] Types = [wg.GRID_VALUE_STRING,]+2*[wg.GRID_VALUE_BOOL,]+3*[wg.GRID_VALUE_LONG,]+2*[wg.GRID_VALUE_STRING,]+ \ 3*[wg.GRID_VALUE_FLOAT+':10,5',]+3*[wg.GRID_VALUE_FLOAT+':10,3',]+[wg.GRID_VALUE_FLOAT+':10,2'] table = [] for ip in self.items: phase = self.phaseDict[ip] natms = phase.get('nAtoms',1) try: nConj = len(phase['altList']) nSup = len(phase['supList']) except KeyError: nConj = 0 nSup = 0 cell  = list(phase['Cell']) trans = G2spc.Trans2Text(phase['Trans']) vec = G2spc.Latt2text([phase['Uvec'],]) row = [phase['Name'],phase['Use'],phase['Keep'],natms,nConj,nSup,trans,vec]+cell table.append(row) CellsTable = G2G.Table(table,rowLabels=rowLabels,colLabels=colLabels,types=Types) mainSizer = wx.BoxSizer(wx.VERTICAL) magDisplay = G2G.GSGrid(self.panel) magDisplay.SetTable(CellsTable, True) #        magDisplay.Bind(wg.EVT_GRID_CELL_LEFT_CLICK,RefreshMagCellsGrid) #        magDisplay.Bind(wg.EVT_GRID_LABEL_LEFT_DCLICK,OnRefreshKeep) magDisplay.AutoSizeColumns(False) for r in range(magDisplay.GetNumberRows()): for c in range(magDisplay.GetNumberCols()): if c in [1,2]: magDisplay.SetReadOnly(r,c,isReadOnly=False) else: magDisplay.SetReadOnly(r,c,isReadOnly=True) mainSizer.Add(magDisplay,0,WACV) OkBtn = wx.Button(self.panel,-1,"Ok") OkBtn.Bind(wx.EVT_BUTTON, self.OnOk) btnSizer = wx.BoxSizer(wx.HORIZONTAL) btnSizer.Add((20,20),1) btnSizer.Add(OkBtn) btnSizer.Add((20,20),1) mainSizer.Add(btnSizer,0,wx.EXPAND|wx.BOTTOM|wx.TOP, 10) self.panel.SetSizer(mainSizer) self.panel.Fit() self.Fit() def OnOk(self,event): parent = self.GetParent() parent.Raise() self.Destroy() #        self.EndModal(wx.ID_OK) class RDFDialog(wx.Dialog): controls,bravais,cells,dminx,ssopt,magcells = G2frame.GPXtree.GetItemPyData(UnitCellsId) r,c =  event.GetRow(),event.GetCol() br = baseList[r] phase = phaseDict[br] if magcells: if c == 0: r = event.GetRow() phase = magcells[r] mSGData = phase['SGData'] text,table = G2spc.SGPrint(mSGData,AddInv=True) for i in range(len(magcells)): magcells[i]['Use'] = False for i in range(len(baseList)): MagCellsTable.SetValue(i,c,False) MagCellsTable.SetValue(r,c,True) magDisplay.ForceRefresh() magcells[r]['Use'] = True mSGData = magcells[r]['SGData'] A = G2lat.cell2A(magcells[r]['Cell'][:6]) phase['Use'] = True mSGData = phase['SGData'] A = G2lat.cell2A(phase['Cell'][:6]) G2frame.HKL = G2pwd.getHKLpeak(1.0,mSGData,A,Inst) G2plt.PlotPatterns(G2frame,extraKeys=KeyList) if MagCellsTable.GetValue(r,c): MagCellsTable.SetValue(r,c,False) magcells[r]['Keep'] = False phase['Keep'] = False else: magcells[r]['Keep'] = True phase['Keep'] = True MagCellsTable.SetValue(r,c,True) magDisplay.ForceRefresh() elif c ==3: r = event.GetRow() maxequiv = magcells[0].get('maxequiv',100) phase = magcells[r] mSGData = magcells[r]['SGData'] pname = '(%d) %s'%(br,phase['Name']) mSGData = phase['SGData'] Uvec = phase['Uvec'] Trans = phase['Trans'] ifMag = False if 'magAtms' in magcells[r]: if 'magAtms' in phase: ifMag = True allmom = magcells[r].get('allmom',False) magAtms = magcells[r].get('magAtms','') allmom = phase.get('allmom',False) magAtms = phase.get('magAtms','') mAtoms = TestMagAtoms(phase,magAtms,SGData,Uvec,Trans,allmom,maxequiv) else: Atms.append(atom[:2]+['',]+atom[2:5]) AtCods.append('1') if 'magAtms' in magcells[r]: if 'magAtms' in phase: MagSytSym = G2spc.MagSytSym(SytSym,dupDir,mSGData) CSI = G2spc.GetCSpqinel(mSGData['SpnFlp'],dupDir) CSI = G2spc.GetCSxinel(SytSym) atMxyz.append([SytSym,CSI[0]]) G2phsG.UseMagAtomDialog(G2frame,magcells[r]['Name'],Atms,AtCods,atMxyz,ifMag=ifMag,ifOK=True).ShowModal() G2phsG.UseMagAtomDialog(G2frame,pname,Atms,AtCods,atMxyz,ifMag=ifMag,ifOK=True).ShowModal() elif c in [4,5]: if 'altList' not in phase: return if c == 4: title = 'Conjugacy list for '+phase['Name'] items = phase['altList'] elif c == 5: title = 'Super groups list list for '+phase['Name'] items = phase['supList'] if not items[0]: wx.MessageBox(phase['Name']+' is a maximal subgroup',caption='Super group is parent',style=wx.ICON_INFORMATION) return SubCellsDialog(G2frame,title,items,phaseDict).ShowModal() data = [controls,bravais,cells,dminx,ssopt,magcells] G2frame.GPXtree.SetItemPyData(UnitCellsId,data) if c == 2: testAtoms = ['',]+list(set([atom[1] for atom in controls[15]])) allmom = magcells[0].get('allmom',False) magAtms = magcells[0].get('magAtms','') maxequiv = magcells[0].get('maxequiv',100) dlg = G2G.MultiDataDialog(G2frame,title='Keep options', prompts=['max unique','test for mag. atoms','all have moment',], values=[maxequiv,'',allmom],limits=[[1,100],testAtoms,[True,False]], formats=['%d','choice','bool']) ifMag = False maxequiv = magcells[0]['maxequiv'] maximal = False if 'magAtms' in magcells[0]: ifMag = True allmom = magcells[0]['allmom'] magAtms = magcells[0]['magAtms'] dlg = G2G.MultiDataDialog(G2frame,title='Keep options', prompts=['max unique','test for mag. atoms','all have moment','only maximal subgroups',], values=[maxequiv,'',allmom,False],limits=[[1,100],testAtoms,[True,False],[True,False]], formats=['%d','choice','bool','bool']) else: dlg = G2G.MultiDataDialog(G2frame,title='Keep options', prompts=['max unique','only maximal subgroups',], values=[maxequiv,False],limits=[[1,100],[True,False],], formats=['%d','bool',]) if dlg.ShowModal() == wx.ID_OK: maxequiv,atype,allmom = dlg.GetValues() magAtms = [atom for atom in controls[15] if atom[1] == atype] for phase in magcells: if ifMag: maxequiv,atype,allmom,maximal = dlg.GetValues() magAtms = [atom for atom in controls[15] if atom[1] == atype] else: maxequiv,maximal = dlg.GetValues() dlg = wx.ProgressDialog('Setting Keep flags','Processing '+magcells[0]['Name'],len(magcells), style = wx.PD_ELAPSED_TIME|wx.PD_AUTO_HIDE|wx.PD_REMAINING_TIME) for ip,phase in enumerate(magcells): dlg.Update(ip,newmsg='Processing '+phase['Name']) Uvec = phase['Uvec'] Trans = phase['Trans'] phase['nAtoms'] = len(TestMagAtoms(phase,magAtms,SGData,Uvec,Trans,allmom,maxequiv)) if ifMag: phase['nAtoms'] = len(TestMagAtoms(phase,magAtms,SGData,Uvec,Trans,allmom,maxequiv,maximal)) else: phase['nAtoms'] = len(TestAtoms(phase,controls[15],SGData,Uvec,Trans,maxequiv,maximal)) dlg.Destroy() data = controls,bravais,cells,dminx,ssopt,magcells G2frame.GPXtree.SetItemPyData(UnitCellsId,data) wx.CallAfter(UpdateUnitCellsGrid,G2frame,data) def TestMagAtoms(phase,magAtms,SGData,Uvec,Trans,allmom,maxequiv=100): def TestMagAtoms(phase,magAtms,SGData,Uvec,Trans,allmom,maxequiv=100,maximal=False): found = False anymom = False phase['Keep'] = False if not magAtms: CSI = G2spc.GetCSpqinel(phase['SGData']['SpnFlp'],dupDir) if any(CSI[0]): phase['Keep'] = True anymom = True if allmom: if not any(CSI[0]): uAtms = G2lat.GetUnique(Phase,atCodes)[0] natm = len(uAtms) if natm > maxequiv or found: #too many allowed atoms found phase['Keep'] = False if anymom and natm <= maxequiv and not found: phase['Keep'] = True if maximal and phase['supList'][0]: phase['Keep'] = False return uAtms def TestAtoms(phase,magAtms,SGData,Uvec,Trans,maxequiv=100): phase['Keep'] = False if not magAtms: phase['Keep'] = True return [] def TestAtoms(phase,magAtms,SGData,Uvec,Trans,maxequiv=100,maximal=False): phase['Keep'] = True invTrans = nl.inv(Trans) atCodes = [] if natm > maxequiv: #too many allowed atoms found phase['Keep'] = False if maximal and phase['supList'][0]: phase['Keep'] = False return uAtms def OnRunSubs(event): import kSUBGROUPSMAG as kMAG import SUBGROUPS as kSUB G2frame.dataWindow.RunSubGroupsMag.Enable(False) pUCid = G2gd.GetGPXtreeItemId(G2frame,G2frame.PatternId, 'Unit Cells List') doi: 10.1146/annurev-matsci-070214-021008''',caption='Bilbao SUBGROUPS',style=wx.ICON_INFORMATION) SUBGROUPS = kMAG.GetNonStdSubgroups(SGData,kvec[:9],star,Landau,maximal) SUBGROUPS,baseList = kSUB.GetNonStdSubgroups(SGData,kvec[:9],star,Landau) #            SUBGROUPS,baseList = kMAG.GetNonStdSubgroups(SGData,kvec[:9],star,Landau,maximal) wx.EndBusyCursor() if SUBGROUPS is None: return controls[14] = kvec[:9] controls[16] = baseList dlg = wx.ProgressDialog('SUBGROUPS results','Processing '+SUBGROUPS[0][0],len(SUBGROUPS), style = wx.PD_ELAPSED_TIME|wx.PD_AUTO_HIDE|wx.PD_REMAINING_TIME) for ir,result in enumerate(SUBGROUPS): dlg.Update(ir,newmsg='Processing '+result[0]) numbs = [eval(item+'.') for item in result[1].split()] Uvec = np.array(numbs[3::4]) Trans = np.array([numbs[:3],numbs[4:7],numbs[8:11]]).T         #Bilbao gives transpose Trans = np.array(eval(result[1][0])) Uvec = np.array(eval(result[1][1])) phase = G2lat.makeBilbaoPhase(result,Uvec,Trans) phase['gid'] = result[2] phase['altList'] = result[3] phase['supList'] = eval(result[4]) RVT = None if keepaxes: if RVT is not None: result,Uvec,Trans = RVT phase = G2lat.makeBilbaoPhase(result,Uvec,Trans) phase.update(G2lat.makeBilbaoPhase(result,Uvec,Trans)) phase['Cell'] = G2lat.TransformCell(controls[6:12],Trans) phase['maxequiv'] = maxequiv phase['nAtoms'] = len(TestAtoms(phase,controls[15],SGData,Uvec,Trans,maxequiv)) phase['nAtoms'] = len(TestAtoms(phase,controls[15],SGData,Uvec,Trans,maxequiv,maximal)) magcells.append(phase) dlg.Destroy() def OnRunSubsMag(event): import kSUBGROUPSMAG as kMAG import SUBGROUPS as kSUB G2frame.dataWindow.RunSubGroups.Enable(False) pUCid = G2gd.GetGPXtreeItemId(G2frame,G2frame.PatternId, 'Unit Cells List') doi: 10.1146/annurev-matsci-070214-021008''',caption='Bilbao k-SUBGROUPSMAG',style=wx.ICON_INFORMATION) MAXMAGN = kMAG.GetNonStdSubgroupsmag(SGData,kvec[:9],star,Landau,maximal) MAXMAGN,baseList = kSUB.GetNonStdSubgroupsmag(SGData,kvec[:9],star,Landau) wx.EndBusyCursor() if MAXMAGN is None: return controls[14] = kvec[:9] controls[16] = baseList dlg = wx.ProgressDialog('k-SUBGROUPSMAG results','Processing '+MAXMAGN[0][0],len(MAXMAGN), style = wx.PD_ELAPSED_TIME|wx.PD_AUTO_HIDE|wx.PD_REMAINING_TIME) for ir,result in enumerate(MAXMAGN): # result is SPGP,BNS,MV,itemList,altList,superList dlg.Update(ir,newmsg='Processing '+result[0]) if result[0].strip().endswith("1'"):    #skip gray groups continue numbs = [eval(item+'.') for item in result[2].split()] Uvec = np.array(numbs[3::4]) Trans = np.array([numbs[:3],numbs[4:7],numbs[8:11]]).T         #Bilbao gives transpose Trans = np.array(eval(result[2][0])) Uvec = np.array(eval(result[2][1])) phase = G2lat.makeBilbaoPhase(result[:2],Uvec,Trans,True) phase['gid'] = result[3] phase['altList'] = result[4] phase['supList'] = eval(result[5]) RVT = None if keepaxes: if RVT is not None: result,Uvec,Trans = RVT phase = G2lat.makeBilbaoPhase(result,Uvec,Trans,True) phase.update(G2lat.makeBilbaoPhase(result,Uvec,Trans,True)) phase['Cell'] = G2lat.TransformCell(controls[6:12],Trans) phase['aType'] = atype phase['magAtms'] = magAtms phase['maxequiv'] = maxequiv phase['nAtoms'] = len(TestMagAtoms(phase,magAtms,SGData,Uvec,Trans,allmom,maxequiv)) phase['nAtoms'] = len(TestMagAtoms(phase,magAtms,SGData,Uvec,Trans,allmom,maxequiv,maximal)) magcells.append(phase) dlg.Destroy() if len(controls) < 14:              #add space group if missing controls.append(spaceGroups[bravaisSymb.index(controls[5])]) if len(controls) < 17: controls.append(range(1,len(magcells)+1)) if len(bravais) < 16: bravais += [0,0,] gridDisplay.SetReadOnly(r,c,isReadOnly=True) mainSizer.Add(gridDisplay,0,WACV) if magcells: if magcells: itemList = [phase.get('gid',ip+1) for ip,phase in enumerate(magcells)] phaseDict = dict(zip(itemList,magcells)) G2frame.dataWindow.CopyCell.Enable(False) kvec1 = ','.join(controls[14][:3]) kvec2 = ','.join(controls[14][3:6]) kvec3 = ','.join(controls[14][6:]) baseList = controls[16] if 'magAtms' in magcells[0]: G2frame.dataWindow.RunSubGroupsMag.Enable(True) Label += ':' mainSizer.Add(wx.StaticText(parent=G2frame.dataWindow,label=Label),0,WACV) rowLabels = [] for i in range(len(magcells)): rowLabels.append(str(i+1)) colLabels = ['Space Gp','Try','Keep','Uniq','Trans','Vec','a','b','c','alpha','beta','gamma','Volume'] 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,]+ \ rowLabels = [str(i+1) for i in range(len(baseList))] colLabels = ['Space Gp','Try','Keep','Uniq','nConj','nSup','Trans','Vec','a','b','c','alpha','beta','gamma','Volume'] Types = [wg.GRID_VALUE_STRING,]+2*[wg.GRID_VALUE_BOOL,]+3*[wg.GRID_VALUE_LONG,]+2*[wg.GRID_VALUE_STRING,]+ \ 3*[wg.GRID_VALUE_FLOAT+':10,5',]+3*[wg.GRID_VALUE_FLOAT+':10,3',]+[wg.GRID_VALUE_FLOAT+':10,2'] table = [] for phase in magcells: for ip in baseList: phase = phaseDict[ip] natms = phase.get('nAtoms',1) try: nConj = len(phase['altList']) nSup = len(phase['supList']) except KeyError: nConj = 0 nSup = 0 cell  = list(phase['Cell']) trans = G2spc.Trans2Text(phase['Trans']) vec = G2spc.Latt2text([phase['Uvec'],]) row = [phase['Name'],phase['Use'],phase['Keep'],natms,trans,vec]+cell row = [phase['Name'],phase['Use'],phase['Keep'],natms,nConj,nSup,trans,vec]+cell table.append(row) MagCellsTable = G2G.Table(table,rowLabels=rowLabels,colLabels=colLabels,types=Types)
• ## trunk/GSASIIspc.py

 r3710 '31m':['(00g)','(1/31/3g)'], '6/m':['(00g)',], '6/mmm':['(00g)',]} '6/mmm':['(00g)',], 'm3':['',],'m3m':['',]} laueTS = {'-1':['',], '31m':['','t00','0ss'], '6/m':['','h','t','s','s0'], '6/mmm':['','h00','t00','s00','ss0','0ss','s0s','s0s0','00ss','s00s','ss00','0ss0','0s0s']} '6/mmm':['','h00','t00','s00','ss0','0ss','s0s','s0s0','00ss','s00s','ss00','0ss0','0s0s'], 'm3':['',],'m3m':['',]} laue = SGData['SGLaue'] SSChoice = [] dM = posFourier(tau,nH,delt6[:3],delt6[3:]) #+np.array(Mxyz)[:,nxs,nxs] dMTP = [] CSI = [[1,0,0],[2,0,0],[3,0,0], [4,0,0],[5,0,0],[6,0,0]],6*[[1.,0.,0.],] CSI = [np.zeros((6,3),dtype='i'),np.zeros((6,3))] print(siteSym) if siteSym == '1': CSI = [[1,0,0],[2,0,0],[3,0,0],[4,0,0],[5,0,0],[6,0,0]],6*[[1.,0.,0.],] elif siteSym in ['-1',]: elif siteSym in ['-1','mmm',]: CSI = 3*[[0,0,0],]+[[1,0,0],[2,0,0],[3,0,0]],3*[[0.,0.,0.],]+3*[[1.,0.,0.],] elif siteSym in ['4(z)','422(z)']: CSI[0][0][0] = CSI[0][4][1] = 1 CSI[1][0][0] = 1.0 CSI[1][4][1] = -1.0 elif siteSym in ['-4m2(z)','422(z)',]: CSI[0][5][0] = 1 CSI[1][5][0] = 1.0 elif siteSym in ['-32(100)',]: CSI[0][2][0] = 1 CSI[1][2][0] = 1.0 elif siteSym in ['3',]: CSI[0][0][0] = CSI[0][3][0] = CSI[0][4][0] = 1 CSI[1][0][0] = -np.sqrt(3.0) CSI[1][3][0] = 2.0 CSI[1][4][0] = 1.0 elif siteSym in ['622','2(100)',]: CSI[0][0][0] = CSI[0][1][0] = CSI[0][3][0] = 1 CSI[1][0][0] = 1.0 CSI[1][1][0] = 2.0 CSI[1][3][0] = np.sqrt(3.0) else: #3x6x12 modulated moment array (M,Spos,tau)& force positive dMTP.append(dMT) for i in range(3): if not np.allclose(dM[i,i,:],-dMT[i,i,:]): if 'm(' in siteSym and not np.allclose(dM[i,i,:],-dMT[i,i,:]): msc[i] = 0 if not np.allclose(dM[i,i+3,:],-dMT[i,i+3,:]): elif '2(' in siteSym and not np.allclose(dM[i,i,:],dMT[i,i,:]): msc[i] = 0 if 'm(' in siteSym and not np.allclose(dM[i,i+3,:],-dMT[i,i+3,:]): msc[i+3] = 0 elif '2(' in siteSym and not np.allclose(dM[i,i+3,:],dMT[i,i+3,:]): msc[i+3] = 0 if np.any(dtau%.5) and ('1/2' in SSGData['modSymb'] or '1' in SSGData['modSymb']): CSI[1][3:] = [0.,0.,0.],[0.,0.,0.],[0.,0.,0.] if '4/mmm' in laue: if siteSym in ['4/mmm(z)',]: CSI = 3*[[0,0,0],]+[[0,0,0],[0,0,0],[1,0,0]],3*[[0.,0.,0.],]+3*[[1.,0.,0.],] if np.any(dtau%.5) and '1/2' in SSGData['modSymb']: if '(xy)' in siteSym:
• ## trunk/kSUBGROUPSMAG.py

 r3686 elif tag == 'pre': self.in_pre = False self.MVs.append(self.MV.replace('\n',' ')) #            print('MV:') #            print(self.MV) MV = self.MV.split() MV = ['[[%s,%s,%s],[%s,%s,%s],[%s,%s,%s]]'%(MV[0],MV[4],MV[8],MV[1],MV[5],MV[9],MV[2],MV[6],MV[10]),'[%s.,%s.,%s.]'%(MV[3],MV[7],MV[11])] self.MVs.append(MV) #            print('MV:',self.MV) elif tag == 'sub': self.in_sub = False page = '' print('connection error - not on internet') return None return None,None if r.status_code == 200: print('request OK') page = '' print('request failed. Reason=',r.reason) return None return None,None r.close() p = TableParser() p.feed(page) result = list(zip(p.SPGPs,p.BNSs,p.MVs)) return result nItms = len(p.MVs) result = list(zip(p.SPGPs,p.BNSs,p.MVs,range(nItms),nItms*[[],],nItms*['[]',])) return result,range(nItms) def GetNonStdSubgroups(SGData, kvec,star=False,landau=False,maximal=False): p = TableParser() p.feed(page) result = list(zip(p.SPGPs,p.MVs)) return result nItms = len(p.MVs) result = list(zip(p.SPGPs,p.MVs,range(nItms),range(nItms),nItms*[0,])) return result,range(nItms) def test(): SGData = G2spc.SpcGroup('p -3 m 1')[1] results = GetNonStdSubgroupsmag(SGData,('1/3','1/3','1/2',' ',' ',' ',' ',' ',' ',' ')) results,baseList = GetNonStdSubgroupsmag(SGData,('1/3','1/3','1/2',' ',' ',' ',' ',' ',' ',' ')) if results: for spgp,bns,mv in results: print('Space group:',spgp, 'BNS:',bns) print('MV') print(mv) results = GetNonStdSubgroups(SGData,('1/3','1/3','1/2',' ',' ',' ',' ',' ',' ',' ')) for [spgp,mv,bns,gid,altList,supList] in results: if gid in baseList: print('Space group:',spgp, 'BNS:',bns) print('MV') print(mv) results,baseList = GetNonStdSubgroups(SGData,('1/3','1/3','1/2',' ',' ',' ',' ',' ',' ',' ')) if results: for spgp,mv in results: print('Space group:',spgp) print('MV') print(mv) for [spgp,mv,gid,altList,supList] in results: if gid in baseList: print('Space group:',spgp) print('MV') print(mv)
Note: See TracChangeset for help on using the changeset viewer.