Changeset 3150
- Timestamp:
- Nov 4, 2017 10:14:33 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIplot.py
r3138 r3150 3604 3604 if r <= 1.0: 3605 3605 if 'equal' in G2frame.Projection: 3606 r,p = 2.*npasind(np.sqrt(r)*sq2),npatan2d( ypos,xpos)3606 r,p = 2.*npasind(np.sqrt(r)*sq2),npatan2d(xpos,ypos) 3607 3607 else: 3608 r,p = 2.*npatand(np.sqrt(r)),npatan2d( ypos,xpos)3608 r,p = 2.*npatand(np.sqrt(r)),npatan2d(xpos,ypos) 3609 3609 if p<0.: 3610 3610 p += 360. 3611 3611 ipf = lut(r*np.pi/180.,p*np.pi/180.) 3612 xyz = np.inner(Bmat.T,np.array([rp2xyz(r,p)])) 3612 p = 90.-p 3613 if p<0.: 3614 p += 360. 3615 xyz = np.inner(Bmat,np.array([rp2xyz(r,p)])) 3613 3616 x,y,z = list(xyz/np.max(np.abs(xyz))) 3614 3617 G2frame.G2plotNB.status.SetStatusText( … … 3649 3652 PHI = np.linspace(0.,360.,30,True) 3650 3653 PSI = np.linspace(0.,180.,30,True) 3651 X = np.outer(np sind(PHI),npsind(PSI))3652 Y = np.outer(np cosd(PHI),npsind(PSI))3654 X = np.outer(npcosd(PHI),npsind(PSI)) 3655 Y = np.outer(npsind(PHI),npsind(PSI)) 3653 3656 Z = np.outer(np.ones(np.size(PHI)),npcosd(PSI)) 3654 3657 try: #temp patch instead of 'mustrain' for old files with 'microstrain' … … 3799 3802 Rmd = np.where(Rmd<0.,0.,Rmd) 3800 3803 if 'equal' in G2frame.Projection: 3801 x,y = np. tan(Beta/2.)*np.cos(Phi),np.tan(Beta/2.)*np.sin(Phi)3804 x,y = np.sin(Beta)*np.cos(Phi),np.sin(Beta)*np.sin(Phi) 3802 3805 else: 3803 3806 x,y = np.tan(Beta/2.)*np.cos(Phi),np.tan(Beta/2.)*np.sin(Phi) … … 3805 3808 npts = 201 3806 3809 X,Y = np.meshgrid(np.linspace(1.,-1.,npts),np.linspace(-1.,1.,npts)) 3807 R,P = np.sqrt(X**2+Y**2).flatten(),npatan2d( X,Y).flatten()3810 R,P = np.sqrt(X**2+Y**2).flatten(),npatan2d(Y,X).flatten() 3808 3811 P=np.where(P<0.,P+360.,P) 3809 3812 if 'equal' in G2frame.Projection: … … 3822 3825 sfac *= 1.05 3823 3826 Z = [lut(ri*np.pi/180.,p*np.pi/180.) for ri,p in zip(list(R),list(P))] 3824 print ('IVP for histogramn: %s: interpolate sfactor: %.2f'%(hist,sfac))3827 # print ('IVP for histogramn: %s: interpolate sfactor: %.2f'%(hist,sfac)) 3825 3828 except AttributeError: 3826 3829 G2frame.G2plotNB.Delete(plotType) … … 3836 3839 acolor = mpl.cm.get_cmap(G2frame.ContourColor) 3837 3840 Img = Plot.imshow(Z.T,aspect='equal',cmap=acolor,extent=[-1,1,-1,1]) 3838 Plot.plot( -x,y,'+',picker=3)3841 Plot.plot(y,x,'+',picker=3) 3839 3842 Page.figure.colorbar(Img) 3840 3843 Plot.axis('off') … … 3882 3885 if r <= 1.0: 3883 3886 if 'equal' in G2frame.Projection: 3884 r,p = 2.*npasind(np.sqrt(r)*sq2),npatan2d( ypos,xpos)3887 r,p = 2.*npasind(np.sqrt(r)*sq2),npatan2d(xpos,ypos) 3885 3888 else: 3886 r,p = 2.*npatand(np.sqrt(r)),npatan2d( ypos,xpos)3889 r,p = 2.*npatand(np.sqrt(r)),npatan2d(xpos,ypos) 3887 3890 ipf = G2lat.invpolfcal(IODFln,SGData,np.array([r,]),np.array([p,])) 3888 3891 xyz = np.inner(Bmat,np.array([rp2xyz(r,p)])) 3889 y,x,z = list(xyz/np.max(np.abs(xyz)))3892 x,y,z = list(xyz/np.max(np.abs(xyz))) 3890 3893 3891 3894 G2frame.G2plotNB.status.SetStatusText( … … 3943 3946 if 'Inverse' in SHData['PlotType']: 3944 3947 X,Y = np.meshgrid(np.linspace(1.,-1.,npts),np.linspace(-1.,1.,npts)) 3945 R,P = np.sqrt(X**2+Y**2).flatten(),npatan2d( X,Y).flatten()3948 R,P = np.sqrt(X**2+Y**2).flatten(),npatan2d(Y,X).flatten() 3946 3949 if 'equal' in G2frame.Projection: 3947 3950 R = np.where(R <= 1.,2.*npasind(R*sq2),0.0)
Note: See TracChangeset
for help on using the changeset viewer.