Changeset 3153 for trunk/GSASIIplot.py
 Timestamp:
 Nov 13, 2017 2:31:44 PM (4 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/GSASIIplot.py
r3151 r3153 3583 3583 3584 3584 def OnPick(event): 3585 if plotType not in ['Inv. pole figure',]:3585 if 'Inv. pole figure' not in plotType: 3586 3586 return 3587 3587 ind = event.ind[0] … … 3596 3596 3597 3597 def OnMotion(event): 3598 if plotType not in ['Inv. pole figure',]:3598 if 'Inv. pole figure' not in plotType: 3599 3599 return 3600 3600 if event.xdata and event.ydata: #avoid out of frame errors … … 3603 3603 r = xpos**2+ypos**2 3604 3604 if r <= 1.0: 3605 if ' equal' in G2frame.Projection:3605 if 'Eq. area' in plotType: 3606 3606 r,p = 2.*npasind(np.sqrt(r)*sq2),npatan2d(xpos,ypos) 3607 3607 else: … … 3613 3613 if p<0.: 3614 3614 p += 360. 3615 xyz = np.inner( Bmat,np.array([rp2xyz(r,p)]))3616 x,y,z = list(xyz/np.max(np.abs(xyz)))3615 xyz = np.inner(Amat,np.array([rp2xyz(r,p)])) 3616 y,x,z = list(xyz/np.max(np.abs(xyz))) 3617 3617 G2frame.G2plotNB.status.SetStatusText( 3618 3618 'psi =%9.3f, beta =%9.3f, MRD =%9.3f hkl=%5.2f,%5.2f,%5.2f'%(r,p,ipf,x,y,z),1) … … 3629 3629 phase = generalData['Name'] 3630 3630 plotType = generalData['Data plot type'] 3631 plotDict = {'Mustrain':'Mustrain','Size':'Size','Preferred orientation':'Pref.Ori.','Inv. pole figure':''} 3631 plotDict = {'Mustrain':'Mustrain','Size':'Size','Preferred orientation':'Pref.Ori.', 3632 'St. proj. Inv. pole figure':'','Eq. area Inv. pole figure':''} 3632 3633 for ptype in plotDict: 3633 3634 G2frame.G2plotNB.Delete(ptype) … … 3759 3760 Plot.set_xlabel(r'$\psi$',fontsize=16) 3760 3761 Plot.set_ylabel('MRD',fontsize=14) 3761 elif plotType in ['Inv. pole figure',]: 3762 elif 'Inv. pole figure' in plotType: 3763 sq2 = 1.0/math.sqrt(2.0) 3762 3764 Id = G2gd.GetGPXtreeItemId(G2frame,G2frame.root,hist) 3763 3765 rId = G2gd.GetGPXtreeItemId(G2frame,Id,'Reflection Lists') … … 3801 3803 Rmd = np.array(Rmd) 3802 3804 Rmd = np.where(Rmd<0.,0.,Rmd) 3803 if ' equal' in G2frame.Projection:3804 x,y = np.sin(Beta )*np.cos(Phi),np.sin(Beta)*np.sin(Phi)3805 if 'Eq. area' in plotType: 3806 x,y = np.sin(Beta/2.)*np.cos(Phi)/sq2,np.sin(Beta/2.)*np.sin(Phi)/sq2 3805 3807 else: 3806 3808 x,y = np.tan(Beta/2.)*np.cos(Phi),np.tan(Beta/2.)*np.sin(Phi) 3807 sq2 = 1.0/math.sqrt(2.0)3808 3809 npts = 201 3809 3810 X,Y = np.meshgrid(np.linspace(1.,1.,npts),np.linspace(1.,1.,npts)) 3810 3811 R,P = np.sqrt(X**2+Y**2).flatten(),npatan2d(Y,X).flatten() 3811 3812 P=np.where(P<0.,P+360.,P) 3812 if ' equal' in G2frame.Projection:3813 if 'Eq. area' in plotType: 3813 3814 R = np.where(R <= 1.,2.*npasind(R*sq2),0.0) 3814 3815 else: 3815 3816 R = np.where(R <= 1.,2.*npatand(R),0.0) 3816 3817 Z = np.zeros_like(R) 3817 # GSASIIpath.IPyBreak()3818 3818 try: 3819 3819 sfac = 0.1 … … 3889 3889 r,p = 2.*npatand(np.sqrt(r)),npatan2d(xpos,ypos) 3890 3890 ipf = G2lat.invpolfcal(IODFln,SGData,np.array([r,]),np.array([p,])) 3891 xyz = np.inner( Bmat,np.array([rp2xyz(r,p)]))3892 x,y,z = list(xyz/np.max(np.abs(xyz)))3891 xyz = np.inner(Amat,np.array([rp2xyz(r,p)])) 3892 y,x,z = list(xyz/np.max(np.abs(xyz))) 3893 3893 3894 3894 G2frame.G2plotNB.status.SetStatusText(
Note: See TracChangeset
for help on using the changeset viewer.