Changeset 2286
- Timestamp:
- May 22, 2016 3:51:48 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/imports/G2phase_INS.py
r2285 r2286 68 68 Compnd = '' 69 69 Atoms = [] 70 aTypes = [] 70 71 A = np.zeros(shape=(3,3)) 71 72 S = file.readline() … … 92 93 SGData = G2IO.SGData # P 1 93 94 self.warnings += '\nThe space group is not given in an ins file and has been set to "P 1".' 94 self.warnings += " Change this in phase's General tab."95 self.warnings += "\nChange this in phase's General tab; NB: it might be in the Phase name." 95 96 elif S[:4] in 'SFAC': 96 97 aTypes = S[4:].split() 98 if 'H' in aTypes: 99 self.warnings += '\nHydrogen atoms found; consider replacing them with stereochemically tied ones.' 100 self.warnings += "\nDo 'Edit/Insert H atoms' in this phase's Atoms tab after deleting the old ones." 97 101 elif S[0] == 'Q': 98 102 pass 99 elif np.any(Aindx): #this will find an atom record! 100 iNum = Aindx.index(True) 101 Atype = S[:iNum] 103 elif np.any(Aindx) or S[:4].strip() in aTypes: #this will find an atom record! 104 try: 105 iNum = Aindx.index(True) 106 except ValueError: 107 iNum = 4 108 Atype = S[:iNum].strip() 102 109 Aname = S[:4] 103 110 x,y,z = S[9:45].split() … … 130 137 self.errors = 'Error after read complete' 131 138 Phase = G2IO.SetNewPhase(Name='ShelX phase',SGData=SGData,cell=cell+[Volume,]) 139 Phase['General']['Name'] = Title 132 140 Phase['General']['Type'] = 'nuclear' 133 141 Phase['General']['AtomPtrs'] = [3,1,7,9]
Note: See TracChangeset
for help on using the changeset viewer.