Changeset 815
- Timestamp:
- Dec 14, 2012 4:28:59 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASII.py
r814 r815 995 995 self._Add_DataMenuItems(Data) 996 996 Calculate = wx.Menu(title='') 997 menubar.Append(menu=Calculate, title=' Calculate')997 menubar.Append(menu=Calculate, title='&Calculate') 998 998 self._Add_CalculateMenuItems(Calculate) 999 999 Import = wx.Menu(title='') -
trunk/GSASIImacros/bonds-resrb.mac
r812 r815 1 1 !standard bond restraints for amino acids using flexible rigid bodies - Engh & Huber 2 2 F 0.3 3 S * 1.329 .01 C N !peptide chain 3 !peptide chain 4 S * 1.329 .01 C N 4 5 S * 1.249 .01 C OXT 5 6 S * 3.80 .1 CA CA 6 S CYS 2.031 .01 SG SG !disulfides 7 !disulfides 8 S CYS 2.031 .01 SG SG -
trunk/GSASIImacros/bonds.mac
r812 r815 1 1 !standard bond restraints for amino acids - Engh & Huber 2 2 F 0.3 3 S * 1.329 .01 C N !peptide chain 3 !peptide chain 4 S * 1.329 .01 C N 4 5 S * 1.249 .01 C OXT 5 S ALA 1.458 .01 N CA !alanine 6 !alanine 7 S ALA 1.458 .01 N CA 6 8 S ALA 1.525 .01 CA C 7 9 S ALA 1.231 .01 C O 8 10 S ALA 1.521 .01 CA CB 9 S ARG 1.458 .01 N CA !arginine 11 !arginine 12 S ARG 1.458 .01 N CA 10 13 S ARG 1.525 .01 CA C 11 14 S ARG 1.231 .01 C O … … 17 20 S ARG 1.326 .01 CZ NH1 18 21 S ARG 1.326 .01 CZ NH2 19 S ASN 1.458 .01 N CA !aspargine 22 !aspargine 23 S ASN 1.458 .01 N CA 20 24 S ASN 1.525 .01 CA C 21 25 S ASN 1.231 .01 C O … … 24 28 S ASN 1.328 .01 CG ND2 25 29 S ASN 1.231 .01 CG OD1 26 S ASP 1.458 .01 N CA !aspartate 30 !aspartate 31 S ASP 1.458 .01 N CA 27 32 S ASP 1.525 .01 CA C 28 33 S ASP 1.231 .01 C O … … 31 36 S ASP 1.249 .01 CG OD1 32 37 S ASP 1.249 .01 CG OD2 33 S CYS 1.458 .01 N CA !cysteine 38 !cystine 39 S CYS 1.458 .01 N CA 34 40 S CYS 1.525 .01 CA C 35 41 S CYS 1.231 .01 C O … … 37 43 S CYS 1.808 .01 CB SG 38 44 S CYS 2.031 .01 SG SG 39 S GLN 1.458 .01 N CA !glutamine 45 !glutamine 46 S GLN 1.458 .01 N CA 40 47 S GLN 1.525 .01 CA C 41 48 S GLN 1.231 .01 C O … … 45 52 S GLN 1.231 .01 CD OE1 46 53 S GLN 1.328 .01 CD NE2 47 S GLU 1.458 .01 N CA !glutamate 54 !glutamate 55 S GLU 1.458 .01 N CA 48 56 S GLU 1.525 .01 CA C 49 57 S GLU 1.231 .01 C O … … 53 61 S GLU 1.249 .01 CD OE1 54 62 S GLU 1.249 .01 CD OE2 55 S GLY 1.451 .01 N CA !glycine 63 !glycine 64 S GLY 1.451 .01 N CA 56 65 S GLY 1.516 .01 CA C 57 66 S GLY 1.231 .01 O C 58 S HIS 1.458 .01 N CA !histidine 67 !histidine 68 S HIS 1.458 .01 N CA 59 69 S HIS 1.525 .01 CA C 60 70 S HIS 1.231 .01 C O … … 65 75 S HIS 1.321 .01 CE1 NE2 66 76 S HIS 1.374 .01 CD2 NE2 67 S HIS 1.354 .01 CG CD2 68 S ILE 1.458 .01 N CA !isoleucine 77 S HIS 1.354 .01 CG CD2 78 !isoleucine 79 S ILE 1.458 .01 N CA 69 80 S ILE 1.525 .01 CA C 70 81 S ILE 1.231 .01 C O … … 73 84 S ILE 1.521 .01 CB CG2 74 85 S ILE 1.513 .01 CG1 CD1 75 S LEU 1.458 .01 N CA !leucine 86 !leucine 87 S LEU 1.458 .01 N CA 76 88 S LEU 1.525 .01 CA C 77 89 S LEU 1.231 .01 C O … … 80 92 S LEU 1.521 .01 CG CD1 81 93 S LEU 1.521 .01 CG CD2 82 S LYS 1.458 .01 N CA !lysine 94 !lysine 95 S LYS 1.458 .01 N CA 83 96 S LYS 1.525 .01 CA C 84 97 S LYS 1.231 .01 C O … … 88 101 S LYS 1.520 .01 CD CE 89 102 S LYS 1.489 .01 CE NZ 90 S MET 1.458 .01 N CA !methionine 103 !methionine 104 S MET 1.458 .01 N CA 91 105 S MET 1.525 .01 CA C 92 106 S MET 1.231 .01 C O … … 95 109 S MET 1.803 .01 CG SD 96 110 S MET 1.791 .01 SD CE 97 S PHE 1.458 .01 N CA !phenylalanine 111 !phenylalanine 112 S PHE 1.458 .01 N CA 98 113 S PHE 1.525 .01 CA C 99 114 S PHE 1.231 .01 C O … … 106 121 S PHE 1.382 .01 CE1 CZ 107 122 S PHE 1.382 .01 CE2 CZ 108 S PRO 1.466 .01 N CA !proline 123 !proline 124 S PRO 1.466 .01 N CA 109 125 S PRO 1.525 .01 CA C 110 126 S PRO 1.231 .01 C O … … 113 129 S PRO 1.492 .01 CB CG 114 130 S PRO 1.503 .01 CD CG 115 S SER 1.458 .01 N CA !serine 131 !serine 132 S SER 1.458 .01 N CA 116 133 S SER 1.525 .01 CA C 117 134 S SER 1.231 .01 C O 118 135 S SER 1.530 .01 CA CB 119 136 S SER 1.417 .01 CB OG 120 S THR 1.458 .01 N CA !threonine 137 !threonine 138 S THR 1.458 .01 N CA 121 139 S THR 1.525 .01 CA C 122 140 S THR 1.231 .01 C O … … 124 142 S THR 1.433 .01 CB OG1 125 143 S THR 1.521 .01 CB CG2 126 S TRP 1.458 .01 N CA !tryptophan 144 !tryptophan 145 S TRP 1.458 .01 N CA 127 146 S TRP 1.525 .01 CA C 128 147 S TRP 1.231 .01 C O … … 139 158 S TRP 1.368 .01 CZ2 CH2 140 159 S TRP 1.400 .01 CZ3 CH2 141 S TYR 1.458 .01 N CA !tyrosine 160 !tyrosine 161 S TYR 1.458 .01 N CA 142 162 S TYR 1.525 .01 CA C 143 163 S TYR 1.231 .01 C O … … 151 171 S TYR 1.378 .01 CE1 CZ 152 172 S TYR 1.376 .01 CZ OH 153 S VAL 1.458 .01 N CA !valine 173 !valine 174 S VAL 1.458 .01 N CA 154 175 S VAL 1.525 .01 CA C 155 176 S VAL 1.231 .01 C O -
trunk/GSASIImacros/planes-resrb.mac
r812 r815 2 2 F 0.5 3 3 S * .01 CA C O N+ 4 -
trunk/GSASIImacros/planes.mac
r812 r815 2 2 F 0.5 3 3 S ARG .01 NE CZ NH1 NH2 4 5 4 S ARG .01 CD NE CZ NH1 NH2 6 7 5 S ASN .01 CB CG OD1 ND2 8 9 6 S ASP .01 CB CG OD1 OD2 10 11 7 S GLN .01 CG CD OE1 NE2 12 13 8 S GLU .01 CG CD OE1 OE2 14 15 9 S HIS .01 CB CG ND1 CD2 CE1 NE2 16 17 10 S PHE .01 CB CG CD1 CD2 CE1 CE2 CZ 18 19 11 S TRP .01 CB CG CD1 NE1 CD2 CE2 CE3 CZ2 CZ3 CH2 20 21 12 S TYR .01 CB CG CD1 CD2 CE1 CE2 CZ OH 22 23 13 S * .01 CA C O N+ 24 -
trunk/GSASIImath.py
r811 r815 200 200 return density,Volume/mass 201 201 202 def getSyXYZ(XYZ,ops,SGData): 203 XYZout = np.zeros_like(XYZ) 204 for i,[xyz,op] in enumerate(zip(XYZ,ops)): 205 if op == '1': 206 XYZout[i] = xyz 207 else: 208 oprs = op.split('+') 209 unit = [0,0,0] 210 if oprs[1]: 211 unit = np.array(list(eval(oprs[1]))) 212 syop =int(oprs[0]) 213 inv = syop/abs(syop) 214 syop *= inv 215 cent = syop/100 216 syop %= 100 217 syop -= 1 218 M,T = SGData['SGOps'][syop] 219 XYZout[i] = (np.inner(M,xyz)+T)*inv+SGData['SGCen'][cent]+unit 220 return XYZout 221 202 222 def getRestDist(XYZ,Amat): 203 223 return np.sqrt(np.sum(np.inner(Amat,(XYZ[1]-XYZ[0]))**2)) 224 225 def getRestDeriv(Func,XYZ,Amat): 226 deriv = np.array((3,len(XYZ))) 227 dx = 0.00001 228 for j,xyz in enumerate(XYZ): 229 for i,x in enumerate(xyz): 230 x += dx 231 d1 = Func(XYZ,Amat) 232 x -= 2*dx 233 d2 = Func(XYZ,Amat) 234 x += dx 235 deriv[i][j] = (d1-d2)/(2*dx) 236 return deriv 204 237 205 238 def getRestAngle(XYZ,Amat): … … 233 266 return Evec[Order[0]] 234 267 235 def getRestChiral(XYZ,Amat): 236 268 def getRestChiral(XYZ,Amat): 237 269 VecA = np.empty((3,3)) 238 270 VecA[0] = np.inner(XYZ[1]-XYZ[0],Amat) … … 240 272 VecA[2] = np.inner(XYZ[3]-XYZ[0],Amat) 241 273 return nl.det(VecA) 242 274 275 def getRestTorsion(XYZ,Amat,Coeff=[]): 276 VecA = np.empty((3,3)) 277 VecA[0] = np.inner(XYZ[1]-XYZ[0],Amat) 278 VecA[1] = np.inner(XYZ[2]-XYZ[1],Amat) 279 VecA[2] = np.inner(XYZ[3]-XYZ[2],Amat) 280 D = nl.det(VecA) 281 Mag = np.sqrt(np.sum(VecA*VecA,axis=1)) 282 P12 = np.sum(VecA[0]*VecA[1])/(Mag[0]*Mag[1]) 283 P13 = np.sum(VecA[0]*VecA[2])/(Mag[0]*Mag[2]) 284 P23 = np.sum(VecA[1]*VecA[2])/(Mag[1]*Mag[2]) 285 Ang = 1.0 286 if abs(P12) < 1.0 and abs(P23) < 1.0: 287 Ang = (P12*P23-P13)/(np.sqrt(1.-P12**2)*np.sqrt(1.-P23**2)) 288 TOR = (acosd(Ang)*D/abs(D)+720.)%360. 289 sum = 0. 290 if len(Coeff): 291 cof = np.reshape(Coeff,(3,3)).T 292 delt = TOR-cof[1] 293 delt = np.where(delt<-180.,delt+360.,delt) 294 delt = np.where(delt>180.,delt-360.,delt) 295 # pMax = np.min(cof[0]) 296 pMax = cof[0][np.argmin(delt)] 297 term = -cof[2]*delt**2 298 sum = np.sum(cof[0]*np.exp(term/1000.0))-pMax 299 return TOR,sum 300 243 301 def getDistDerv(Oxyz,Txyz,Amat,Tunit,Top,SGData): 244 302 -
trunk/GSASIIphsGUI.py
r814 r815 1739 1739 restData[PhaseName]['Bond'] = bondData 1740 1740 dist = G2mth.getRestDist(atXYZ,Amat) 1741 bondData['Bonds'].append([atIndx,atSymOp, dist,1.54,0.01])1741 bondData['Bonds'].append([atIndx,atSymOp,1.54,0.01]) 1742 1742 elif event.GetId() == G2gd.wxID_DRAWRESTRANGLE and len(indx) == 3: 1743 1743 try: … … 1748 1748 restData[PhaseName]['Angle'] = angleData 1749 1749 angle = G2mth.getRestAngle(atXYZ,Amat) 1750 angleData['Angles'].append([atIndx,atSymOp, angle,109.5,1.0])1750 angleData['Angles'].append([atIndx,atSymOp,109.5,1.0]) 1751 1751 elif event.GetId() == G2gd.wxID_DRAWRESTRPLANE and len(indx) > 3: 1752 1752 try: … … 1757 1757 restData[PhaseName]['Plane'] = planeData 1758 1758 plane = G2mth.getRestPlane(atXYZ,Amat) 1759 planeData['Planes'].append([atIndx,atSymOp, plane,0.0,0.01])1759 planeData['Planes'].append([atIndx,atSymOp,0.0,0.01]) 1760 1760 elif event.GetId() == G2gd.wxID_DRAWRESTRCHIRAL and len(indx) == 4: 1761 1761 try: … … 1766 1766 restData[PhaseName]['Chiral'] = chiralData 1767 1767 volume = G2mth.getRestChiral(atXYZ,Amat) 1768 chiralData['Volumes'].append([atIndx,atSymOp, volume,2.5,0.1])1768 chiralData['Volumes'].append([atIndx,atSymOp,2.5,0.1]) 1769 1769 else: 1770 1770 print '**** ERROR wrong number of atoms selected for this restraint' -
trunk/GSASIIrestrGUI.py
r814 r815 37 37 restrData = data[phaseName] 38 38 if 'Bond' not in restrData: 39 restrData['Bond'] = {'wtFactor':1.0,' Bonds':[],'Use':True}39 restrData['Bond'] = {'wtFactor':1.0,'Range':0.9,'Bonds':[],'Use':True} 40 40 if 'Angle' not in restrData: 41 restrData['Angle'] = {'wtFactor':1.0,' Angles':[],'Use':True}41 restrData['Angle'] = {'wtFactor':1.0,'Range':0.85,'Angles':[],'Use':True} 42 42 if 'Plane' not in restrData: 43 restrData['Plane'] = {'wtFactor':1.0,' Planes':[],'Use':True}43 restrData['Plane'] = {'wtFactor':1.0,'Range':0.9,'Planes':[],'Use':True} 44 44 if 'Chiral' not in restrData: 45 restrData['Chiral'] = {'wtFactor':1.0,' Volumes':[],'Use':True}45 restrData['Chiral'] = {'wtFactor':1.0,'Range':0.9,'Volumes':[],'Use':True} 46 46 if 'Torsion' not in restrData: 47 restrData['Torsion'] = {'wtFactor':1.0,' Coeff':{},'Torsions':[],'Use':True}47 restrData['Torsion'] = {'wtFactor':1.0,'Range':0.9,'Coeff':{},'Torsions':[],'Use':True} 48 48 if 'Rama' not in restrData: 49 restrData['Rama'] = {'wtFactor':1.0,' Coeff':{},'Ramas':[],'Use':True}49 restrData['Rama'] = {'wtFactor':1.0,'Range':0.9,'Coeff':{},'Ramas':[],'Use':True} 50 50 General = phasedata['General'] 51 51 Cell = General['Cell'][1:7] #skip flag & volume … … 56 56 AtLookUp = G2mth.FillAtomLookUp(Atoms) 57 57 if 'macro' in General['Type']: 58 Names = [atom[0]+ atom[1]+atom[2]+' '+atom[3] for atom in Atoms]58 Names = [atom[0]+':'+atom[1]+atom[2]+' '+atom[3] for atom in Atoms] 59 59 Ids = [] 60 60 Coords = [] … … 102 102 def OnAddRestraint(event): 103 103 page = G2frame.dataDisplay.GetSelection() 104 restName = G2frame.dataDisplay.GetPageText(page) 104 105 if 'Bond' in G2frame.dataDisplay.GetPageText(page): 105 bondRestData = restrData['Bond'] 106 AddBondRestraint(bondRestData) 106 AddBondRestraint(restrData['Bond']) 107 107 elif 'Angle' in G2frame.dataDisplay.GetPageText(page): 108 angleRestData = restrData['Angle'] 109 AddAngleRestraint(angleRestData) 108 AddAngleRestraint(restrData['Angle']) 110 109 elif 'Plane' in G2frame.dataDisplay.GetPageText(page): 111 AddPlaneRestraint( )110 AddPlaneRestraint(restrData['Plane']) 112 111 elif 'Chiral' in G2frame.dataDisplay.GetPageText(page): 113 AddChiralRestraint( )112 AddChiralRestraint(restrData['Chiral']) 114 113 elif 'Torsion' in G2frame.dataDisplay.GetPageText(page): 115 AddTorsionRestraint( )114 AddTorsionRestraint(restrData['Torsion']) 116 115 elif 'Rama' in G2frame.dataDisplay.GetPageText(page): 117 AddRamaRestraint( )116 AddRamaRestraint(restrData['Rama']) 118 117 119 118 def OnAddAARestraint(event): 120 119 page = G2frame.dataDisplay.GetSelection() 121 120 if 'Bond' in G2frame.dataDisplay.GetPageText(page): 122 bondRestData = restrData['Bond'] 123 AddAABondRestraint(bondRestData) 121 AddAABondRestraint(restrData['Bond']) 124 122 elif 'Angle' in G2frame.dataDisplay.GetPageText(page): 125 angleRestData = restrData['Angle'] 126 AddAAAngleRestraint(angleRestData) 123 AddAAAngleRestraint(restrData['Angle']) 127 124 elif 'Plane' in G2frame.dataDisplay.GetPageText(page): 128 AddAAPlaneRestraint( )125 AddAAPlaneRestraint(restrData['Plane']) 129 126 elif 'Chiral' in G2frame.dataDisplay.GetPageText(page): 130 AddAAChiralRestraint( )127 AddAAChiralRestraint(restrData['Chiral']) 131 128 elif 'Torsion' in G2frame.dataDisplay.GetPageText(page): 132 AddAATorsionRestraint( )129 AddAATorsionRestraint(restrData['Torsion']) 133 130 elif 'Rama' in G2frame.dataDisplay.GetPageText(page): 134 AddAARamaRestraint( )131 AddAARamaRestraint(restrData['Rama']) 135 132 136 133 def AddBondRestraint(bondRestData): … … 150 147 else: 151 148 Lists[listName].append([Ids[x],Types[x],Coords[x],]) 152 Factor = .85149 Factor = bondRestData['Range'] 153 150 indices = (-1,0,1) 154 151 Units = np.array([[h,k,l] for h in indices for k in indices for l in indices]) … … 181 178 else: 182 179 Topstr = str(Top) 183 newBond = [[Oid,Tid],['1',Topstr], \ 184 ma.getdata(dist[indb])[i],1.54,0.01] 180 newBond = [[Oid,Tid],['1',Topstr],1.54,0.01] 185 181 if newBond not in bondRestData['Bonds']: 186 182 bondRestData['Bonds'].append(newBond) … … 197 193 atoms = zip(Names,Coords,Ids) 198 194 199 Factor = .90195 Factor = bondRestData['Range'] 200 196 while macStr: 201 197 items = macStr.split() … … 224 220 obsd = np.sqrt(np.sum(np.inner(Amat,tCoord-oCoord)**2)) 225 221 if dist*Factor < obsd < dist/Factor: 226 newBond = [[oId,tId],['1','1'], obsd,dist,esd]222 newBond = [[oId,tId],['1','1'],dist,esd] 227 223 if newBond not in bondRestData['Bonds']: 228 224 bondRestData['Bonds'].append(newBond) … … 248 244 targAtoms = [[Ids[x+iBeg],Types[x+iBeg],Coords[x+iBeg]] for x in range(len(Names[iBeg:]))] 249 245 250 Factor = 1.0246 Factor = angleRestData['Range'] 251 247 indices = (-1,0,1) 252 248 Units = np.array([[h,k,l] for h in indices for k in indices for l in indices]) … … 287 283 angle = G2mth.getRestAngle(XYZ,Amat) 288 284 if angle not in angleRestData['Angles']: 289 angleRestData['Angles'].append([ids,ops, angle,109.5,1.0])285 angleRestData['Angles'].append([ids,ops,109.5,1.0]) 290 286 UpdateAngleRestr(angleRestData) 291 287 … … 294 290 if not macro: 295 291 return 292 atoms = zip(Names,Coords,Ids) 296 293 macStr = macro.readline() 297 294 while macStr: 298 295 items = macStr.split() 299 print items300 296 if 'F' in items[0]: 301 297 restrData['Angle']['wtFactor'] = float(items[1]) 302 298 elif 'S' in items[0]: 303 List = []304 299 res = items[1] 305 dist = items[2] 306 esd = items[3] 307 oAtm = items[4] 308 tAtm = items[5] 309 for name,Type,coords,id in zip(Names,Types,Coords,Ids): 310 if res == '*' or res in name: 311 if oAtm in name: 312 oCoord = coords 313 oId = id 314 oName = name 315 elif tAtm in name: 316 tCoord = coords 317 tId = id 318 tName = name 319 300 value = float(items[2]) 301 esd = float(items[3]) 302 Atms = items[4:7] 303 pAtms = ['','',''] 304 for i,atm in enumerate(Atms): 305 if '+' in atm: 306 pAtms[i] = atm.strip('+') 307 ids = np.array([0,0,0]) 308 coords = [[],[],[]] 309 rNum = -1 310 for name,coord,id in atoms: 311 names = name.split() 312 tNum = int(names[0].split(':')[0]) 313 if res in names[0]: 314 try: 315 ipos = Atms.index(names[2]) 316 ids[ipos] = id 317 coords[ipos] = coord 318 except ValueError: 319 continue 320 elif res == '*': 321 try: 322 ipos = Atms.index(names[2]) 323 if not np.all(ids): 324 rNum = int(names[0].split(':')[0]) 325 ids[ipos] = id 326 coords[ipos] = coord 327 except ValueError: 328 try: 329 if tNum == rNum+1: 330 ipos = pAtms.index(names[2]) 331 ids[ipos] = id 332 coords[ipos] = coord 333 except ValueError: 334 continue 335 if np.all(ids): 336 angle = [list(ids),['1','1','1'],value,esd] 337 if angle not in angleRestData['Angles']: 338 angleRestData['Angles'].append(angle) 339 ids = np.array([0,0,0]) 340 coords = [[],[],[]] 320 341 macStr = macro.readline() 321 342 macro.close() … … 337 358 origAtoms.append([Ids[x],Types[x],Coords[x]]) 338 359 339 def AddAAPlaneRestraint( ):360 def AddAAPlaneRestraint(planeRestData): 340 361 macro = getMacroFile('plane') 341 362 if not macro: 342 363 return 364 atoms = zip(Names,Coords,Ids) 343 365 macStr = macro.readline() 344 366 while macStr: 345 367 items = macStr.split() 346 print items347 368 if 'F' in items[0]: 348 369 restrData['Plane']['wtFactor'] = float(items[1]) 349 370 elif 'S' in items[0]: 350 List = []351 371 res = items[1] 352 dist = items[2] 353 esd = items[3] 354 oAtm = items[4] 355 tAtm = items[5] 356 for name,Type,coords,id in zip(Names,Types,Coords,Ids): 357 if res == '*' or res in name: 358 if oAtm in name: 359 oCoord = coords 360 oId = id 361 oName = name 362 elif tAtm in name: 363 tCoord = coords 364 tId = id 365 tName = name 366 372 esd = float(items[2]) 373 Atms = items[3:] 374 pAtms = ['' for i in Atms] 375 for i,atm in enumerate(Atms): 376 if '+' in atm: 377 pAtms[i] = atm.strip('+') 378 rNum = -1 379 ids = np.zeros(len(Atms)) 380 coords = [[] for i in range(len(Atms))] 381 ops = ['1' for i in range(len(Atms))] 382 for name,coord,id in atoms: 383 names = name.split() 384 tNum = int(names[0].split(':')[0]) 385 if res in names[0]: 386 try: 387 ipos = Atms.index(names[2]) 388 ids[ipos] = id 389 coords[ipos] = coord 390 except ValueError: 391 continue 392 elif res == '*': 393 try: 394 ipos = Atms.index(names[2]) 395 if not np.all(ids): 396 rNum = int(names[0].split(':')[0]) 397 ids[ipos] = id 398 coords[ipos] = coord 399 except ValueError: 400 try: 401 if tNum == rNum+1: 402 ipos = pAtms.index(names[2]) 403 ids[ipos] = id 404 coords[ipos] = coord 405 except ValueError: 406 continue 407 if np.all(ids): 408 plane = [list(ids),ops,0.0,esd] 409 if plane not in planeRestData['Planes']: 410 planeRestData['Planes'].append(plane) 411 ids = np.zeros(len(Atms)) 412 coords = [[] for i in range(len(Atms))] 367 413 macStr = macro.readline() 368 414 macro.close() 415 UpdatePlaneRestr(planeRestData) 369 416 370 417 def AddChiralRestraint(): 371 418 print 'Chiral restraint' 372 419 373 def AddAAChiralRestraint( ):420 def AddAAChiralRestraint(chiralRestData): 374 421 macro = getMacroFile('chiral') 375 422 if not macro: 376 423 return 424 atoms = zip(Names,Coords,Ids) 377 425 macStr = macro.readline() 378 426 while macStr: 379 427 items = macStr.split() 380 print items381 428 if 'F' in items[0]: 382 429 restrData['Chiral']['wtFactor'] = float(items[1]) 383 430 elif 'S' in items[0]: 384 List = []385 431 res = items[1] 386 dist = items[2] 387 esd = items[3] 388 oAtm = items[4] 389 tAtm = items[5] 390 for name,Type,coords,id in zip(Names,Types,Coords,Ids): 391 if res == '*' or res in name: 392 if oAtm in name: 393 oCoord = coords 394 oId = id 395 oName = name 396 elif tAtm in name: 397 tCoord = coords 398 tId = id 399 tName = name 400 432 value = float(items[2]) 433 esd = float(items[3]) 434 Atms = items[4:8] 435 ids = np.array([0,0,0,0]) 436 coords = [[],[],[],[]] 437 for name,coord,id in atoms: 438 names = name.split() 439 if res in names[0]: 440 try: 441 ipos = Atms.index(names[2]) 442 ids[ipos] = id 443 coords[ipos] = coord 444 except ValueError: 445 pass 446 if np.all(ids): 447 chiral = [list(ids),['1','1','1','1'],value,esd] 448 if chiral not in chiralRestData['Volumes']: 449 chiralRestData['Volumes'].append(chiral) 450 ids = np.array([0,0,0,0]) 451 coords = [[],[],[],[]] 401 452 macStr = macro.readline() 402 453 macro.close() 454 UpdateChiralRestr(chiralRestData) 403 455 404 456 def AddTorsionRestraint(): 405 457 print 'Torsion restraint' 406 458 407 def AddAATorsionRestraint(): 408 print 'Add AA Torsion' 459 def AddAATorsionRestraint(torsionRestData): 460 macro = getMacroFile('torsion') 461 if not macro: 462 return 463 atoms = zip(Names,Coords,Ids) 464 macStr = macro.readline()[:-1] 465 while macStr: 466 items = macStr.split() 467 if 'F' in items[0]: 468 restrData['Torsion']['wtFactor'] = float(items[1]) 469 elif 'A' in items[0]: 470 name = items[10] 471 coeff = np.zeros(9) 472 for i,item in enumerate(items[1:10]): 473 coeff[i] = float(item) 474 torsionRestData['Coeff'][name] = coeff 475 elif 'S' in items[0]: 476 Name = items[1] 477 res = items[2] 478 esd = float(items[3]) 479 Atms = items[4:8] 480 pAtms = ['','','',''] 481 for i,atm in enumerate(Atms): 482 if '+' in atm: 483 pAtms[i] = atm.strip('+') 484 ids = np.array([0,0,0,0]) 485 coords = [[],[],[],[]] 486 rNum = -1 487 for name,coord,id in atoms: 488 names = name.split() 489 tNum = int(names[0].split(':')[0]) 490 if res in names[0]: 491 try: 492 ipos = Atms.index(names[2]) 493 ids[ipos] = id 494 coords[ipos] = coord 495 except ValueError: 496 continue 497 elif res == '*': 498 try: 499 ipos = Atms.index(names[2]) 500 if not np.all(ids): 501 rNum = int(names[0].split(':')[0]) 502 ids[ipos] = id 503 coords[ipos] = coord 504 except ValueError: 505 try: 506 if tNum == rNum+1: 507 ipos = pAtms.index(names[2]) 508 ids[ipos] = id 509 coords[ipos] = coord 510 except ValueError: 511 continue 512 if np.all(ids): 513 torsion = [list(ids),['1','1','1','1'],Name,esd] 514 if torsion not in torsionRestData['Torsions']: 515 torsionRestData['Torsions'].append(torsion) 516 ids = np.array([0,0,0,0]) 517 coords = [[],[],[],[]] 518 macStr = macro.readline() 519 macro.close() 520 UpdateTorsionRestr(torsionRestData) 409 521 410 522 def AddRamaRestraint(): 411 523 print 'Ramachandran restraint' 412 524 413 def AddAARamaRestraint(): 414 print 'Add AA Ramachandran' 525 def AddAARamaRestraint(ramaRestData): 526 macro = getMacroFile('ramachandran') 527 if not macro: 528 return 529 atoms = zip(Names,Coords,Ids) 530 macStr = macro.readline() 531 while macStr: 532 items = macStr.split() 533 if 'F' in items[0]: 534 restrData['Rama']['wtFactor'] = float(items[1]) 535 elif 'A' in items[0]: 536 nTerms = int(items[1]) 537 name = items[2] 538 coeff = np.zeros((nTerms,6)) 539 for i in range(nTerms): 540 macStr = macro.readline() 541 items = macStr.split() 542 coeff[i] = np.fromstring([item for item in items]) 543 ramaRestData['Coeff'][name] = coeff 544 elif 'S' in items[0]: 545 name = items[1] 546 res = items[2] 547 esd = float(items[3]) 548 Atms = items[4:9] 549 orNum = -1 550 ids = np.array([0,0,0,0,0]) 551 coords = [[],[],[],[],[]] 552 for name,coord,id in atoms: 553 names = name.split() 554 if res in names[0]: 555 rNum = int(names[0].split(res)[0]) 556 try: 557 ipos = Atms.index(names[2]) 558 ids[ipos] = id 559 coords[ipos] = coord 560 except ValueError: 561 pass 562 if np.all(ids): 563 orNum = rNum 564 torsionRestData['Rama'].append([list(ids),['1','1','1','1'],name,esd]) 565 ids = np.array([0,0,0,0,0]) 566 coords = [[],[],[],[],[]] 567 macStr = macro.readline() 568 macro.close() 569 UpdateRamaRestr(ramaRestData) 570 415 571 416 572 def WtBox(wind,restData): 573 if 'Range' not in restData: restData['Range'] = 0.9 #patch 417 574 418 575 def OnWtFactor(event): … … 423 580 restData['wtFactor'] = value 424 581 wtfactor.SetValue('%.2f'%(value)) 582 583 def OnRange(event): 584 try: 585 value = float(sRange.GetValue()) 586 except ValueError: 587 value = 1.0 588 restData['Range'] = value 589 sRange.SetValue('%.2f'%(value)) 425 590 426 591 def OnUseData(event): … … 437 602 useData.SetValue(restData['Use']) 438 603 wtBox.Add(useData,0,wx.ALIGN_CENTER_VERTICAL) 604 if 'Bond' in restData or 'Angle' in restData: 605 wtBox.Add(wx.StaticText(wind,-1,'Search range:'),0,wx.ALIGN_CENTER_VERTICAL) 606 sRange = wx.TextCtrl(wind,-1,value='%.2f'%(restData['Range']),style=wx.TE_PROCESS_ENTER) 607 sRange.Bind(wx.EVT_TEXT_ENTER,OnRange) 608 sRange.Bind(wx.EVT_KILL_FOCUS,OnRange) 609 wtBox.Add(sRange,0,wx.ALIGN_CENTER_VERTICAL) 439 610 return wtBox 440 611 … … 522 693 if 'macro' in General['Type']: 523 694 colLabels = ['(res) A - (res) B','calc','obs','esd'] 524 for i,[indx,ops, dcalc,dobs,esd] in enumerate(bondList):695 for i,[indx,ops,obs,esd] in enumerate(bondList): 525 696 atoms = G2mth.GetAtomItemsById(Atoms,AtLookUp,indx,0,4) 526 697 name = '' 527 698 for atom in atoms: 528 699 name += '('+atom[1]+atom[0].strip()+atom[2]+') '+atom[3]+' - ' 529 table.append([name[:-3],dcalc,dobs,esd]) 700 XYZ = np.array(G2mth.GetAtomItemsById(Atoms,AtLookUp,indx,cx,3)) 701 calc = G2mth.getRestDist(XYZ,Amat) 702 table.append([name[:-3],calc,obs,esd]) 530 703 rowLabels.append(str(i)) 531 704 else: 532 705 colLabels = ['A+SymOp - B+SymOp','calc','obs','esd'] 533 for i,[indx,ops,dcalc,dobs,esd] in enumerate(bondList): 534 atoms = G2mth.GetAtomItemsById(Atoms,AtLookUp,indx,ct-1) 535 table.append([atoms[0]+'+('+ops[0]+') - '+atoms[1]+'+('+ops[1]+')',dcalc,dobs,esd]) 706 for i,[indx,ops,obs,esd] in enumerate(bondList): 707 names = G2mth.GetAtomItemsById(Atoms,AtLookUp,indx,ct-1) 708 XYZ = np.array(G2mth.GetAtomItemsById(Atoms,AtLookUp,indx,cx,3)) 709 XYZ = G2mth.getSyXYZ(XYZ,ops,SGData) 710 calc = G2mth.getRestDist(XYZ,Amat) 711 table.append([names[0]+'+('+ops[0]+') - '+names[1]+'+('+ops[1]+')',calc,obs,esd]) 536 712 rowLabels.append(str(i)) 537 713 bondTable = G2gd.Table(table,rowLabels=rowLabels,colLabels=colLabels,types=Types) … … 553 729 BondRestr.SetSizer(mainSizer) 554 730 Size = mainSizer.Fit(G2frame.dataFrame) 555 Size[0] += 5731 Size[0] = 600 556 732 Size[1] += 50 #make room for tab 557 733 BondRestr.SetSize(Size) 558 734 BondRestr.SetScrollbars(10,10,Size[0]/10-4,Size[1]/10-1) 559 G2frame.dataFrame. setSizePosLeft(Size)735 G2frame.dataFrame.SetSize(Size) 560 736 561 737 def UpdateAngleRestr(angleRestData): 562 563 def OnColSort(event):564 r,c = event.GetRow(),event.GetCol()565 if r < 0 and c == 0:566 names = G2mth.sortArray(table,0)567 angles = []568 for name in names:569 idx = table.index(name)570 angles.append(angleList[idx])571 angleRestData['Angles'] = angles572 UpdateAngleRestr(angleRestData)573 738 574 739 def OnChangeValue(event): … … 623 788 if 'macro' in General['Type']: 624 789 colLabels = ['(res) A - (res) B - (res) C','calc','obs','esd'] 625 for i,[indx,ops, dcalc,dobs,esd] in enumerate(angleList):790 for i,[indx,ops,obs,esd] in enumerate(angleList): 626 791 atoms = G2mth.GetAtomItemsById(Atoms,AtLookUp,indx,0,4) 627 792 name = '' 628 793 for atom in atoms: 629 794 name += '('+atom[1]+atom[0].strip()+atom[2]+') '+atom[3]+' - ' 630 table.append([name[:-3],dcalc,dobs,esd]) 795 XYZ = np.array(G2mth.GetAtomItemsById(Atoms,AtLookUp,indx,cx,3)) 796 calc = G2mth.getRestAngle(XYZ,Amat) 797 table.append([name[:-3],calc,obs,esd]) 631 798 rowLabels.append(str(i)) 632 799 else: 633 800 colLabels = ['A+SymOp - B+SymOp - C+SymOp','calc','obs','esd'] 634 for i,[indx,ops, dcalc,dobs,esd] in enumerate(angleList):801 for i,[indx,ops,obs,esd] in enumerate(angleList): 635 802 atoms = G2mth.GetAtomItemsById(Atoms,AtLookUp,indx,ct-1) 636 table.append([atoms[0]+'+('+ops[0]+') - '+atoms[1]+'+('+ops[1]+') - '+atoms[2]+ \ 637 '+('+ops[2]+')',dcalc,dobs,esd]) 803 name = atoms[0]+'+('+ops[0]+') - '+atoms[1]+'+('+ops[1]+') - '+atoms[2]+ \ 804 '+('+ops[2]+')' 805 XYZ = np.array(G2mth.GetAtomItemsById(Atoms,AtLookUp,indx,cx,3)) 806 XYZ = G2mth.getSyXYZ(XYZ,ops,SGData) 807 calc = G2mth.getRestAngle(XYZ,Amat) 808 table.append([name,calc,obs,esd]) 638 809 rowLabels.append(str(i)) 639 810 angleTable = G2gd.Table(table,rowLabels=rowLabels,colLabels=colLabels,types=Types) … … 655 826 AngleRestr.SetSizer(mainSizer) 656 827 Size = mainSizer.Fit(G2frame.dataFrame) 657 Size[0] += 5828 Size[0] = 600 658 829 Size[1] += 50 #make room for tab 659 830 AngleRestr.SetSize(Size) 660 831 AngleRestr.SetScrollbars(10,10,Size[0]/10-4,Size[1]/10-1) 661 G2frame.dataFrame.setSizePosLeft(Size) 832 G2frame.dataFrame.SetSize(Size) 833 # G2frame.dataFrame.setSizePosLeft(Size) 662 834 663 835 def UpdatePlaneRestr(planeRestData): … … 705 877 if 'macro' in General['Type']: 706 878 colLabels = ['(res) atom','calc','obs','esd'] 707 for i,[indx,ops, dcalc,dobs,esd] in enumerate(planeList):879 for i,[indx,ops,obs,esd] in enumerate(planeList): 708 880 atoms = G2mth.GetAtomItemsById(Atoms,AtLookUp,indx,0,4) 709 881 name = '' … … 712 884 if (a+1)%3 == 0: 713 885 name += '\n' 714 table.append([name[:-3],dcalc,dobs,esd]) 886 XYZ = np.array(G2mth.GetAtomItemsById(Atoms,AtLookUp,indx,cx,3)) 887 calc = G2mth.getRestPlane(XYZ,Amat) 888 table.append([name[:-3],calc,obs,esd]) 715 889 rowLabels.append(str(i)) 716 890 else: 717 891 colLabels = ['atom+SymOp','calc','obs','esd'] 718 for i,[indx,ops, dcalc,dobs,esd] in enumerate(planeList):892 for i,[indx,ops,obs,esd] in enumerate(planeList): 719 893 atoms = G2mth.GetAtomItemsById(Atoms,AtLookUp,indx,ct-1) 720 atString = '' 894 XYZ = np.array(G2mth.GetAtomItemsById(Atoms,AtLookUp,indx,cx,3)) 895 XYZ = G2mth.getSyXYZ(XYZ,ops,SGData) 896 calc = G2mth.getRestPlane(XYZ,Amat) 897 name = '' 721 898 for a,atom in enumerate(atoms): 722 atString+= atom+'+ ('+ops[a]+'),'899 name += atom+'+ ('+ops[a]+'),' 723 900 if (a+1)%3 == 0: 724 atString+= '\n'725 table.append([ atString[:-1],dcalc,dobs,esd])901 name += '\n' 902 table.append([name[:-1],calc,obs,esd]) 726 903 rowLabels.append(str(i)) 727 904 planeTable = G2gd.Table(table,rowLabels=rowLabels,colLabels=colLabels,types=Types) … … 743 920 PlaneRestr.SetSizer(mainSizer) 744 921 Size = mainSizer.Fit(G2frame.dataFrame) 745 Size[0] += 5922 Size[0] = 600 746 923 Size[1] += 50 #make room for tab 747 924 PlaneRestr.SetSize(Size) 748 925 PlaneRestr.SetScrollbars(10,10,Size[0]/10-4,Size[1]/10-1) 749 G2frame.dataFrame.setSizePosLeft(Size) 926 G2frame.dataFrame.SetSize(Size) 927 # G2frame.dataFrame.setSizePosLeft(Size) 750 928 751 929 def UpdateChiralRestr(chiralRestData): … … 802 980 if 'macro' in General['Type']: 803 981 colLabels = ['(res) O (res) A (res) B (res) C','calc','obs','esd'] 804 for i,[indx,ops, dcalc,dobs,esd] in enumerate(volumeList):982 for i,[indx,ops,obs,esd] in enumerate(volumeList): 805 983 atoms = G2mth.GetAtomItemsById(Atoms,AtLookUp,indx,0,4) 806 984 name = '' 807 985 for atom in atoms: 808 986 name += '('+atom[1]+atom[0].strip()+atom[2]+') '+atom[3]+' ' 809 table.append([name,dcalc,dobs,esd]) 987 XYZ = np.array(G2mth.GetAtomItemsById(Atoms,AtLookUp,indx,cx,3)) 988 calc = G2mth.getRestChiral(XYZ,Amat) 989 table.append([name,calc,obs,esd]) 810 990 rowLabels.append(str(i)) 811 991 else: 812 992 colLabels = ['O+SymOp A+SymOp B+SymOp C+SymOp)','calc','obs','esd'] 813 for i,[indx,ops, dcalc,dobs,esd] in enumerate(volumeList):993 for i,[indx,ops,obs,esd] in enumerate(volumeList): 814 994 atoms = G2mth.GetAtomItemsById(Atoms,AtLookUp,indx,ct-1) 815 table.append([atoms[0]+'+('+ops[0]+') '+atoms[1]+'+('+ops[1]+') '+atoms[2]+ \ 816 '+('+ops[2]+') '+atoms[3]+'+('+ops[3]+')',dcalc,dobs,esd]) 995 name = atoms[0]+'+('+ops[0]+') '+atoms[1]+'+('+ops[1]+') '+atoms[2]+ \ 996 '+('+ops[2]+') '+atoms[3]+'+('+ops[3]+')' 997 XYZ = np.array(G2mth.GetAtomItemsById(Atoms,AtLookUp,indx,cx,3)) 998 XYZ = G2mth.getSyXYZ(XYZ,ops,SGData) 999 calc = G2mth.getRestChiral(XYZ,Amat) 1000 table.append([name,calc,obs,esd]) 817 1001 rowLabels.append(str(i)) 818 1002 volumeTable = G2gd.Table(table,rowLabels=rowLabels,colLabels=colLabels,types=Types) … … 834 1018 ChiralRestr.SetSizer(mainSizer) 835 1019 Size = mainSizer.Fit(G2frame.dataFrame) 836 Size[0] += 51020 Size[0] = 600 837 1021 Size[1] += 50 #make room for tab 838 1022 ChiralRestr.SetSize(Size) 839 1023 ChiralRestr.SetScrollbars(10,10,Size[0]/10-4,Size[1]/10-1) 840 G2frame.dataFrame.setSizePosLeft(Size) 1024 G2frame.dataFrame.SetSize(Size) 1025 # G2frame.dataFrame.setSizePosLeft(Size) 841 1026 842 1027 def UpdateTorsionRestr(torsionRestData): … … 852 1037 UpdateTorsionRestr(torsionRestData) 853 1038 1039 def OnChangeEsd(event): 1040 rows = Torsions.GetSelectedRows() 1041 if not rows: 1042 return 1043 Torsions.ClearSelection() 1044 val = torsionList[rows[0]][4] 1045 dlg = G2phG.SingleFloatDialog(G2frame,'New value','Enter new esd for torsion restraints',val,[0.,5.],'%.2f') 1046 if dlg.ShowModal() == wx.ID_OK: 1047 parm = dlg.GetValue() 1048 for r in rows: 1049 volumeList[r][4] = parm 1050 dlg.Destroy() 1051 UpdateTorsionRestr(torsionRestData) 1052 854 1053 TorsionRestr.DestroyChildren() 855 1054 dataDisplay = wx.Panel(TorsionRestr) … … 857 1056 mainSizer.Add((5,5),0) 858 1057 mainSizer.Add(WtBox(TorsionRestr,torsionRestData),0,wx.ALIGN_CENTER_VERTICAL) 859 1058 mainSizer.Add(wx.StaticText(TorsionRestr,-1,'Torsion function coefficients:'),0,wx.ALIGN_CENTER_VERTICAL) 1059 1060 coeffDict = torsionRestData['Coeff'] 1061 if len(coeffDict): 1062 table = [] 1063 rowLabels = [] 1064 Types = 9*[wg.GRID_VALUE_FLOAT+':10,4',] 1065 colLabels = ['Mag A','Pos A','Width A','Mag B','Pos B','Width B','Mag C','Pos C','Width C'] 1066 for item in coeffDict: 1067 rowLabels.append(item) 1068 table.append(coeffDict[item]) 1069 coeffTable = G2gd.Table(table,rowLabels=rowLabels,colLabels=colLabels,types=Types) 1070 Coeff = G2gd.GSGrid(TorsionRestr) 1071 Coeff.SetTable(coeffTable, True) 1072 Coeff.AutoSizeColumns(False) 1073 for r in range(len(coeffDict)): 1074 for c in range(9): 1075 Coeff.SetReadOnly(r,c,True) 1076 Coeff.SetCellStyle(r,c,VERY_LIGHT_GREY,True) 1077 mainSizer.Add(Coeff,0,) 1078 mainSizer.Add((5,5)) 860 1079 torsionList = torsionRestData['Torsions'] 1080 mainSizer.Add(wx.StaticText(TorsionRestr,-1,'Torsion restraints:'),0,wx.ALIGN_CENTER_VERTICAL) 861 1081 if len(torsionList): 862 1082 table = [] … … 864 1084 Types = 2*[wg.GRID_VALUE_STRING,]+3*[wg.GRID_VALUE_FLOAT+':10,2',] 865 1085 if 'macro' in General['Type']: 866 colLabels = ['(res) A (res) B (res) C (res) D','coef name',' calc','obs','esd']867 for i,[indx,ops,cofName, dcalc,dobs,esd] in enumerate(torsionList):1086 colLabels = ['(res) A (res) B (res) C (res) D','coef name','torsion','obs E','esd'] 1087 for i,[indx,ops,cofName,esd] in enumerate(torsionList): 868 1088 atoms = G2mth.GetAtomItemsById(Atoms,AtLookUp,indx,0,4) 869 1089 name = '' 870 1090 for atom in atoms: 871 1091 name += '('+atom[1]+atom[0].strip()+atom[2]+') '+atom[3]+' ' 872 table.append([name,cofName,dcalc,dobs,esd]) 1092 XYZ = np.array(G2mth.GetAtomItemsById(Atoms,AtLookUp,indx,cx,3)) 1093 tor,calc = G2mth.getRestTorsion(XYZ,Amat,coeffDict[cofName]) 1094 table.append([name,cofName,tor,calc,esd]) 873 1095 rowLabels.append(str(i)) 874 1096 else: 875 colLabels = ['A+SymOp B+SymOp C+SymOp D+SymOp)','coef name',' calc','obs','esd']876 for i,[indx,ops,cofName, dcalc,dobs,esd] in enumerate(torsionList):1097 colLabels = ['A+SymOp B+SymOp C+SymOp D+SymOp)','coef name','torsion','obs E','esd'] 1098 for i,[indx,ops,cofName,esd] in enumerate(torsionList): 877 1099 atoms = G2mth.GetAtomItemsById(Atoms,AtLookUp,indx,ct-1) 1100 XYZ = np.array(G2mth.GetAtomItemsById(Atoms,AtLookUp,indx,cx,3)) 1101 XYZ = G2mth.getSyXYZ(XYZ,ops,SGData) 1102 tor,calc = G2mth.getRestTorsion(XYZ,Amat,coeffDict[cofName]) 878 1103 table.append([atoms[0]+'+('+ops[0]+') '+atoms[1]+'+('+ops[1]+') '+atoms[2]+ \ 879 '+('+ops[2]+') '+atoms[3]+'+('+ops[3]+')',cofName, dcalc,dobs,esd])1104 '+('+ops[2]+') '+atoms[3]+'+('+ops[3]+')',cofName,tor,calc,esd]) 880 1105 rowLabels.append(str(i)) 881 1106 torsionTable = G2gd.Table(table,rowLabels=rowLabels,colLabels=colLabels,types=Types) … … 896 1121 TorsionRestr.SetSizer(mainSizer) 897 1122 Size = mainSizer.Fit(G2frame.dataFrame) 898 Size[0] += 51123 Size[0] = 600 899 1124 Size[1] += 50 #make room for tab 900 1125 TorsionRestr.SetSize(Size) 901 1126 TorsionRestr.SetScrollbars(10,10,Size[0]/10-4,Size[1]/10-1) 902 G2frame.dataFrame.setSizePosLeft(Size) 1127 G2frame.dataFrame.SetSize(Size) 1128 # G2frame.dataFrame.setSizePosLeft(Size) 903 1129 904 1130 def UpdateRamaRestr(ramaRestData): … … 958 1184 RamaRestr.SetSizer(mainSizer) 959 1185 Size = mainSizer.Fit(G2frame.dataFrame) 960 Size[0] += 51186 Size[0] = 600 961 1187 Size[1] += 50 #make room for tab 962 1188 RamaRestr.SetSize(Size) 963 1189 RamaRestr.SetScrollbars(10,10,Size[0]/10-4,Size[1]/10-1) 964 G2frame.dataFrame.setSizePosLeft(Size) 1190 G2frame.dataFrame.SetSize(Size) 1191 # G2frame.dataFrame.setSizePosLeft(Size) 965 1192 966 1193 def OnPageChanged(event):
Note: See TracChangeset
for help on using the changeset viewer.