@@ -3492,6 +3492,7 @@ def OnKeyPress(event):
34923492def PlotDeform (G2frame ,general ,atName ,atType ,deform ,UVmat ,radial ,neigh ):
34933493 ''' Plot deformation atoms & neighbors
34943494 '''
3495+ Bohr = 0.529177
34953496 SHC = {}
34963497 for item in deform :
34973498 if 'Be' in radial and 'Sl' not in item [0 ]:
@@ -3526,8 +3527,8 @@ def PlotDeform(G2frame,general,atName,atType,deform,UVmat,radial,neigh):
35263527 p = 2. * SHC [shc ][0 ]* SHC [shc ][2 ]** 3 * (G2lat .KslCalc (shc ,RAP [1 ],RAP [2 ])** 2 ).reshape ((31 ,31 ))
35273528 P += p
35283529 if not np .any (P ):
3529- P = np .ones ((31 ,31 ))
3530- # P *= P
3530+ P = np .zeros ((31 ,31 ))
3531+ P += Bohr
35313532 color = np .array (general ['Color' ][general ['AtomTypes' ].index (atType )])/ 255.
35323533 Plot .plot_surface (X * P ,Y * P ,Z * P ,rstride = 1 ,cstride = 1 ,color = color ,linewidth = 1 )
35333534 for atm in neigh [0 ]:
@@ -7363,12 +7364,12 @@ def Draw(caller='',Fade=[],NPkey=False):
73637364 SHC = {item .replace ('D' ,'C' ):SHC [item ] for item in SHC if item not in ['Ne' ,'kappa' ]}
73647365 SGC = G2lat .CrysM2CartM (Amat ,Bmat ,SGM )
73657366 UVMat = np .inner (defCtrls ['UVmat' ],SGC )
7366- Npsi ,Ngam = 90 , 45
7367+ Npsi ,Ngam = 91 , 46
73677368 PSI ,GAM = np .mgrid [0 :Npsi ,0 :Ngam ] #[azm,pol]
7368- PSI = PSI .flatten ()* 360. / Npsi #azimuth 0-360 incl
7369- GAM = GAM .flatten ()* 180. / Ngam #polar 0-180 incl
7369+ PSI = PSI .flatten ()* 360. / ( Npsi - 1 ) #azimuth 0-360 incl
7370+ GAM = GAM .flatten ()* 180. / ( Ngam - 1 ) #polar 0-180 incl
73707371 Rp ,PSIp ,GAMp = G2mth .RotPolbyM (np .ones_like (PSI ),PSI ,GAM ,UVMat ) #TODO: needs symmetry operation for equiv. positions
7371- P = G2lat .SHarmcal (SytSym ,SHC ,PSIp ,GAMp ).reshape ((Npsi ,Ngam ))** 2
7372+ P = G2lat .SHarmcal (SytSym ,SHC ,PSIp ,GAMp ).reshape ((Npsi ,Ngam ))
73727373 if np .min (P ) < np .max (P ):
73737374 P = (P - np .min (P ))/ (np .max (P )- np .min (P ))
73747375 RenderTextureSphere (x ,y ,z ,radius ,atcolor ,shape = [Npsi ,Ngam ],Texture = P .T ,ifFade = False )
0 commit comments