- Timestamp:
- Jun 30, 2015 3:52:34 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 1 deleted
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:ignore
-
old new 1 1 Exercises 2 GSASII.BAT
-
- Property svn:ignore
-
trunk/GSASII.py
r1913 r1915 835 835 UseList[histoName]['Twins'] = [[np.array([[1,0,0],[0,1,0],[0,0,1]]),[1.0,False]],] 836 836 for iT in range(reflData.get('TwMax',0)): 837 UseList[histoName]['Twins'].append([ [],0.0])837 UseList[histoName]['Twins'].append([False,0.0]) 838 838 for iref,ref in enumerate(reflData['RefList']): 839 839 hkl = ref[:3] -
trunk/GSASIIconstrGUI.py
r1898 r1915 689 689 legend = "Select atoms to make equivalent (only one of the atom variables will be varied when all are set to be varied)" 690 690 GetAddAtomVars(page,title1,title2,varList,constrDictEnt,'equivalence') 691 692 def OnAddRiding(event): 693 ''' Add riding equivalences between all parameters on atoms ''' 694 page = G2frame.Page 695 vartype,varList,constrDictEnt = PageSelection(page) 696 title1 = "Setup riding atoms " 697 title2 = "Select additional atoms(s) to ride on " 698 if not varList: 699 G2frame.ErrorDialog('No variables','There are no variables of type '+vartype, 700 parent=G2frame.dataFrame) 701 return 702 legend = "Select atoms to ride (only one of the atom variables will be varied when all are set to be varied)" 703 GetAddAtomVars(page,title1,title2,varList,constrDictEnt,'riding') 704 705 691 706 692 707 def OnAddFunction(event): … … 774 789 if dlg.ShowModal() == wx.ID_OK: 775 790 Selections = dlg.GetSelections()[:] 791 else: 792 print 'no target atom selected' 793 dlg.Destroy() 794 return 776 795 dlg.Destroy() 777 796 for name in Atoms[FrstAtom]: … … 779 798 constr = [[1.0,G2obj.G2VarObj(name)]] 780 799 pref = name.rsplit(':',1)[0] 800 if 'riding' in constType and 'U' in pref: 801 continue 781 802 for sel in Selections: 782 803 id = Atoms[AtNames[sel]][0].rsplit(':',1)[-1] 783 804 constr += [[1.0,G2obj.G2VarObj('%s:%s'%(pref,id))]] 784 if 'frac' in pref :805 if 'frac' in pref and 'riding' not in constType: 785 806 newcons = [constr+[1.0,None,'c']] 786 807 else: … … 1011 1032 text = G2frame.dataDisplay.GetPageText(page) 1012 1033 G2frame.dataFrame.ConstraintEdit.Enable(G2gd.wxID_EQUIVALANCEATOMS,False) 1034 G2frame.dataFrame.ConstraintEdit.Enable(G2gd.wxID_ADDRIDING,False) 1013 1035 if text == 'Histogram/Phase constraints': 1014 1036 G2frame.Page = [page,'hap'] … … 1020 1042 G2frame.Page = [page,'phs'] 1021 1043 G2frame.dataFrame.ConstraintEdit.Enable(G2gd.wxID_EQUIVALANCEATOMS,True) 1044 G2frame.dataFrame.ConstraintEdit.Enable(G2gd.wxID_ADDRIDING,True) 1022 1045 UpdateConstraintPanel(PhaseConstr,'Phase') 1023 1046 elif text == 'Global constraints': … … 1054 1077 G2frame.dataFrame.Bind(wx.EVT_MENU, OnAddHold, id=G2gd.wxID_HOLDADD) 1055 1078 G2frame.dataFrame.Bind(wx.EVT_MENU, OnAddAtomEquiv, id=G2gd.wxID_EQUIVALANCEATOMS) 1079 G2frame.dataFrame.Bind(wx.EVT_MENU, OnAddRiding, id=G2gd.wxID_ADDRIDING) 1056 1080 # tab commands 1057 1081 for id in (G2gd.wxID_CONSPHASE, -
trunk/GSASIIddataGUI.py
r1913 r1915 817 817 Obj = event.GetEventObject() 818 818 UseList[G2frame.hist]['Twins'][0][1][1] = Obj.GetValue() 819 820 def OnTwinInv(event): 821 Obj = event.GetEventObject() 822 it = Indx[Obj.GetId()] 823 UseList[G2frame.hist]['Twins'][it][0] = Obj.GetValue() 819 824 820 825 def OnTwinDel(event): … … 850 855 Style = wx.TE_READONLY 851 856 TwVal = Twin[1][0] 852 if len(Twin[0]):857 if 'bool' not in str(type(Twin[0])): 853 858 matSizer.Add(wx.StaticText(DData,-1,' Twin Law: '),0,WACV) 854 859 for im,Mat in enumerate(twinMat): … … 863 868 matSizer.Add(mat,0,WACV|wx.LEFT,5) 864 869 else: 865 matSizer.Add(wx.StaticText(DData,-1,' Nonmerohedral twin component %d:'%(it)),0,WACV) 870 matSizer.Add(wx.StaticText(DData,-1,' Nonmerohedral twin component %d: '%(it)),0,WACV) 871 if not SGData['SGInv']: 872 twinv = wx.CheckBox(DData,wx.ID_ANY,label=' Use enantiomorph?') 873 twinv.SetValue(Twin[0]) 874 Indx[twinv.GetId()] = it 875 twinv.Bind(wx.EVT_CHECKBOX, OnTwinInv) 876 matSizer.Add(twinv,0,WACV) 866 877 twinsizer.Add(matSizer,0,WACV|wx.LEFT,5) 867 878 valSizer = wx.BoxSizer(wx.HORIZONTAL) … … 875 886 twinval.SetBackgroundColour(VERY_LIGHT_GREY) 876 887 valSizer.Add(twinval,0,WACV) 877 if it and len(Twin[0]):888 if it and 'bool' not in str(type(Twin[0])): 878 889 twindel = wx.CheckBox(DData,wx.ID_ANY,label=' Delete?') 879 890 Indx[twindel.GetId()] = it -
trunk/GSASIIgrid.py
r1907 r1915 67 67 wxID_ATOMSMODIFY, wxID_ATOMSTRANSFORM, wxID_ATOMSVIEWADD, wxID_ATOMVIEWINSERT, 68 68 wxID_RELOADDRAWATOMS,wxID_ATOMSDISAGL,wxID_ATOMMOVE,wxID_MAKEMOLECULE, 69 wxID_ASSIGNATMS2RB,wxID_ATOMSPDISAGL, wxID_ISODISP, 70 ] = [wx.NewId() for item in range(1 5)]69 wxID_ASSIGNATMS2RB,wxID_ATOMSPDISAGL, wxID_ISODISP,wxID_ADDHATOM, 70 ] = [wx.NewId() for item in range(16)] 71 71 72 72 [ wxID_DRAWATOMSTYLE, wxID_DRAWATOMLABEL, wxID_DRAWATOMCOLOR, wxID_DRAWATOMRESETCOLOR, … … 116 116 ] = [wx.NewId() for item in range(6)] 117 117 118 [ wxID_CONSTRAINTADD,wxID_EQUIVADD,wxID_HOLDADD,wxID_FUNCTADD, 118 [ wxID_CONSTRAINTADD,wxID_EQUIVADD,wxID_HOLDADD,wxID_FUNCTADD,wxID_ADDRIDING, 119 119 wxID_CONSPHASE, wxID_CONSHIST, wxID_CONSHAP, wxID_CONSGLOBAL,wxID_EQUIVALANCEATOMS, 120 ] = [wx.NewId() for item in range( 9)]120 ] = [wx.NewId() for item in range(10)] 121 121 122 122 [ wxID_RESTRAINTADD, wxID_RESTSELPHASE,wxID_RESTDELETE, wxID_RESRCHANGEVAL, … … 622 622 help='Add equivalences between atom parameter values') 623 623 self.ConstraintEdit.Enable(wxID_EQUIVALANCEATOMS,False) 624 self.ConstraintEdit.Append(id=wxID_ADDRIDING, kind=wx.ITEM_NORMAL,text='Add riding constraints', 625 help='Add riding constraints between atom parameter values') 626 self.ConstraintEdit.Enable(wxID_ADDRIDING,False) 627 wxID_ADDRIDING 624 628 self.PostfillDataMenu() 625 629 … … 1128 1132 self.AtomEdit.Append(id=wxID_ATOMVIEWINSERT, kind=wx.ITEM_NORMAL,text='Insert view point', 1129 1133 help='Select atom row to insert before; inserted as an H atom') 1134 self.AtomEdit.Append(id=wxID_ADDHATOM, kind=wx.ITEM_NORMAL,text='Insert H atoms', 1135 help='Insert H atoms in standard positions bonded to selected atoms') 1130 1136 self.AtomEdit.Append(id=wxID_ATOMMOVE, kind=wx.ITEM_NORMAL,text='Move atom to view point', 1131 1137 help='Select single atom to move') … … 1419 1425 if 'UsrReject' not in data: 1420 1426 data['UsrReject'] = {'minF/sig':0,'MinExt':0.01,'MaxDF/F':20.,'MaxD':500.,'MinD':0.05} 1421 1427 if 'HatomFix' not in data: 1428 data['HatomFix'] = False 1422 1429 1423 1430 #end patch … … 1509 1516 def OnFsqRef(event): 1510 1517 data['F**2'] = fsqRef.GetValue() 1518 1519 def OnHatomFix(event): 1520 data['HatomFix'] = Hfix.GetValue() 1511 1521 1512 1522 def OnUsrRej(event): … … 1567 1577 usrrej.Bind(wx.EVT_KILL_FOCUS,OnUsrRej) 1568 1578 LSSizer.Add(usrrej,0,WACV) 1579 Hfix = wx.CheckBox(G2frame.dataDisplay,-1,label='Regularize H atoms? ') 1580 Hfix.SetValue(data['HatomFix']) 1581 Hfix.Bind(wx.EVT_CHECKBOX,OnHatomFix) 1582 # LSSizer.Add(Hfix,0,WACV) #for now 1569 1583 return LSSizer 1570 1584 -
trunk/GSASIIobj.py
r1884 r1915 873 873 'min dM/M':0.0001,'shift factor':1.,'max cyc':3,'F**2':False, 874 874 'UsrReject':{'minF/sig':0,'MinExt':0.01,'MaxDF/F':100.,'MaxD':500.,'MinD':0.05}, 875 'Copy2Next':False,'Reverse Seq':False, 875 'Copy2Next':False,'Reverse Seq':False,'HatomFix':False, 876 876 'Author':'no name', 877 877 'FreePrm1':'Sample humidity (%)', -
trunk/GSASIIphsGUI.py
r1908 r1915 1448 1448 Items = [G2gd.wxID_ATOMSEDITINSERT,G2gd.wxID_ATOMSEDITDELETE,G2gd.wxID_ATOMSREFINE, 1449 1449 G2gd.wxID_ATOMSMODIFY,G2gd.wxID_ATOMSTRANSFORM,G2gd.wxID_MAKEMOLECULE, 1450 G2gd.wxID_ATOMVIEWINSERT,G2gd.wxID_ATOMMOVE ]1450 G2gd.wxID_ATOMVIEWINSERT,G2gd.wxID_ATOMMOVE,G2gd.wxID_ADDHATOM] 1451 1451 if atomData: 1452 1452 for item in Items: … … 1535 1535 FillAtomsGrid(Atoms) 1536 1536 event.StopPropagation() 1537 1538 def OnHydAtomAdd(event): 1539 print "Doesn't do anything yet!" 1540 indx = Atoms.GetSelectedRows() 1541 if indx: 1542 DisAglData['OrigIndx'] = indx 1543 if 'DisAglCtls' in generalData: 1544 DisAglCtls = generalData['DisAglCtls'] 1545 dlg = G2gd.DisAglDialog(G2frame,DisAglCtls,generalData) 1546 if dlg.ShowModal() == wx.ID_OK: 1547 DisAglCtls = dlg.GetData() 1548 else: 1549 dlg.Destroy() 1550 return 1551 dlg.Destroy() 1552 generalData['DisAglCtls'] = DisAglCtls 1553 atomData = data['Atoms'] 1554 generalData = data['General'] 1555 colLabels = [Atoms.GetColLabelValue(c) for c in range(Atoms.GetNumberCols())] 1556 for ind in indx: 1557 atom = atomData[ind] 1537 1558 1538 1559 def OnAtomMove(event): … … 3885 3906 for i in result: 3886 3907 histoName = TextList[i] 3908 Id = G2gd.GetPatternTreeItemId(G2frame,G2frame.root,histoName) 3909 refDict,reflData = G2frame.PatternTree.GetItemPyData(Id) 3887 3910 UseList[histoName] = {'Histogram':histoName,'Show':False,'Scale':[1.0,True], 3888 3911 'Babinet':{'BabA':[0.0,False],'BabU':[0.0,False]}, … … 3890 3913 {'Tbar':0.1,'Cos2TM':0.955,'Eg':[1.e-7,False],'Es':[1.e-7,False],'Ep':[1.e-7,False]},], 3891 3914 'Flack':[0.0,False],'Twins':[[np.array([[1,0,0],[0,1,0],[0,0,1]]),[1.0,False]],]} 3915 for iT in range(reflData.get('TwMax',0)): 3916 UseList[histoName]['Twins'].append([False,0.0]) 3892 3917 UpdateHKLFdata(histoName) 3893 3918 data['Histograms'] = UseList … … 6167 6192 G2frame.dataFrame.Bind(wx.EVT_MENU, OnAtomInsert, id=G2gd.wxID_ATOMSEDITINSERT) 6168 6193 G2frame.dataFrame.Bind(wx.EVT_MENU, OnAtomViewInsert, id=G2gd.wxID_ATOMVIEWINSERT) 6194 G2frame.dataFrame.Bind(wx.EVT_MENU, OnHydAtomAdd, id=G2gd.wxID_ADDHATOM) 6169 6195 G2frame.dataFrame.Bind(wx.EVT_MENU, OnAtomMove, id=G2gd.wxID_ATOMMOVE) 6170 6196 G2frame.dataFrame.Bind(wx.EVT_MENU, AtomDelete, id=G2gd.wxID_ATOMSEDITDELETE) -
trunk/GSASIIstrIO.py
r1910 r1915 599 599 else: 600 600 print >>pFile,' Minimum delta-M/M for convergence: ','%.2g'%(Controls['min dM/M']) 601 print >>pFile,' Regularize hydrogens (if any):',Controls.get('HatomFix',False) 601 602 print >>pFile,' Initial shift factor: ','%.3f'%(Controls['shift factor']) 602 603 if SeqRef: … … 2265 2266 controlDict[pfx+'TwinLaw'] = [] 2266 2267 for it,twin in enumerate(Twins): 2267 if len(twin[0]): 2268 if 'bool' in str(type(twin[0])): 2269 controlDict[pfx+'TwinLaw'].append(np.zeros((3,3))) 2270 else: 2268 2271 controlDict[pfx+'TwinLaw'].append(twin[0]) 2269 else:2270 controlDict[pfx+'TwinLaw'].append(np.zeros((3,3)))2271 2272 if it: 2272 2273 hapDict[pfx+'TwinFr:'+str(it)] = twin[1] … … 2296 2297 if len(Twins) > 1: 2297 2298 for it,twin in enumerate(Twins): 2298 if len(twin[0]): 2299 if 'bool' in str(type(twin[0])): 2300 print >>pFile,' Nonmerohedral twin fr.: %5.3f Refine? '%(hapDict[pfx+'TwinFr:'+str(it)]),Twins[0][1][1] 2301 else: 2299 2302 print >>pFile,' Twin law: %s'%(str(twin[0]).replace('\n',',')),' Twin fr.: %5.3f Refine? '%(hapDict[pfx+'TwinFr:'+str(it)]),Twins[0][1][1] 2300 else:2301 print >>pFile,' Nonmerohedral twin fr.: %5.3f Refine? '%(hapDict[pfx+'TwinFr:'+str(it)]),Twins[0][1][1]2302 2303 2303 2304 Histogram['Reflection Lists'] = phase -
trunk/GSASIIstrMath.py
r1914 r1915 2657 2657 G2mv.Dict2Map(parmDict,varylist) 2658 2658 Histograms,Phases,restraintDict,rigidbodyDict = HistoPhases 2659 #fixup H atom positions here? 2659 2660 ApplyRBModels(parmDict,Phases,rigidbodyDict) #,Update=True?? 2660 2661 nvar = len(varylist) … … 2733 2734 Next = 0 2734 2735 ApplyRBModels(parmDict,Phases,rigidbodyDict) 2736 #fixup Hatom positions here.... 2735 2737 histoList = Histograms.keys() 2736 2738 histoList.sort() -
trunk/imports/G2sfact.py
r1913 r1915 85 85 return False 86 86 87 class HKLF4_ReaderClass(G2IO.ImportStructFactor):88 'Routines to import F**2, sig(F**2) reflections from a HKLF 4 file'87 class SHELX4_ReaderClass(G2IO.ImportStructFactor): 88 'Routines to import F**2, sig(F**2) reflections from a Shelx HKLF 4 file' 89 89 def __init__(self): 90 90 if 'linux' in sys.platform: # wx 3.0.0.0 on gtk does not like Unicode in menus … … 149 149 150 150 def ContentsValidator(self, filepointer): 151 'Discover how many characters are in the SHELX file - could be 32-44 depending on satellites' 152 numCols = 0 #this needs to be done differently 151 '''Discover how many columns before F^2 are in the SHELX HKL5 file 152 - could be 3-6 depending on satellites''' 153 numCols = 0 153 154 for i,line in enumerate(filepointer): 154 numCols = max(numCols,len(line.split())) 155 for j,item in enumerate(line.split()): #find 1st col with '.'; has F^2 156 if '.' in item: 157 numCols = max(numCols,j) 158 break 155 159 if i > 20: 156 160 break 157 self.Super = numCols- 6#= 0,1,2,or 3161 self.Super = numCols-3 #= 0,1,2,or 3 158 162 if self.Super > 1: 159 163 raise self.ImportException("Supersymmetry too high; GSAS-II limited to (3+1) supersymmetry") 160 return True #ColumnValidator(self, filepointer)164 return True 161 165 162 166 def Reader(self,filename,filepointer, ParentFrame=None, **unused):
Note: See TracChangeset
for help on using the changeset viewer.