Changeset 3079 for trunk/GSASIIphsGUI.py
- Timestamp:
- Sep 18, 2017 8:52:24 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIphsGUI.py
r3058 r3079 7524 7524 rbsizer.Add(rbsizer2) 7525 7525 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) 7548 7551 return rbsizer 7549 7552 … … 7796 7799 return 7797 7800 time1 = time.time() 7798 if process == 'single': 7801 nprocs = GSASIIpath.GetConfigValue('Multiprocessing_cores',0) 7802 if process == 'single' or not nprocs: 7799 7803 pgbar = wx.ProgressDialog('MC/SA','Residual Rcf =',101.0, 7800 7804 style = wx.PD_ELAPSED_TIME|wx.PD_AUTO_HIDE|wx.PD_CAN_ABORT) … … 7809 7813 tsf = 0. 7810 7814 nCyc = mcsaControls['Cycles'] 7811 if process == 'single' :7815 if process == 'single' or not nprocs: 7812 7816 for i in range(nCyc): 7813 7817 pgbar.SetTitle('MC/SA run '+str(i+1)+' of '+str(nCyc)) … … 7821 7825 Title='Reflection covariance matrix',zrange=[-1.,1.],color='RdYlGn') 7822 7826 else: 7823 nprocs = GSASIIpath.GetConfigValue('Multiprocessing_cores')7824 7827 Results,sftime,numsf = G2mth.MPmcsaSearch(nCyc,data,RBdata,reflType,reflData,covData,nprocs) 7825 7828 MCSAdata['Results'] += Results #+= to any saved ones 7826 7829 print ' Total SF time: %.2fs MC/SA run time: %.2fs Nsfcalc: %d'%(sftime,time.time()-time1,numsf) 7827 7830 finally: 7828 if process == 'single' :7831 if process == 'single' or not nprocs: 7829 7832 pgbar.Destroy() 7830 7833 MCSAdata['Results'] = G2mth.sortArray(MCSAdata['Results'],2,reverse=False)
Note: See TracChangeset
for help on using the changeset viewer.