Changeset 2374 for trunk/GSASIIplot.py
- Timestamp:
- Jul 13, 2016 10:19:55 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIplot.py
r2372 r2374 3033 3033 r = xpos**2+ypos**2 3034 3034 if r <= 1.0: 3035 r,p = 2.*npatand(np.sqrt(r)),npatan2d(ypos,xpos) #stereoproj. 3035 if 'equal' in G2frame.Projection: 3036 r,p = 2.*npasind(np.sqrt(r)*sq2),npatan2d(ypos,xpos) 3037 else: 3038 r,p = 2.*npatand(np.sqrt(r)),npatan2d(ypos,xpos) 3036 3039 if p<0.: 3037 3040 p += 360. … … 3235 3238 Rmd = np.array(Rmd) 3236 3239 Rmd = np.where(Rmd<0.,0.,Rmd) 3237 x,y = np.tan(Beta/2.)*np.cos(Phi),np.tan(Beta/2.)*np.sin(Phi) 3240 if 'equal' in G2frame.Projection: 3241 x,y = np.tan(Beta/2.)*np.cos(Phi),np.tan(Beta/2.)*np.sin(Phi) 3242 else: 3243 x,y = np.tan(Beta/2.)*np.cos(Phi),np.tan(Beta/2.)*np.sin(Phi) 3238 3244 sq2 = 1.0/math.sqrt(2.0) 3239 3245 npts = 201 … … 3241 3247 R,P = np.sqrt(X**2+Y**2).flatten(),npatan2d(X,Y).flatten() 3242 3248 P=np.where(P<0.,P+360.,P) 3243 R = np.where(R <= 1.,2.*npatand(R),0.0) 3249 if 'equal' in G2frame.Projection: 3250 R = np.where(R <= 1.,2.*npasind(R*sq2),0.0) 3251 else: 3252 R = np.where(R <= 1.,2.*npatand(R),0.0) 3244 3253 Z = np.zeros_like(R) 3245 3254 # GSASIIpath.IPyBreak() 3246 3255 try: 3247 sfac = 0. 53256 sfac = 0.1 3248 3257 while True: 3249 3258 try: … … 3253 3262 sfac *= 1.05 3254 3263 Z = [lut(r*np.pi/180.,p*np.pi/180.) for r,p in zip(list(R),list(P))] 3264 print 'IVP for histogramn: %s: interpolate sfactor: %.2f'%(hist,sfac) 3255 3265 except AttributeError: 3256 print 'scipy needs to be 0.11.0 or newer' 3266 G2frame.G2plotNB.Delete(plotType) 3267 G2G.G2MessageBox(G2frame,'IVP interpolate error: scipy needs to be 0.11.0 or newer', 3268 'IVP error') 3257 3269 return 3258 3270 Z = np.reshape(Z,(npts,npts))
Note: See TracChangeset
for help on using the changeset viewer.