Changeset 3079 for trunk/GSASIIphsGUI.py


Ignore:
Timestamp:
Sep 18, 2017 8:52:24 AM (6 years ago)
Author:
vondreele
Message:

implement rigid body reference vectors

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIphsGUI.py

    r3058 r3079  
    75247524            rbsizer.Add(rbsizer2)   
    75257525            if model['Type'] == 'Residue':
    7526                 atNames = RBData['Residue'][model['RBId']]['atNames']
    7527                 rbsizer.Add(wx.StaticText(G2frame.MCSA,-1,'Torsions:'),0,WACV)
    7528                 rbsizer3 = wx.FlexGridSizer(0,8,5,5)
    7529                 for it,tor in enumerate(model['Tor'][0]):
    7530                     iBeg,iFin = RBData['Residue'][model['RBId']]['rbSeq'][it][:2]
    7531                     name = atNames[iBeg]+'-'+atNames[iFin]
    7532                     torRef = wx.CheckBox(G2frame.MCSA,-1,label=' %s: '%(name))
    7533                     torRef.SetValue(model['Tor'][1][it])
    7534                     torRef.Bind(wx.EVT_CHECKBOX,OnPosRef)
    7535                     Indx[torRef.GetId()] = [model,'Tor',it]
    7536                     rbsizer3.Add(torRef,0,WACV)
    7537                     torVal = G2G.ValidatedTxtCtrl(G2frame.MCSA,model['Tor'][0],it,nDig=(10,4),OnLeave=OnPosVal)
    7538                     rbsizer3.Add(torVal,0,WACV)
    7539                     rbsizer3.Add(wx.StaticText(G2frame.MCSA,-1,' Range: '),0,WACV)
    7540                     rmin,rmax = model['Tor'][2][it]
    7541                     torRange = wx.TextCtrl(G2frame.MCSA,-1,'%.3f %.3f'%(rmin,rmax),style=wx.TE_PROCESS_ENTER)
    7542                     Indx[torRange.GetId()] = [model,'Tor',it]
    7543                     torRange.Bind(wx.EVT_TEXT_ENTER,OnPosRange)
    7544                     torRange.Bind(wx.EVT_KILL_FOCUS,OnPosRange)
    7545                     rbsizer3.Add(torRange,0,WACV)
    7546                 rbsizer.Add(rbsizer3)
    7547                
     7526                try:
     7527                    atNames = RBData['Residue'][model['RBId']]['atNames']
     7528                    rbsizer.Add(wx.StaticText(G2frame.MCSA,-1,'Torsions:'),0,WACV)
     7529                    rbsizer3 = wx.FlexGridSizer(0,8,5,5)
     7530                    for it,tor in enumerate(model['Tor'][0]):
     7531                        iBeg,iFin = RBData['Residue'][model['RBId']]['rbSeq'][it][:2]
     7532                        name = atNames[iBeg]+'-'+atNames[iFin]
     7533                        torRef = wx.CheckBox(G2frame.MCSA,-1,label=' %s: '%(name))
     7534                        torRef.SetValue(model['Tor'][1][it])
     7535                        torRef.Bind(wx.EVT_CHECKBOX,OnPosRef)
     7536                        Indx[torRef.GetId()] = [model,'Tor',it]
     7537                        rbsizer3.Add(torRef,0,WACV)
     7538                        torVal = G2G.ValidatedTxtCtrl(G2frame.MCSA,model['Tor'][0],it,nDig=(10,4),OnLeave=OnPosVal)
     7539                        rbsizer3.Add(torVal,0,WACV)
     7540                        rbsizer3.Add(wx.StaticText(G2frame.MCSA,-1,' Range: '),0,WACV)
     7541                        rmin,rmax = model['Tor'][2][it]
     7542                        torRange = wx.TextCtrl(G2frame.MCSA,-1,'%.3f %.3f'%(rmin,rmax),style=wx.TE_PROCESS_ENTER)
     7543                        Indx[torRange.GetId()] = [model,'Tor',it]
     7544                        torRange.Bind(wx.EVT_TEXT_ENTER,OnPosRange)
     7545                        torRange.Bind(wx.EVT_KILL_FOCUS,OnPosRange)
     7546                        rbsizer3.Add(torRange,0,WACV)
     7547                    rbsizer.Add(rbsizer3)
     7548                except KeyError:    #Missing RB - clear all away!
     7549                    data['MCSA'] = {'Models':[{'Type':'MD','Coef':[1.0,False,[.8,1.2],],'axis':[0,0,1]}],'Results':[],'AtInfo':{}}
     7550                    wx.CallAfter(UpdateMCSA)
    75487551            return rbsizer
    75497552           
     
    77967799            return
    77977800        time1 = time.time()
    7798         if process == 'single':
     7801        nprocs = GSASIIpath.GetConfigValue('Multiprocessing_cores',0)
     7802        if process == 'single' or not nprocs:
    77997803            pgbar = wx.ProgressDialog('MC/SA','Residual Rcf =',101.0,
    78007804                style = wx.PD_ELAPSED_TIME|wx.PD_AUTO_HIDE|wx.PD_CAN_ABORT)
     
    78097813            tsf = 0.
    78107814            nCyc = mcsaControls['Cycles']
    7811             if process == 'single':
     7815            if process == 'single' or not nprocs:
    78127816                for i in range(nCyc):
    78137817                    pgbar.SetTitle('MC/SA run '+str(i+1)+' of '+str(nCyc))
     
    78217825                    Title='Reflection covariance matrix',zrange=[-1.,1.],color='RdYlGn')
    78227826            else:
    7823                 nprocs = GSASIIpath.GetConfigValue('Multiprocessing_cores')
    78247827                Results,sftime,numsf = G2mth.MPmcsaSearch(nCyc,data,RBdata,reflType,reflData,covData,nprocs)
    78257828                MCSAdata['Results'] += Results   #+= to  any saved ones
    78267829                print ' Total SF time: %.2fs MC/SA run time: %.2fs Nsfcalc: %d'%(sftime,time.time()-time1,numsf)
    78277830        finally:
    7828             if process == 'single':
     7831            if process == 'single' or not nprocs:
    78297832                pgbar.Destroy()
    78307833        MCSAdata['Results'] = G2mth.sortArray(MCSAdata['Results'],2,reverse=False)
Note: See TracChangeset for help on using the changeset viewer.