Changeset 1837


Ignore:
Timestamp:
May 5, 2015 4:28:26 PM (9 years ago)
Author:
vondreele
Message:

fix Mass problem on 1st LS if General not visited after atoms added
add (hidden for now) penalty option for texture refinement

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIIO.py

    r1834 r1837  
    12551255                'PFhkl':[0,0,1],
    12561256                'PFxyz':[0,0,1],
    1257                 'PlotType':'Pole figure'}},
     1257                'PlotType':'Pole figure',
     1258                'Penalty':[['',],0.1,False,1.0]}},
    12581259        'Atoms':[],
    12591260        'Drawing':{},
  • trunk/GSASIIddataGUI.py

    r1835 r1837  
    916916    if DData.GetSizer():
    917917        DData.GetSizer().Clear(True)
     918    useList = []
     919    for name in keyList:
     920        if name in UseList:
     921            useList.append(name)
    918922    mainSizer = wx.BoxSizer(wx.VERTICAL)
    919923    mainSizer.Add(wx.StaticText(DData,wx.ID_ANY,' Histogram data for '+PhaseName+':'),0,WACV)
    920924    if G2frame.hist != '':
    921         useList = UseList.keys()
    922925        topSizer = wx.FlexGridSizer(1,2,5,5)
    923926        select = wx.ListBox(DData,choices=useList,style=wx.LB_SINGLE,size=(-1,120))
  • trunk/GSASIImath.py

    r1830 r1837  
    17451745            break
    17461746   
    1747 #    for hist in keyList:
    1748 #        print ' Texture corrections for '+hist
    1749 #        for ref in refData[hist]:
    1750 #            print ' %d %d %d %.3f %.3f'%(int(ref[0]),int(ref[1]),int(ref[2]),ref[5],ref[6])
    17511747    if ncyc:
    17521748        for parm in parmDict:
  • trunk/GSASIIphsGUI.py

    r1835 r1837  
    216216        generalData['F000X'] = F000X
    217217        generalData['F000N'] = F000N
     218        generalData['Mass'] = G2mth.getMass(generalData)
    218219       
    219220
     
    36143615            wx.CallAfter(G2plt.PlotTexture,G2frame,data)
    36153616
     3617        def SHPenalty(Penalty):
     3618           
     3619            def OnHKLList(event):
     3620                dlg = G2G.G2MultiChoiceDialog(G2frame, 'Select penalty hkls',
     3621                    'Penalty hkls',hkls,filterBox=False)
     3622                try:
     3623                    if dlg.ShowModal() == wx.ID_OK:
     3624                        Penalty[0] = [hkls[i] for i in dlg.GetSelections()]
     3625                        if not Penalty[0]:
     3626                            Penalty[0] = ['',]
     3627                    else:
     3628                        return
     3629                finally:
     3630                    dlg.Destroy()
     3631                wx.CallLater(100,UpdateTexture)
     3632               
     3633            def OnshToler(event):
     3634                try:
     3635                    value = float(shToler.GetValue())
     3636                    Penalty[1] = value
     3637                except ValueError:
     3638                    pass
     3639                shToler.SetValue('%.2f'%(Penalty[1]))
     3640           
     3641            A = G2lat.cell2A(generalData['Cell'][1:7])
     3642            hkls = G2lat.GenPfHKLs(10,SGData,A)   
     3643            shPenalty = wx.BoxSizer(wx.HORIZONTAL)
     3644            shPenalty.Add(wx.StaticText(Texture,wx.ID_ANY,' Negative MRD penalty list: '),0,WACV)
     3645            shPenalty.Add(wx.ComboBox(Texture,value=Penalty[0][0],choices=Penalty[0],
     3646                style=wx.CB_DROPDOWN),0,WACV)
     3647            hklList = wx.Button(Texture,label='Select penalty hkls')
     3648            hklList.Bind(wx.EVT_BUTTON,OnHKLList)
     3649            shPenalty.Add(hklList,0,WACV)
     3650            shPenalty.Add(wx.StaticText(Texture,wx.ID_ANY,' Zero MRD tolerance: '),0,WACV)
     3651            shToler = wx.TextCtrl(Texture,wx.ID_ANY,'%.2f'%(Penalty[1]),style=wx.TE_PROCESS_ENTER)
     3652            shToler.Bind(wx.EVT_TEXT_ENTER,OnshToler)
     3653            shToler.Bind(wx.EVT_KILL_FOCUS,OnshToler)
     3654            shPenalty.Add(shToler,0,WACV)
     3655            return shPenalty   
     3656       
    36163657        # UpdateTexture executable starts here
    36173658        #Texture.DestroyChildren() # bad, deletes scrollbars on Mac!
     
    36343675        except KeyError:
    36353676            textureData.update({'PFxyz':[0,0,1.],'PlotType':'Pole figure'})
     3677        if 'Penalty' not in textureData:
     3678            textureData['Penalty'] = [['',],0.1,False,1.0]
    36363679        shModels = ['cylindrical','none','shear - 2/m','rolling - mmm']
    36373680        SamSym = dict(zip(shModels,['0','-1','2/m','mmm']))
     
    37363779            angSizer.Add(angVal,0,WACV|wx.LEFT,5)
    37373780        mainSizer.Add(angSizer,0,WACV|wx.LEFT,5)
     3781#        mainSizer.Add(SHPenalty(textureData['Penalty']),0,WACV|wx.LEFT,5)  for future
    37383782        SetPhaseWindow(G2frame.dataFrame,Texture,mainSizer)
    37393783
     
    59415985        if Error:
    59425986            wx.MessageBox(Error,caption='Fit Texture Error',style=wx.ICON_EXCLAMATION)
     5987        for hist in keyList:
     5988            print ' Texture corrections for '+hist
     5989            for ref in refData[hist]:
     5990                print ' %d %d %d %.3f %.3f'%(int(ref[0]),int(ref[1]),int(ref[2]),ref[5],ref[6])
    59435991        UpdateTexture()
    59445992        G2plt.PlotTexture(G2frame,data,Start=False)           
Note: See TracChangeset for help on using the changeset viewer.