Changeset 5475
- Timestamp:
- Jan 16, 2023 10:08:28 AM (11 months ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIconstrGUI.py
r5464 r5475 3904 3904 Size[1] = max(Size[1],450) + 20 3905 3905 ResidueRB.SetSize(Size) 3906 #ResidueRB.SetScrollbars(10,10,int(Size[0]/10-4),int(Size[1]/10-1)) # dataframe already scrolls3906 ResidueRB.SetScrollbars(10,10,int(Size[0]/10-4),int(Size[1]/10-1)) # dataframe already scrolls 3907 3907 G2frame.dataWindow.SendSizeEvent() 3908 3908 -
trunk/GSASIIlattice.py
r5472 r5475 2120 2120 ''' 2121 2121 if M <= L: 2122 if sytsym == '23': #cubics use different Fourier expansion than those below 2122 if sytsym == '53m': 2123 if not L%2 and M > 0: 2124 if L in [6,10,12,16,18]: 2125 if L%12 == 2: 2126 if M <= L//12: return True,1.0 2127 else: 2128 if M <= L//12+1: return True,1.0 2129 elif sytsym == '23': #cubics use different Fourier expansion than those below 2123 2130 if 2 < L < 11 and [L,M] in [[3,1],[4,1],[6,1],[6,2],[7,1],[8,1],[9,1],[9,2],[10,1],[10,2]]: 2124 2131 return True,1.0 … … 2232 2239 return False,0. 2233 2240 2234 def RBsymChk(RBsym,cubic,coefNames ):2241 def RBsymChk(RBsym,cubic,coefNames,L=18): 2235 2242 '''imposes rigid body symmetry on spherical harmonics terms 2236 2243 Key problem is noncubic RB symmetries in cubic site symmetries & vice versa. … … 2274 2281 newSgns.append(sgn) 2275 2282 else: 2276 for name in coefNames: 2277 LM = eval(name[1:]) 2278 if RBsym in ['m3m','-43m']: 2279 cubNames,sgns = GenShCoeff(RBsym,LM[0]) 2280 print(name,LM[0],cubNames) 2281 M = [] 2282 for cname in cubNames: 2283 LMc = eval(cname[1:-1]) 2284 if (LMc[0]+LMc[1])%2: #even L odd M or vv 2285 if LMc[0]%2: 2286 M += [4*m for m in range(LMc[0]//2)[1:] if 4*m <= LMc[0]] 2287 else: 2288 M += [4*m for m in range(LMc[0]//2) if 4*m <= LMc[0]] 2289 else: #both even or both odd 2290 M += [4*m+2 for m in range(LMc[0]//2) if 4*m+2 <= LMc[0]] 2291 for m in M: 2292 rbChk,sgn = RBChk(RBsym,LM[0],m) 2293 if rbChk: 2294 newname = 'C(%d,%d)'%(LM[0],m) 2295 if newname not in newNames: 2296 newNames.append(newname) 2297 newSgns.append(sgn) 2298 print(name,cubNames,M) 2299 else: 2283 if RBsym in ['m3m','-43m','53m']: #force mol. sym. here 2284 for L in range(L+1): 2285 cubNames,cubSgns = GenShCoeff(RBsym,L) 2286 newNames += cubNames 2287 newSgns += cubSgns 2288 else: 2289 for name in coefNames: 2290 LM = eval(name[1:]) 2300 2291 rbChk,sgn = RBChk(RBsym,LM[0],LM[1]) 2301 2292 if rbChk: … … 2325 2316 if RBsym == '1': 2326 2317 return coefNames,coefSgns 2327 newNames,newSgns = RBsymChk(RBsym,cubic,coefNames )2318 newNames,newSgns = RBsymChk(RBsym,cubic,coefNames,L) 2328 2319 return newNames,newSgns 2329 2320 … … 2332 2323 coefSgns = [] 2333 2324 cubic = False 2334 if sytsym in ['23','m3','432','-43m','m3m' ]:2325 if sytsym in ['23','m3','432','-43m','m3m','53m']: 2335 2326 cubic = True 2336 2327 for n in range(L+1): … … 2342 2333 coefNames.append('C(%d,%d)'%(L,n)) 2343 2334 coefSgns.append(sgn) 2344 newNames,newSgns = RBsymChk(sytsym,cubic,coefNames )2335 newNames,newSgns = RBsymChk(sytsym,cubic,coefNames,L) 2345 2336 return newNames,newSgns 2346 2337 -
trunk/GSASIIphsGUI.py
r5472 r5475 11336 11336 wx.CallAfter(G2ddG.UpdateDData,G2frame,DData,data) 11337 11337 11338 #### #Rigid bodies ################################################################################11338 #### Rigid bodies ################################################################################ 11339 11339 def FillRigidBodyGrid(refresh=True,vecId=None,resId=None,spnId=None): 11340 11340 '''Fill the Rigid Body Phase information tab page. … … 11434 11434 data['Atoms'] = G2lat.RBsymCheck(data['Atoms'],ct,cx,cs,AtLookUp,Amat,RBObj['Ids'],SGData) 11435 11435 data['Drawing']['Atoms'] = [] 11436 UpdateDrawAtoms( atomStyle)11436 UpdateDrawAtoms() 11437 11437 G2plt.PlotStructure(G2frame,data) 11438 11438 … … 11458 11458 data['Atoms'] = G2lat.RBsymCheck(data['Atoms'],ct,cx,cs,AtLookUp,Amat,RBObj['Ids'],SGData) 11459 11459 data['Drawing']['Atoms'] = [] 11460 UpdateDrawAtoms( atomStyle)11460 UpdateDrawAtoms() 11461 11461 G2plt.PlotStructure(G2frame,data) 11462 11462 except ValueError: … … 11524 11524 wx.CallAfter(FillRigidBodyGrid,True) 11525 11525 11526 def OnSymRadioSet(event): 11527 '''Set the polar axis for the sp. harm. as 11528 RBdata['Spin'][RBId]['symAxis']. This may never be 11529 set, so use RBdata['Spin'][RBId].get('symAxis') to 11530 access this so the default value is [0,0,1]. 11531 ''' 11532 Obj = event.GetEventObject() 11533 axis = ([1,0,0],[0,1,0],[0,0,1],[1,1,0],[1,1,1])[Obj.GetSelection()] 11534 RBObj['symAxis'] = axis 11535 G2plt.PlotStructure(G2frame,data) 11536 11526 11537 def OnAddShell(event): 11527 11538 RBId = G2gd.GetGPXtreeItemId(G2frame, G2frame.root, 'Rigid bodies') … … 11553 11564 for name in ['atColor','atType','Natoms','nSH','radius','RBname','RBsym']: 11554 11565 data['RBModels']['Spin'][-1][name].append(rbData[name]) 11566 G2plt.PlotStructure(G2frame,data) 11555 11567 wx.CallAfter(FillRigidBodyGrid,True,spnId=rbId) 11556 11568 … … 11650 11662 sprbSizer.Add(topLine) 11651 11663 sprbSizer.Add(LocationSizer(RBObj,'Spin')) 11664 choices = [' x ',' y ',' z ','x+y','x+y+z'] 11665 RBObj['symAxis'] = RBObj.get('symAxis',[0,0,1]) #set default as 'z' 11666 symax = dict(zip([str(x) for x in [[1,0,0],[0,1,0],[0,0,1],[1,1,0],[1,1,1]]],choices))[str(RBObj['symAxis'])] 11667 symRadioSet = wx.RadioBox(RigidBodies,choices=choices,label='Sp harm polar axis is aligned along:') 11668 symRadioSet.SetStringSelection(symax) 11669 symRadioSet.Bind(wx.EVT_RADIOBOX, OnSymRadioSet) 11670 Indx[symRadioSet.GetId()] = rbId 11671 sprbSizer.Add(symRadioSet) 11652 11672 sprbSizer.Add(SHsizer()) 11653 11673 return sprbSizer … … 11913 11933 nobody = False 11914 11934 resSizer = wx.BoxSizer(wx.VERTICAL) 11915 resSizer.Add(wx.StaticText(RigidBodies,label='Residue rigid bodies:'))11935 resSizer.Add(wx.StaticText(RigidBodies,label='Residue RBs:')) 11916 11936 RBnames = [] 11917 11937 resVarLookup = [] … … 11944 11964 if 'Vector' in data['RBModels'] and len(data['RBModels']['Vector']): 11945 11965 vecSizer = wx.BoxSizer(wx.VERTICAL) 11946 vecSizer.Add(wx.StaticText(RigidBodies,label='Vector rigid bodies:'))11966 vecSizer.Add(wx.StaticText(RigidBodies,label='Vector RBs:')) 11947 11967 nobody = False 11948 11968 RBnames = [] … … 11973 11993 if 'Spin' in data['RBModels'] and len(data['RBModels']['Spin']): 11974 11994 spnSizer = wx.BoxSizer(wx.VERTICAL) 11975 spnSizer.Add(wx.StaticText(RigidBodies,label='Spinning rigid bodies:'))11995 spnSizer.Add(wx.StaticText(RigidBodies,label='Spinning RBs:')) 11976 11996 nobody = False 11977 11997 RBnames = [] -
trunk/GSASIIplot.py
r5471 r5475 10313 10313 radius = SpnData['radius'] 10314 10314 atColor = SpnData['atColor'] 10315 Q = G2mth.invQ(SpnData['Orient'][0]) 10315 symAxis = np.array(SpnData.get('symAxis',[0,0,1])) 10316 QA = G2mth.invQ(SpnData['Orient'][0]) 10317 QB = G2mth.make2Quat(np.array([0,0,1.]),symAxis)[0] 10318 Q = G2mth.prodQQ(QB,QA) 10316 10319 Npsi,Ngam = 60,30 #seems acceptable - don't use smaller! 10317 10320 PSI,GAM = np.mgrid[0:Npsi,0:Ngam] #[azm,pol]
Note: See TracChangeset
for help on using the changeset viewer.