Changeset 2945 for branch/2frame


Ignore:
Timestamp:
Jul 27, 2017 3:03:15 PM (8 years ago)
Author:
vondreele
Message:
 
Location:
branch/2frame
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified branch/2frame/GSASIImath.py

    r2943 r2945  
    38943894    def __init__(self):
    38953895        self.dwell = 20
    3896         self.lower = -10
    3897         self.upper = 10
     3896        self.lower = 0.
     3897        self.upper = 1.
    38983898        self.Ninit = 50
    38993899        self.accepted = 0
  • TabularUnified branch/2frame/GSASIIphsGUI.py

    r2943 r2945  
    77867786                    print ' MC/SA run completed: %d residual: %.3f%% SFcalc time: %.2fs Nsfcalc: %d'%(i,100*Result[2],tsum,nsum)
    77877787                    tsf += tsum
    7788                 print ' Structure factor time: %.2f'%(tsf)
     7788                print ' Total SF time: %.2fs'%(tsf)
    77897789                XY = np.mgrid[0:rcov.shape[0],0:rcov.shape[1]]
    7790                 G2plt.PlotXYZ(G2frame,XY,rcov,labelX='ref No.',labelY='ref No.',newPlot=False,Title='Reflection covariance matrix')
     7790                G2plt.PlotXYZ(G2frame,XY,rcov,labelX='ref No.',labelY='ref No.',newPlot=False,
     7791                    Title='Reflection covariance matrix',zrange=[-1.,1.],color='RdYlGn')
    77917792            else:
    77927793                nprocs = GSASIIpath.GetConfigValue('Multiprocessing_cores')
    77937794                Results,sftime,numsf = G2mth.MPmcsaSearch(nCyc,data,RBdata,reflType,reflData,covData,nprocs)
    77947795                MCSAdata['Results'] += Results   #+= to  any saved ones
    7795             print ' Total SF time: %.2f MC/SA run time: %.2f Nsfcalc: %d'%(sftime,time.time()-time1,numsf)
     7796                print ' Total SF time: %.2fs MC/SA run time: %.2fs Nsfcalc: %d'%(sftime,time.time()-time1,numsf)
    77967797        finally:
    77977798            if process == 'single':
  • TabularUnified branch/2frame/GSASIIplot.py

    r2940 r2945  
    29732973################################################################################
    29742974           
    2975 def PlotXYZ(G2frame,XY,Z,labelX='X',labelY='Y',newPlot=False,Title=''):
     2975def PlotXYZ(G2frame,XY,Z,labelX='X',labelY='Y',newPlot=False,Title='',zrange=None,color=None):
    29762976    '''simple contour plot of xyz data
    29772977   
     
    29832983    :param bool newPlot: =True if new plot is to be made
    29842984    :param str Title: title for plot
     2985    :param list zrange: [zmin,zmax]; default=None to use limits in Z
     2986    :param str color: one of mpl.cm.dated.keys(); default=None to use G2frame.ContourColor
    29852987    :returns: nothing
    29862988   
     
    30143016                G2frame.ContourColor = choice[sel]
    30153017            else:
    3016                 G2frame.ContourColor = GSASIIpath.GetConfigValue('Contour_color','Paired')
     3018                G2frame.ContourColor = GSASIIpath.GetConfigValue('Contour_color','RdYlGn')
    30173019            dlg.Destroy()
    30183020        wx.CallAfter(PlotXYZ,G2frame,XY,Z,labelX,labelY,False,Title)
     
    30543056    Ymin = np.min(XY.T[0])
    30553057    Ymax = np.max(XY.T[0])
    3056     Dx = 0.5*(Xmax-Xmin)/Nxy[0]
    3057     Dy = 0.5*(Ymax-Ymin)/Nxy[1]
     3058#    Dx = 0.5*(Xmax-Xmin)/Nxy[0]
     3059#    Dy = 0.5*(Ymax-Ymin)/Nxy[1]
    30583060    Plot.set_title(Title)
    30593061    if labelX:
     
    30653067    else:
    30663068        Plot.set_ylabel(r'Y',fontsize=14)
    3067     acolor = mpl.cm.get_cmap(G2frame.ContourColor)
     3069    if color is None:
     3070        acolor = mpl.cm.get_cmap(G2frame.ContourColor)
     3071    else:
     3072        acolor = mpl.cm.get_cmap(color)
     3073    if zrange is None:
     3074        zrange=[0,Zmax*G2frame.Cmax]
    30683075    Img = Plot.imshow(Z.T,cmap=acolor,interpolation=G2frame.Interpolate,origin='lower', \
    3069         aspect='equal',extent=[Xmin,Xmax,Ymin,Ymax],vmin=0,vmax=Zmax*G2frame.Cmax)
    3070 #        aspect='equal',extent=[Xmin-Dx,Xmax-Dx,Ymin+Dy,Ymax+Dy],vmin=0,vmax=Zmax*G2frame.Cmax)
     3076        aspect='equal',extent=[Xmin,Xmax,Ymin,Ymax],vmin=zrange[0],vmax=zrange[1])
    30713077    Page.figure.colorbar(Img)
    30723078    if not newPlot:
Note: See TracChangeset for help on using the changeset viewer.