Changeset 2374 for trunk/GSASIIplot.py


Ignore:
Timestamp:
Jul 13, 2016 10:19:55 AM (7 years ago)
Author:
vondreele
Message:

more work on histogram IVP plotting

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIplot.py

    r2372 r2374  
    30333033            r = xpos**2+ypos**2
    30343034            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)
    30363039                if p<0.:
    30373040                    p += 360.
     
    32353238        Rmd = np.array(Rmd)
    32363239        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)       
    32383244        sq2 = 1.0/math.sqrt(2.0)
    32393245        npts = 201
     
    32413247        R,P = np.sqrt(X**2+Y**2).flatten(),npatan2d(X,Y).flatten()
    32423248        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)
    32443253        Z = np.zeros_like(R)
    32453254#        GSASIIpath.IPyBreak()
    32463255        try:
    3247             sfac = 0.5
     3256            sfac = 0.1
    32483257            while True:
    32493258                try:
     
    32533262                    sfac *= 1.05
    32543263            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)
    32553265        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')
    32573269            return       
    32583270        Z = np.reshape(Z,(npts,npts))
Note: See TracChangeset for help on using the changeset viewer.