Changeset 1787 for trunk/GSASIIgrid.py


Ignore:
Timestamp:
Apr 13, 2015 12:59:34 PM (7 years ago)
Author:
vondreele
Message:

remove user reject HKL selection from Reflection List
implement rule bases user reject for HKLF reflections in Controls
user rejection changes mul to -mul; reflection list shows this in red
implement tool tip on 3Dhkl plots showing hkl indices on each point encountered

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIgrid.py

    r1784 r1787  
    144144] = [wx.NewId() for item in range(12)]
    145145
    146 [ wxID_SELECTPHASE,wxID_PWDHKLPLOT,wxID_PWD3DHKLPLOT,wxID_REJECTHKL,wxID_CLEARREJECT,
    147 ] = [wx.NewId() for item in range(5)]
     146[ wxID_SELECTPHASE,wxID_PWDHKLPLOT,wxID_PWD3DHKLPLOT,
     147] = [wx.NewId() for item in range(3)]
    148148
    149149[ wxID_PDFCOPYCONTROLS, wxID_PDFSAVECONTROLS, wxID_PDFLOADCONTROLS,
     
    14851485        self.ReflEdit.Append(id=wxID_PWD3DHKLPLOT,kind=wx.ITEM_NORMAL,text='Plot 3D HKLs',
    14861486            help='Plot HKLs from powder pattern in 3D')
    1487         self.RejectHKL = self.ReflEdit.Append(id=wxID_REJECTHKL,kind=wx.ITEM_NORMAL,text='Reject HKL toggle',
    1488             help='Reject selected HKL toggle; make mul *= -1')
    1489         self.ClearReject = self.ReflEdit.Append(id=wxID_CLEARREJECT,kind=wx.ITEM_NORMAL,text='Clear rejects',
    1490             help='Clear all rejected HKLs')
    14911487        self.PostfillDataMenu()
    14921488       
     
    22552251        data['max cyc'] = 3       
    22562252        data['F**2'] = False
    2257         data['minF/sig'] = 0
    22582253    if 'shift factor' not in data:
    22592254        data['shift factor'] = 1.
     
    22622257    if 'F**2' not in data:
    22632258        data['F**2'] = False
    2264         data['minF/sig'] = 0
    22652259    if 'Author' not in data:
    22662260        data['Author'] = 'no name'
     
    22742268        data['Copy2Next'] = False
    22752269    if 'Reverse Seq' not in data:
    2276         data['Reverse Seq'] = False   
     2270        data['Reverse Seq'] = False
     2271    if 'UsrReject' not in data:
     2272        data['UsrReject'] = {'minF/sig':0,'MinExt':0.01,'MaxDF/F':20.,'MaxD':500.,'MinD':0.05}
    22772273     
    22782274   
     
    23662362            data['F**2'] = fsqRef.GetValue()
    23672363       
    2368         def OnMinSig(event):
     2364        def OnUsrRej(event):
     2365            Obj = event.GetEventObject()
     2366            item,limits = Indx[Obj]
    23692367            try:
    2370                 value = min(max(float(minSig.GetValue()),0.),5.)
     2368                value = min(max(float(Obj.GetValue()),limits[0]),limits[1])
    23712369            except ValueError:
    2372                 value = 1.0
    2373             data['minF/sig'] = value
    2374             minSig.SetValue('%.2f'%(value))
     2370                value = data['UsrReject'][item]
     2371            data['UsrReject'][item] = value
     2372            Obj.SetValue('%.2f'%(value))
    23752373
    23762374        LSSizer = wx.FlexGridSizer(cols=4,vgap=5,hgap=5)
     
    23882386        Cnvrg.Bind(wx.EVT_KILL_FOCUS,OnConvergence)
    23892387        LSSizer.Add(Cnvrg,0,WACV)
     2388        Indx = {}
    23902389        if 'Hessian' in data['deriv type']:
    23912390            LSSizer.Add(wx.StaticText(G2frame.dataDisplay,label=' Max cycles: '),0,WACV)
     
    24032402            LSSizer.Add(Factr,0,WACV)
    24042403        if G2frame.Sngl:
    2405             LSSizer.Add((1,0),)
    2406             LSSizer.Add((1,0),)
     2404            userReject = data['UsrReject']
     2405            usrRej = {'minF/sig':[' Min obs/sig (0-5): ',[0,5], ],'MinExt':[' Min extinct. (0-.9): ',[0,.9],],
     2406                'MaxDF/F':[' Max delt-F/sig (3-20): ',[3.,20.],],'MaxD':[' Max d-spacing (3-500): ',[3,500],],
     2407                'MinD':[' Min d-spacing (0.1-1.0): ',[0.1,1.0],]}
     2408
    24072409            fsqRef = wx.CheckBox(G2frame.dataDisplay,-1,label='Refine HKLF as F^2? ')
    24082410            fsqRef.SetValue(data['F**2'])
    24092411            fsqRef.Bind(wx.EVT_CHECKBOX,OnFsqRef)
    24102412            LSSizer.Add(fsqRef,0,WACV)
    2411             LSSizer.Add(wx.StaticText(G2frame.dataDisplay,-1,label='Min obs/sig (0-5): '),0,WACV)
    2412             minSig = wx.TextCtrl(G2frame.dataDisplay,-1,value='%.2f'%(data['minF/sig']),style=wx.TE_PROCESS_ENTER)
    2413             minSig.Bind(wx.EVT_TEXT_ENTER,OnMinSig)
    2414             minSig.Bind(wx.EVT_KILL_FOCUS,OnMinSig)
    2415             LSSizer.Add(minSig,0,WACV)
     2413            LSSizer.Add((1,0),)
     2414            for item in usrRej:
     2415                LSSizer.Add(wx.StaticText(G2frame.dataDisplay,-1,label=usrRej[item][0]),0,WACV)
     2416                usrrej = wx.TextCtrl(G2frame.dataDisplay,-1,value='%.2f'%(userReject[item]),style=wx.TE_PROCESS_ENTER)
     2417                Indx[usrrej] = [item,usrRej[item][1]]
     2418                usrrej.Bind(wx.EVT_TEXT_ENTER,OnUsrRej)
     2419                usrrej.Bind(wx.EVT_KILL_FOCUS,OnUsrRej)
     2420                LSSizer.Add(usrrej,0,WACV)
    24162421        return LSSizer
    24172422       
Note: See TracChangeset for help on using the changeset viewer.