Changeset 3239 for trunk/GSASIIphsGUI.py
- Timestamp:
- Jan 23, 2018 9:51:03 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/GSASIIphsGUI.py ¶
r3234 r3239 1036 1036 Styles = [] 1037 1037 Radii = [] 1038 Names = [] 1038 1039 for atom in atomData: 1039 1040 Atoms.append(np.array(atom[cx:cx+3])) 1040 1041 Styles.append(atom[cs]) 1042 Names.append(ord(atom[ct-1].ljust(4)[3])) 1041 1043 try: 1042 1044 if not hydro and atom[ct] == 'H': … … 1048 1050 Atoms = np.array(Atoms) 1049 1051 Radii = np.array(Radii) 1050 IASR = zip(Indx,Atoms,Styles,Radii) 1051 for atomA in IASR: 1052 Names = np.array(Names) 1053 IASRN = zip(Indx,Atoms,Styles,Radii,Names) 1054 for atomA in IASRN: 1052 1055 if atomA[2] in ['lines','sticks','ellipsoids','balls & sticks','polyhedra']: 1053 1056 Dx = Atoms-atomA[1] 1054 1057 dist = ma.masked_less(np.sqrt(np.sum(np.inner(Amat,Dx)**2,axis=0)),0.5) #gets rid of G2frame & disorder "bonds" < 0.5A 1058 if generalData['Type'] == 'macromolecular': #eliminate cross disorder residue bonds 1059 m1 = ma.getmask(dist) 1060 if atomA[4] in [ord('A'),]: 1061 m2 = ma.getmask(ma.masked_equal(Names,ord('B'))) 1062 dist = ma.array(dist,mask=ma.mask_or(m1,m2)) 1063 if atomA[4] in [ord('B'),]: 1064 m2 = ma.getmask(ma.masked_equal(Names,ord('A'))) 1065 dist = ma.array(dist,mask=ma.mask_or(m1,m2)) 1055 1066 sumR = atomA[3]+Radii 1056 1067 IndB = ma.nonzero(ma.masked_greater(dist-data['Drawing']['radiusFactor']*sumR,0.)) #get indices of bonded atoms … … 7320 7331 wx.BeginBusyCursor() 7321 7332 try: 7333 isave = 0 7322 7334 while iatm < len(Atoms): 7323 7335 atom = Atoms[iatm] … … 7331 7343 VAR = rbRes['rbXYZ'][rbRef[1]]-rbRes['rbXYZ'][rbRef[0]] 7332 7344 VBR = rbRes['rbXYZ'][rbRef[2]]-rbRes['rbXYZ'][rbRef[0]] 7345 incr = 1 7346 isave = 0 7347 if 'N A' in atom[3]: #disordered residue - read every other atom 7348 isave = iatm+1 7349 incr = 2 7350 if 'N B' in atom[3]: 7351 incr = 2 7333 7352 rbObj = {'RBname':rbRes['RBname']+':'+str(rbRes['useCount']),'numChain':numChain} 7334 7353 rbAtoms = [] … … 7337 7356 rbAtoms.append(np.array(Atoms[iatm][cx:cx+3])) 7338 7357 rbIds.append(Atoms[iatm][20]) 7339 iatm += 1 #puts this at beginning of next residue? 7358 iatm += incr #puts this at beginning of next residue? 7359 if 'N B' in atom[3]: #end of disorder - reset next atom position 7360 iatm -= 1 7361 incr = 1 7340 7362 Orig = rbAtoms[rbRef[0]] 7341 7363 rbObj['RBId'] = RBIds[res] … … 7371 7393 rbRes['useCount'] += 1 7372 7394 RBObjs.append(rbObj) 7395 if isave: 7396 iatm = isave 7373 7397 data['RBModels']['Residue'] = RBObjs 7374 7398 for RBObj in RBObjs:
Note: See TracChangeset
for help on using the changeset viewer.