Changeset 1817


Ignore:
Timestamp:
Apr 28, 2015 1:28:45 PM (7 years ago)
Author:
vondreele
Message:

Add plotting of all HKLF data sets together in one 3D plot

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIgrid.py

    r1815 r1817  
    144144] = [wx.NewId() for item in range(12)]
    145145
    146 [ wxID_SELECTPHASE,wxID_PWDHKLPLOT,wxID_PWD3DHKLPLOT,
    147 ] = [wx.NewId() for item in range(3)]
     146[ wxID_SELECTPHASE,wxID_PWDHKLPLOT,wxID_PWD3DHKLPLOT,wxID_3DALLHKLPLOT,
     147] = [wx.NewId() for item in range(4)]
    148148
    149149[ wxID_PDFCOPYCONTROLS, wxID_PDFSAVECONTROLS, wxID_PDFLOADCONTROLS,
     
    13411341        self.ErrorAnal.Append(id=wxID_PWD3DHKLPLOT,kind=wx.ITEM_NORMAL,text='Plot 3D HKLs',
    13421342            help='Plot HKLs from single crystal data in 3D')
    1343            
     1343        self.ErrorAnal.Append(id=wxID_3DALLHKLPLOT,kind=wx.ITEM_NORMAL,text='Plot all 3D HKLs',
     1344            help='Plot HKLs from all single crystal data in 3D')
    13441345        self.ErrorAnal.Append(id=wxID_PWDCOPY,kind=wx.ITEM_NORMAL,text='Copy params',
    13451346            help='Copy of HKLF parameters')
     
    35593560        G2plt.Plot3DSngl(G2frame,newPlot=True,Data=controls,hklRef=refList,Title=phaseName)
    35603561       
     3562    def OnPlotAll3DHKL(event):
     3563        choices = GetPatternTreeDataNames(G2frame,['HKLF',])
     3564        dlg = G2G.G2MultiChoiceDialog(G2frame, 'Select reflection sets to plot',
     3565            'Use data',choices)
     3566        try:
     3567            if dlg.ShowModal() == wx.ID_OK:
     3568                refNames = [choices[i] for i in dlg.GetSelections()]
     3569            else:
     3570                return
     3571        finally:
     3572            dlg.Destroy()
     3573        refList = np.zeros(0)
     3574        for name in refNames:
     3575            Id = GetPatternTreeItemId(G2frame,G2frame.root, name)
     3576            reflData = G2frame.PatternTree.GetItemPyData(Id)[1]
     3577            if len(refList):
     3578                refList = np.concatenate((refList,reflData['RefList']))
     3579            else:
     3580                refList = reflData['RefList']
     3581           
     3582        FoMax = np.max(refList.T[8+Super])
     3583        Hmin = np.array([int(np.min(refList.T[0])),int(np.min(refList.T[1])),int(np.min(refList.T[2]))])
     3584        Hmax = np.array([int(np.max(refList.T[0])),int(np.max(refList.T[1])),int(np.max(refList.T[2]))])
     3585        Vpoint = [int(np.mean(refList.T[0])),int(np.mean(refList.T[1])),int(np.mean(refList.T[2]))]
     3586        controls = {'Type' : 'Fosq','Iscale' : False,'HKLmax' : Hmax,'HKLmin' : Hmin,
     3587            'FoMax' : FoMax,'Scale' : 1.0,'Drawing':{'viewPoint':[Vpoint,[]],'default':Vpoint[:],
     3588            'backColor':[0,0,0],'depthFog':False,'Zclip':10.0,'cameraPos':10.,'Zstep':0.05,
     3589            'Scale':1.0,'oldxy':[],'viewDir':[1,0,0]},'Super':Super,'SuperVec':SuperVec}
     3590        G2plt.Plot3DSngl(G2frame,newPlot=True,Data=controls,hklRef=refList,Title=phaseName)
     3591       
     3592       
    35613593    def OnErrorAnalysis(event):
    35623594        G2plt.PlotDeltSig(G2frame,kind)
     
    36063638        G2frame.dataFrame.Bind(wx.EVT_MENU, OnErrorAnalysis, id=wxID_PWDANALYSIS)
    36073639        G2frame.dataFrame.Bind(wx.EVT_MENU, OnPlot3DHKL, id=wxID_PWD3DHKLPLOT)
     3640        G2frame.dataFrame.Bind(wx.EVT_MENU, OnPlotAll3DHKL, id=wxID_3DALLHKLPLOT)
    36083641#        G2frame.dataFrame.Bind(wx.EVT_MENU, onCopySelectedItems, id=wxID_PWDCOPY)
    36093642    G2frame.dataDisplay = wx.Panel(G2frame.dataFrame)
Note: See TracChangeset for help on using the changeset viewer.