Changeset 3761 for trunk/GSASIIpwdGUI.py


Ignore:
Timestamp:
Dec 12, 2018 2:38:33 PM (4 years ago)
Author:
vondreele
Message:

avoid replotting structure if atom refine flags are changed
add new plot for structure factors as 1D stick diagram - work in progress

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIpwdGUI.py

    r3753 r3761  
    44044404    if 'UsrReject' in Controls:
    44054405        dMin = Controls['UsrReject'].get('MinD',0.05)
     4406
     4407    def OnPlot1DHKL(event):
     4408        phaseName = G2frame.RefList
     4409        if phaseName not in ['Unknown',]:
     4410            pId = G2gd.GetGPXtreeItemId(G2frame,G2frame.root,'Phases')
     4411            phaseId =  G2gd.GetGPXtreeItemId(G2frame,pId,phaseName)
     4412            General = G2frame.GPXtree.GetItemPyData(phaseId)['General']
     4413            Super = General.get('Super',0)
     4414        else:
     4415            Super = 0
     4416        if 'list' in str(type(data)):   #single crystal data is 2 dict in list
     4417            refList = data[1]['RefList']
     4418        else:                           #powder data is a dict of dicts; each same structure as SC 2nd dict
     4419            if 'RefList' in data[phaseName]:
     4420                refList = np.array(data[phaseName]['RefList'])
     4421            else:
     4422                wx.MessageBox('No reflection list - do Refine first',caption='Reflection plotting')
     4423                return
     4424        G2plt.Plot1DSngl(G2frame,newPlot=True,hklRef=refList,Super=Super,Title=phaseName)
     4425
    44064426    def OnPlotHKL(event):
    44074427        '''Plots a layer of reflections
     
    46224642    if HKLF:
    46234643        G2frame.Bind(wx.EVT_MENU, OnPlotHKL, id=G2G.wxID_PWDHKLPLOT)
     4644        G2frame.Bind(wx.EVT_MENU, OnPlot1DHKL, id=G2G.wxID_1DHKLSTICKPLOT)
    46244645        G2frame.Bind(wx.EVT_MENU, OnPlot3DHKL, id=G2G.wxID_PWD3DHKLPLOT)
    46254646        G2frame.dataWindow.SelectPhase.Enable(False)
    46264647    else:
    46274648        G2frame.Bind(wx.EVT_MENU, OnSelectPhase, id=G2G.wxID_SELECTPHASE)
     4649        G2frame.Bind(wx.EVT_MENU, OnPlot1DHKL, id=G2G.wxID_1DHKLSTICKPLOT)
    46284650        G2frame.Bind(wx.EVT_MENU, OnPlotHKL, id=G2G.wxID_PWDHKLPLOT)
    46294651        G2frame.Bind(wx.EVT_MENU, OnPlot3DHKL, id=G2G.wxID_PWD3DHKLPLOT)
Note: See TracChangeset for help on using the changeset viewer.