@@ -3523,8 +3523,8 @@ def PlotDeform(G2frame,general,atName,atType,deform,UVmat,radial,neigh):
35233523 RAP = G2mth .Cart2Polar (XYZ [0 ],XYZ [1 ],XYZ [2 ])
35243524 P = np .zeros ((31 ,31 ))
35253525 for shc in SHC :
3526- p = 2. * SHC [shc ][0 ]* SHC [shc ][2 ]** 3 * G2lat .KslCalc (shc ,RAP [1 ],RAP [2 ]).reshape ((31 ,31 ))
3527- P += p ** 2
3526+ p = 2. * SHC [shc ][0 ]* SHC [shc ][2 ]** 3 * ( G2lat .KslCalc (shc ,RAP [1 ],RAP [2 ]) ** 2 ).reshape ((31 ,31 ))
3527+ P += p
35283528 if not np .any (P ):
35293529 P = np .ones ((31 ,31 ))
35303530# P *= P
@@ -7353,20 +7353,21 @@ def Draw(caller='',Fade=[],NPkey=False):
73537353 defCtrls = deformationData [- atom [ci ]]
73547354 defParms = deformationData [atom [ci ]]
73557355 SytSym = G2spc .SytSym (atom [cx :cx + 3 ],SGData )[0 ]
7356+ SGM = np .array (G2spc .GetOpFromCode (atom [cs - 1 ],SGData )[0 ])
73567357 if defCtrls .get ('showDef' ,False ) and defCtrls ['Radial' ] == 'Slater' :
73577358 useAtColor = defCtrls .get ('atColor' ,True )
73587359 atcolor = None
73597360 if useAtColor :
73607361 atcolor = atColor * 255
73617362 SHC = defParms [0 ][1 ]
73627363 SHC = {item .replace ('D' ,'C' ):SHC [item ] for item in SHC if item not in ['Ne' ,'kappa' ]}
7363- UVMat = defCtrls ['UVmat' ]
7364+ UVMat = np . inner ( SGM . T , defCtrls ['UVmat' ])
73647365 Npsi ,Ngam = 90 ,45
73657366 PSI ,GAM = np .mgrid [0 :Npsi ,0 :Ngam ] #[azm,pol]
73667367 PSI = PSI .flatten ()* 360. / Npsi #azimuth 0-360 ncl
73677368 GAM = GAM .flatten ()* 180. / Ngam #polar 0-180 incl
7368- Rp ,PSIp ,GAMp = G2mth .RotPolbyM (np .ones_like (PSI ),PSI ,GAM ,UVMat )
7369- P = G2lat .SHarmcal (SytSym ,SHC ,PSIp ,GAMp ).reshape ((Npsi ,Ngam ))
7369+ Rp ,PSIp ,GAMp = G2mth .RotPolbyM (np .ones_like (PSI ),PSI ,GAM ,UVMat ) #TODO: needs symmetry operation for equiv. positions
7370+ P = G2lat .SHarmcal (SytSym ,SHC ,PSIp ,GAMp ).reshape ((Npsi ,Ngam ))** 2
73707371 if np .min (P ) < np .max (P ):
73717372 P = (P - np .min (P ))/ (np .max (P )- np .min (P ))
73727373 RenderTextureSphere (x ,y ,z ,radius ,atcolor ,shape = [Npsi ,Ngam ],Texture = P .T ,ifFade = False )
0 commit comments